-   Linux - Software (
-   -   Problem with gprof, no gmon.out file !! (

taj2000 05-03-2009 12:57 PM

Problem with gprof, no gmon.out file !!

I am trying to profile a program with gprof. I am using gcc to build and link, and I am using the -pg option. However, when my program exits (gracefully), no gmon.out file is generated. I am using Linux and gcc 3.4.2

Here is a sample of my build commands:

gcc -pg -Werror -g -nostdinc -I SIM/include/include1 - I SIM/include/include2 -o SIM/obj/simulate_main.o -c SIM/simulate_main.c

gcc -pg -Werror -g -nostdinc -I SIM/include/include1 - I SIM/include/include2 -o SIM/obj/traffic_gen.o -c SIM/traffic_gen.c

gcc -nostdinc -I SIM/include/include1 - I SIM/include/include2 -pg -Werror -g -Wl,-export-dynamic ./SIM/obj/simulate_main.o ./SIM/obj/traffic_gen.o -lpthread -o SIM/bin/simulate

gcc -nostdinc -I SIM/include/include1 - I SIM/include/include2 -static -pg -Werror -g -Wl,-export-dynamic ./SIM/obj/simulate_main.o ./SIM/obj/traffic_gen.o -lpthread -o SIM/bin/simulate_static



clvic 05-04-2009 04:33 PM

How do you execute the linked program? From which directory?
I think you should look for the file in the current directory, that is, the directory from where you start the program. Maybe you're looking in the wrong place?

linux newb 05-21-2009 09:01 PM

Hi, did you manage to solve ur problem? coz i'm getting the same thing. no gmon.out. and i looked at the current directory. i even did a search in case the file end up somewhere else. if ur problem is solved, would appreciate if u can share the solution with me. thanks in advance

All times are GMT -5. The time now is 11:01 AM.