I am using gprof for profiling a C program for the first time. The following lines appears in the report that I generated using;
$ gprof test_gprof gmon.out > analysis.txt
In Flat Profile
Each sample counts as 0.01 seconds.
is this the maximum resolution in time?
In call graph:
granularity: each sample hit covers 4 byte(s) for 7.69% of 0.13 seconds
What exactly is 4 bytes here ? and what time it is talking about?
Please read charpter 5.1 and 5.2 of this manual. You can also read this manual on CentOS with the following command:
In Flat Profile,
indicates that the sampling period is 100Hz, which is not controlled by gprof itself(Check this page and this one for more details). Therefore,
0.01 seconds
is theoretically not the maximum resolution in time.As for Call graph, according to this doc from Oracle,