我尝试测量开销,我们在C ++程序中使用lua脚本。我决定使用gprof。我写了简单的程序,如:
问题是gmon.out没有时间数据。它看起来像是:
Flat profile:
Each sample counts as 0.01 seconds.
no time accumulated
% cumulative self self total
time seconds seconds calls Ts/call Ts/call name
% the percentage of the total running time of the
time program used by this function.
... //rest of file
我想知道在C函数或对象函数(aka方法)中包装此代码是否会产生任何影响。我还检查了this主题,但没有一个解决方案适合我。有什么想法吗?