i have installed gperftools-2.0, but i can't get cpu profile statistics
following is my steps to get the statistics:
- install gperftools tar -xzvfj gperftools-2.0.tar.gz
2.edit cpp file test.cpp
#include <stdio.h>
#include <gperftools/profiler.h>
int main()
{
ProfilerStart("test.prof");
for (int i = 0; i<100; i++)
{
printf("hello world!");
}
ProfilerStop();
return 0;
}
compile g++ test.cpp -o test -O0 -I/usr/local/include/ -L/usr/local/lib/ -lprofiler
run ./test
report pprof ./test --text test.prof
whose output is: Using local file ./test. Using local file test.prof.
what's wrong in my steps?