Hello,
J’ai un projet C sous Eclipse (linux) et j’aimerais utiliser gprof afin d’optimiser mes algorithmes. J’ai suivi scrupuleusement ceci récupéré sur les news eclipse CDT :
[quote]== Setting up gprof ==
The basic method to using gprof is to
|| Step || Instruction ||
||1) || Get the program working (debug it, etc) ||
||2) || Configure the project so the -pg option is used ||
||3) || Rebuild the project ||
||4) || Run the program (First cut I did ‘’‘Run’’’ on the debug build)
||
||5) || Run the external tool ‘’‘gprof’’’ ||
=== configuring the project so the -pg option is used ===
- Select the project and right click to bring up the context sensitive
menu. Choose ‘’‘properties’’’ - A properties dialog will appear
-
In the left pane, select ‘’‘C/C++ Build’’’
-
In the right pane (configuration settings groupbox), select
’’‘Debugging’’’. -
Make sure the following settings are observed (minimally)
|| Field Name || Value ||
|| Debug Level || ‘’‘Maximum (-g3)’’’ ||
|| Other Debugging Flags || ‘’’-ggdb’’’ ||
|| Generate prof information (-p) || ‘’‘unchecked’’’ ||
|| Generate gprof information (-pg) || ‘’‘checked’’’ || -
Press ‘’‘OK’’’ or ‘’‘Apply’’’ then ‘’‘OK’’’ to accept the changes.
=== Preparing to do a run ===
-
- On the menu select, ‘’‘Project | Rebuild All’’’ to build the project.
- On the menu select, ‘’‘Run | Run…’’’ to open up the run
configuration dialog.- Once you have run once, you can just do ‘’‘Run | Run last
launched’’’.
- Once you have run once, you can just do ‘’‘Run | Run last
- Press the ‘’‘New’’’ button and then select what build to run and what
arguments to use. - Press the ‘’‘Apply’’’ button to save your changes.
- Press the ‘’‘Run’’’ button to run your program.
- from the linux shell you should see a new file appear called
gmon.out in the directory where the program was executed from.[/quote]
- from the linux shell you should see a new file appear called
La seule différence est que j’exécute le programme depuis un terminal. Mais à la fin de l’exécution, aucun fichier “gmon.out”, ni dans le dossier des sources, ni dans le dossier Debug. Quelqu’un aurait une idée du problème ? Faut-il impérativement lancer l’exécution depuis l’interface Eclipse (run…) ?
Merci d’avance,
Patrick