Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom profiles #62

Merged
merged 1 commit into from
Apr 26, 2022
Merged

Add support for custom profiles #62

merged 1 commit into from
Apr 26, 2022

Conversation

maoe
Copy link
Contributor

@maoe maoe commented Apr 20, 2022

This patch adds the new --profile NAME option to support cargo's custom profiles. The behavior hasn't changed when --release is passed or when nothing related to profiles are given.

My motivation for this change is that I need to set split-debuginfo to packed for Instrument to be able to load source locations, but I'd like to use the default release profile for everything else.

[profile.instruments]
inherits = "release"
split-debuginfo = "packed"

Then you can run cargo-instruments like this

cargo instruments --profile instruments -t time -- ...

@maoe maoe force-pushed the custom-profiles branch from 1c16563 to d96aa67 Compare April 20, 2022 23:08
@maoe
Copy link
Contributor Author

maoe commented Apr 20, 2022

#61 seems to use -p so I just removed the short flag here.

Copy link
Owner

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, this looks like a useful improvement. One little nit, otherwise happy to merge!

src/opt.rs Outdated Show resolved Hide resolved
@cmyr
Copy link
Owner

cmyr commented Apr 25, 2022

This should also get rebased now that #61 is landed :)

@cmyr
Copy link
Owner

cmyr commented Apr 25, 2022

Another thought:

We could also do something fancy, where if there's a profile named 'instruments' then we use it by default? 🤔

This patch adds the new --profile NAME option to support cargo's
custom profiles. The behavior hasn't changed when --release is
passed or when nothing related to profiles are given.
@maoe maoe force-pushed the custom-profiles branch from d96aa67 to 3eb77d5 Compare April 26, 2022 00:13
@maoe
Copy link
Contributor Author

maoe commented Apr 26, 2022

Thanks for reviewing this. Rebased and force-pushed.

@cmyr cmyr merged commit 4c09a3c into cmyr:master Apr 26, 2022
@maoe maoe deleted the custom-profiles branch April 26, 2022 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants