linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Milian Wolff <milian.wolff@kdab.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: perf trace: Problems initializing symbol libraries!
Date: Tue, 17 May 2016 09:51:44 +0200	[thread overview]
Message-ID: <27102286.6frB0TEpAH@milian-kdab2> (raw)
In-Reply-To: <20160516201359.GB3455@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 3622 bytes --]

On Monday, May 16, 2016 5:13:59 PM CEST Arnaldo Carvalho de Melo wrote:
> Em Mon, May 16, 2016 at 01:31:48PM +0200, Milian Wolff escreveu:
> > On Donnerstag, 12. Mai 2016 15:10:44 CEST Arnaldo Carvalho de Melo wrote:
> > > Em Thu, May 12, 2016 at 02:05:35PM +0200, Milian Wolff escreveu:
> > > > I'm getting the following error when trying to run `perf trace` built
> > > > from
> > > > acme's perf/core branch on an Ubuntu 16.04 machine:
> > > > 
> > > > $ perf trace
> > > > Problems initializing symbol libraries!
> 
> Ok, so with the perf tool that comes with ubuntu 16.04 I get:
> 
>   acme@ubuntu:~$ perf record ls
>   WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,
>   check /proc/sys/kernel/kptr_restrict.
> 
>   Samples in kernel functions may not be resolved if a suitable vmlinux
>   file is not found in the buildid cache or in the vmlinux path.
> 
>   Samples in kernel modules won't be resolved at all.
> 
>   If some relocation was applied (e.g. kexec) symbols may be misresolved
>   even with a suitable vmlinux or kallsyms file.
> 
>   Cannot read kernel map
>   Couldn't record kernel reference relocation symbol
>   Symbol resolution may be skewed if relocation was used (e.g. kexec).
>   Check /proc/kallsyms permission or run as root.
>   git  perf.data
>   [ perf record: Woken up 1 times to write data ]
>   [ perf record: Captured and wrote 0.002 MB perf.data (14 samples) ]
>   acme@ubuntu:~$
> 
> Which is a better message than:
> 
>   acme@ubuntu:~$ perf trace
>   Error:	No permissions to read
> /sys/kernel/debug/tracing/events/raw_syscalls/sys_(enter|exit) Hint:	Try
> 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
> 
>   acme@ubuntu:~$ sudo mount -o remount,mode=755 /sys/kernel/debug/tracing
>   acme@ubuntu:~$ perf trace
>   Error:	No permissions to read
> /sys/kernel/debug/tracing/events/raw_syscalls/sys_(enter|exit) Hint:	Try
> 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
> 
>   acme@ubuntu:~$ sudo mount -o remount,mode=755 /sys/kernel/debug
>   acme@ubuntu:~$ perf trace
>   Problems initializing symbol libraries!
>   acme@ubuntu:~$
> 
> So, if I follow the instructions given in the 'perf record ls' case:
> 
>   acme@ubuntu:~$ sudo sh -c "echo 0 > /proc/sys/kernel/kptr_restrict"
>   acme@ubuntu:~$ perf trace
>   Error:	Operation not permitted.
>   Hint:	Check /proc/sys/kernel/perf_event_paranoid setting.
>   Hint:	For system wide tracing it needs to be set to -1.
>   Hint:	Try: 'sudo sh -c "echo -1 > /proc/sys/kernel/
perf_event_paranoid"'
>   Hint:	The current value is 1.
>   acme@ubuntu:~$
> 
> It gets a bit better, then, one more step...
> 
>   acme@ubuntu:~$ perf trace --ev sched:sched_switch -e nanosleep sleep 1
>        0.938 (   0.025 ms): sleep/7461 nanosleep(rqtp: 0x7ffc77ca6310       
>                                 ) ... 0.938 (           ):
> sched:sched_switch:prev_comm=sleep prev_pid=7461 prev_prio=120 prev_state=S
> ==> next_comm=swapper/1 next_pid=0 next_prio=120) 1001.076 (1000.163 ms):
> sleep/7461  ... [continued]: nanosleep()) = 0 acme@ubuntu:~$
> 
> So, the problem is not with what is in my perf/core branch, its that ubuntu
> 16.04's kernel comes with kptr_restrict defaulting to 1, I have to get that
> warning emitted by 'perf record' into 'perf trace'.

Thanks a lot Arnaldo,

that makes it work for me. I'll include the line to set kptr_restrict to 0 
into my "perf init" script that elevates the restrictions.

Thanks again

-- 
Milian Wolff | milian.wolff@kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5903 bytes --]

  reply	other threads:[~2016-05-17  7:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12 12:05 perf trace: Problems initializing symbol libraries! Milian Wolff
2016-05-12 18:10 ` Arnaldo Carvalho de Melo
2016-05-16 11:31   ` Milian Wolff
2016-05-16 13:15     ` Arnaldo Carvalho de Melo
2016-05-16 20:13     ` Arnaldo Carvalho de Melo
2016-05-17  7:51       ` Milian Wolff [this message]
2016-05-17 15:06         ` Arnaldo Carvalho de Melo
2016-05-23 10:05           ` Milian Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27102286.6frB0TEpAH@milian-kdab2 \
    --to=milian.wolff@kdab.com \
    --cc=acme@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).