Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
有人在deepin上用过gprof吗?为什么gmon.out文件里面什么都没有
Apps Section
346
views ·
0
replies ·
To
floor
Go
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
Like 0
Favorite
View the author
All Replies
No replies yet
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
【Enhanced Repo】Better Deepin Repo is released
Popular Events
More
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的软件。