Problem with gprof, no gmon.out file !!
Hi,
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 2.6.4.xxx and gcc 3.4.2
Here is a sample of my build commands:
Compilation:
------------
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
Linkage:
--------
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
thanks,
Taj
|