linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why the stack frame in perf.data isn't displayed in FlameGraph?
@ 2017-05-18  4:09 Nan Xiao
  2017-05-18  7:32 ` Milian Wolff
  0 siblings, 1 reply; 7+ messages in thread
From: Nan Xiao @ 2017-05-18  4:09 UTC (permalink / raw)
  To: linux-perf-users

Hi all,

I am a newbie of using perf tools and FlameGraph. I write a simple
test program which is rafacimentoed from this
NTL(http://www.shoup.net/ntl/doc/tour-ex3.html) program:

#include <NTL/ZZX.h>

using namespace std;
using namespace NTL;

void inner(int i, ZZX& t, Vec<ZZX>& phi)
{
        for (long j = 1; j <= i-1; j++)
         if (i % j == 0)
            t *= phi(j);
}

void outer(int i, Vec<ZZX>& phi)
{
        ZZX t;
        t = 1;
        inner(i, t, phi);
        phi(i) = (ZZX(INIT_MONO, i) - 1)/t;
        cout << phi(i) << "\n";
}

int main()
{
   Vec<ZZX> phi(INIT_SIZE, 100);

   for (long i = 1; i <= phi.length(); i++) {
      outer(i, phi);
   }
}

And compile it using following command:

    g++ -pthread test.cpp -lntl -lgmp

I use "perf record -g ./a.out" to profile the program, but "perf
report" can only show "main" and "outer", no "inner" function
(https://github.com/NanXiao/images/blob/master/perf/perf.data):

......
+    7.10%     0.00%  a.out    a.out                [.] outer
+    7.10%     0.00%  a.out    a.out                [.] main
......

From the perf.svg(https://github.com/NanXiao/images/blob/master/perf/perf.svg),
there is neither "outer" nor "inner" stack frames.

Since there is "outer" in perf.data, why it can't display in
FlameGraph? Another doubt is why perf.data doesn't contain "inner"
stack frame?

Thanks in advance!

Best Regards
Nan Xiao

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-23 10:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-18  4:09 Why the stack frame in perf.data isn't displayed in FlameGraph? Nan Xiao
2017-05-18  7:32 ` Milian Wolff
2017-05-18 13:24   ` Nan Xiao
2017-05-18 19:01     ` Milian Wolff
2017-05-19  1:50       ` Nan Xiao
2017-05-23  9:32         ` Milian Wolff
2017-05-23 10:14           ` Nan Xiao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).