User forums > Using Code::Blocks
I have enabled "Profile code when executed [-pg]" but can't get Gprof to work.
Dice:
Thanks stahta01 and oBFusCATed for your help. I was able to get it working but adding an extra printf("Test\n"); after my Hello World. I'm not sure why it works now and it didn't before. I do have one other question for you if you don't mind. On "Gprof's Output" under the tabs "Flat Profile" and "Call Graph" there doesn't seem to be any data. Is this because my program is too short like oBFusCATed suggested? Do I need to do something else in order to populate this with data? Thanks for your time.
Alpha:
If you are essentially running a "hello world" program that finishes in a fraction of a second, there simply is not any profiling data for gprof to collect, so nothing can be output.
Dice:
--- Quote from: Alpha on January 15, 2016, 05:56:05 am ---If you are essentially running a "hello world" program that finishes in a fraction of a second, there simply is not any profiling data for gprof to collect, so nothing can be output.
--- End quote ---
Thanks. I added a getchar() and was able to pause the program long enough to get an output to gmon. Thanks everyone for your help!
oBFusCATed:
Read the docs, please. They'll make lots of thing clear what gprof can and cannot do.
Dice:
--- Quote from: oBFusCATed on January 15, 2016, 09:44:54 am ---Read the docs, please. They'll make lots of thing clear what gprof can and cannot do.
--- End quote ---
Will do, thanks for all the help. Just for clarity, is this the doc you're talking about? https://sourceware.org/binutils/docs/gprof/
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version