有人在deepin上用过gprof吗?为什么gmon.out文件里面什么都没有
Tofloor
poster avatar
188******30
deepin
2018-08-05 17:42
Author
测试代码是:#include "stdio.h"
static int sub(void);

int main(void)
{
    int i;

    printf("helloworld\n");

    for(i = 0; i < 10; i++)
        sub();

    return 0;
}

static int sub(void)
{
    unsigned i=0;
    while(i<1000){}
    return 0;
}

执行
gcc -pg test.c
./a.out
gprof a.out 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.

cumulative a running sum of the number of seconds accounted
seconds   for by this function and those listed above it.

显示没有调用任何函数,全都是网上找测试方法,代码和命令都是复制的,为什么用不了啊?是设置不对,还是我操作有问题?有没有大佬知道怎么解决或者有什么可以替代gprof的软件。
Reply Favorite View the author
All Replies

No replies yet