fencekicker
fencekicker

Reputation: 852

Can't see kernel symbols in 'perf report' when trying to trace a probe on CentOS 7.7

I'm trying to see what kernel code calls a specific function on CentOS 7.7 (x86-64). I've tried this:

perf probe -a vsnprintf
perf record -e probe:vsnprintf -aR sleep 10

Then, when I try:

perf report --stdio

I see only a bunch of hex numbers in the output instead of function names:

# Total Lost Samples: 0
#
# Samples: 331  of event 'probe:vsnprintf'
# Event count (approx.): 331
#
# Children      Self  Trace output      
# ........  ........  ..................
#
   100.00%   100.00%  (ffffffffaf58c750)
            |          
            |--56.19%--0
            |          __GI___libc_read
            |          0xffffffffaf98bede
            |          0xffffffffaf4493bf
            |          0xffffffffaf4484ff
            |          0xffffffffaf4c09b0

The kernel version (I'm running inside a VM on KVM):

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I've picked up vsnprintf because it shows up often in 'perf top' (the kernel symbol - there I see the symbols correctly).

Is there a way to see actual function names?

Upvotes: 0

Views: 933

Answers (1)

jms
jms

Reputation: 34

Perf in RHEL 7.7 has a bug that prevents it from reporting kernel symbols: https://access.redhat.com/solutions/4797281

I strongly suspect CentOS 7.7 has the exact same bug. Following the workaround suggested in the page above, I've downgraded perf to the version in CentOS 7.6, and it seems to work:

# give access to packages from 7.6
yum-config-manager --add-repo=http://vault.centos.org/centos/7.6.1810/updates/x86_64/

# reinstall older perf
yum remove perf
yum install perf-3.10.0-957.1.3.el7

# optional: disable the vault repo
yum-config-manager --disable vault.centos.org_centos_7.6.1810_updates_x86_64_

# test that it now works
perf record -a -g -- sleep 3
perf report --stdio
# looks good!

Upvotes: 1

Related Questions