i try to use gprof command: gprof -s executable.exe gmon.out gmon.sum
to merge profiling data gethered from 2 runs of my prog. but the following line appears:
gprof: out of memory allocating 3403207348 bytes after a total of 196608 bytes
my prog is quite simple(just one for loop), if i run once, the run time is too short( it shows 0.00s) for gprof to record.
In cygwin, i do the following steps:
1.gcc -pg -o fl forAndWhilLoop.c
2.fl (run the prog)
3.mv gmon.out gmon.sum
4.fl (run the prog)
5.gprof -s fl.exe gmon.out gmon.sum
6.gprof fl.exe gmon.sum>gmon.out
7.gprof fl.exe
My program:
int main(void)
{
int fac=1;
int count=10;
int k;
for(k=1;k<=count;k++)
{
fac = fac * k;
}
return 0;
}
so can anyone help me with this problem? thx!