1

When executing stap for the purposes of generating flamegraph data, why is my out.stap-stacks missing process data?

  • OS: RHEL 5.10.0.2
  • Kernel: 2.6.18-371.11.1.el5
  • SystemTap: 1.8-6.el5

Packages installed:

systemtap-sdt-devel-1.8-6.el5

systemtap-devel-1.8-6.el5

systemtap-devel-1.8-6.el5

systemtap-runtime-1.8-6.el5

systemtap-sdt-devel-1.8-6.el5

systemtap-1.8-6.el5

systemtap-initscript-1.8-6.el5

systemtap-client-1.8-6.el5

systemtap-server-1.8-6.el5

systemtap-testsuite-1.8-6.el5

kernel-devel-2.6.18-371.11.1.el5

kernel-debug-devel-2.6.18-371.11.1.el5

Command used:

stap -s 32 -D MAXBACKTRACE=100 -D MAXSTRINGLEN=4096 -D MAXMAPENTRIES=10240 \
    -D MAXACTION=10000 -D STP_OVERLOAD_THRESHOLD=5000000000 --all-modules \
    -ve 'global s; probe timer.profile { s[backtrace()] <<< 1; } 
    probe end { foreach (i in s+) { print_stack(i);
    printf("\t%d\n", @count(s[i])); } } probe timer.s(60) { exit(); }' \
    > out.stap-stacks

Sample out.stap-stacks file:

0xffffffff8000e81a 0x0 1 0xffffffff8004ab87 0x0 1 0xffffffff8025d15d 0x0 1 0xffffffff80239356 0x0 1 0xffffffff8004219a 0x0 1 0xffffffff8000ca32 0x0 1 0xffffffff8003214e 0x0 1 0xffffffff80013bc8 0x0 1 0xffffffff80232d41 0x0 1 0xffffffff8001a4ca 0x0 1 0xffffffff80011db5 0x0 1 0xffffffff8004aad2 0x0 1 0xffffffff800ec8bb 0x0 1 0xffffffff8003ead5 0x0 1 0xffffffff80234c43 0x0

1 Answers1

1

The backtrace() function is limited to kernel-space backtraces, and print_stack() maps only kernel-space addresses to symbols. (I cannot explain why the 0xffffffff8* addresses weren't converted to the symbols; maybe some combination of ancient systemtap and ancient kernel?)

If you want to print userspace backtrace data too, you will need to use the u* family of backtrace-related functions.

See also https://sourceware.org/systemtap/examples/#profiling/pf4.stp for a similar script that includes userspace work.

fche
  • 2,641
  • 20
  • 28