Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: JohnCell on June 21, 2023, 05:00:50 pm
-
Hello guys !
I'd like to know if it's possible to use CodeBlocks (or any add-on ) for code profiling under Windows ?
I've not been able to find any tutorial.
Thanks,
John
-
No idea if it still works.
https://wiki.codeblocks.org/index.php/Code_Profiler_plugin (https://wiki.codeblocks.org/index.php/Code_Profiler_plugin)
-
No idea if it still works.
Last time I tried there were solid problems, but I suppose related to fresh mingw versions, not C::B.
-
Hello! I hope this isn't too late to help!
I just tested it out on one of my projects. Here are the steps I took to get it working:
- [Optional] Make a build target for profiling (Project > Properties > Build Targets).
- Add the -pg compiler to the build target. (I believe you'll also want -g too..)
- Compile the build target.
- Run the application. This'll create a gmon.out file in the executable's directory.
- Quit the application
- Run the profiler through Code::Blocks (Plugins > Code Profiler).
Code::Blocks uses gprof for profiling. You won't get nicely drawn call graphs but you could also try and using gprof more directly:
- https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_mono/gprof.html
- I'm sure there's more tutorials on gprof out there too...
I'm currently using C::B version 20.03-r11983