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 gprof profiling support. #7547

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

Rossmaxx
Copy link
Contributor

@Rossmaxx Rossmaxx commented Oct 17, 2024

Adds gprof support for profiling the builds. Also removed the -fomit-frame-pointer flag from swh and tap suite as the flag interferes with the -pg flag used here.

per https://stackoverflow.com/questions/14666665/trying-to-understand-gcc-option-fomit-frame-pointer , this option makes getting stack traces nearly impossible, and the performance improvements seems to be negligible on 64 bit systems, especially when debugging.

to use gprof:
after building with the WANT_DEBUG_GPROF flag turned on, run lmms, and after running, gprof ./lmms gmon.out > report.txt from the build directory. This will generate a text file with the profiling data. Do note that this method is tested only on GCC, and windows builds might not be supported.

@Rossmaxx Rossmaxx requested a review from DomClark October 17, 2024 11:01
plugins/LadspaEffect/swh/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@Rossmaxx
Copy link
Contributor Author

I have updated the title description according to the recent changes.

@Rossmaxx Rossmaxx changed the title Improve debugging ability and add gprof profiling support. Add gprof profiling support. Oct 20, 2024
@JohannesLorenz
Copy link
Contributor

I was wondering if it makes sense to allow gprof even in Debug mode. At least, it turned out that the results were not so far from the Release mode results.

Still, I wonder if we should print a warning if gprof is active in Debug mode, so the user knows that the results may not be representative?

Copy link
Contributor

@JohannesLorenz JohannesLorenz left a comment

Choose a reason for hiding this comment

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

Approved.

What I did:

  • Functional review ✔️
  • Style review ✔️
  • Test review ✔️

@Rossmaxx
Copy link
Contributor Author

I'll merge this in 2 days if no one objects. I choose to merge this with 1 approval because this is a trivial PR and shouldn't have any impact other than the flag

@Rossmaxx
Copy link
Contributor Author

I was wondering if it makes sense to allow gprof even in Debug mode. At least, it turned out that the results were not so far from the Release mode results.

Still, I wonder if we should print a warning if gprof is active in Debug mode, so the user knows that the results may not be representative?

saw this now after I took another look. I could but I choose not to for now. I don't see any need to add a warning, building on debug mode, one should naturally know that the performance won't be good.

CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@Rossmaxx
Copy link
Contributor Author

Rossmaxx commented Dec 7, 2024

I am putting a 1 week notice period for merge. Dom has a comment on including clang support, which unfortunately clang refuses to work for me the way it does for gcc. I'll put in a comment explaining the situation before merge.

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.

3 participants