Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Add "profiling" cargo build profile #24343

Closed

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Apr 14, 2022

Problem

Building binaries designed for profiling (optimizations ON, debug symbols ON) could be easier.

Summary of Changes

Add a new cargo build profile, "profiling", which inherits from "release" and enables debug symbols.

To use:

$ cargo build --profile profiling --bin solana-validator

Also open to other names. Specifically, should the profile be the intent (i.e. "test", "bench", "release", "debug"), or the details (i.e. "release-with-debug-symbols")? As you can see, I've gone with the intent-side. But I acknowledge that --profile profiling isn't the best.

@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #24343 (f6b84d0) into master (b9caa8c) will decrease coverage by 0.0%.
The diff coverage is 86.6%.

@@            Coverage Diff            @@
##           master   #24343     +/-   ##
=========================================
- Coverage    82.1%    82.1%   -0.1%     
=========================================
  Files         582      582             
  Lines      162041   162383    +342     
=========================================
+ Hits       133132   133384    +252     
- Misses      28909    28999     +90     

@stale
Copy link

stale bot commented Apr 25, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Apr 25, 2022
@KirillLykov
Copy link
Contributor

Would be nice to specify there also compiler option -C force-frame-pointers=y' to prevent getting rid of frame pointer. This allows sampling with stack information for perf.

@stale stale bot removed the stale [bot only] Added to stale content; results in auto-close after a week. label Apr 29, 2022
@brooksprumo
Copy link
Contributor Author

Would be nice to specify there also compiler option -C force-frame-pointers=y' to prevent getting rid of frame pointer. This allows sampling with stack information for perf.

Yes, I agree. That's why this PR has gone stale; I don't know of a way to add these rustc flags to a profile. I was hoping to effectively have:

RUSTFLAGS="-g -C force-frame-pointers=y -C target-cpu=native"

@KirillLykov
Copy link
Contributor

Would be nice to specify there also compiler option -C force-frame-pointers=y' to prevent getting rid of frame pointer. This allows sampling with stack information for perf.

Yes, I agree. That's why this PR has gone stale; I don't know of a way to add these rustc flags to a profile. I was hoping to effectively have:

RUSTFLAGS="-g -C force-frame-pointers=y -C target-cpu=native"

Looks like it is possible to create a .cargo/config file and specify flags there, yet seems that this feature doesn't always work well see

@stale
Copy link

stale bot commented Jun 12, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jun 12, 2022
@stale
Copy link

stale bot commented Jul 10, 2022

This stale pull request has been automatically closed. Thank you for your contributions.

@stale stale bot closed this Jul 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants