All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Grant <Al.Grant@arm.com>
To: "leo.yan@linaro.org" <leo.yan@linaro.org>
Cc: "acme@redhat.com" <acme@redhat.com>, Jiri Olsa <jolsa@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Coresight ML <coresight@lists.linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: Question: perf dso support for /proc/kallsyms
Date: Fri, 2 Nov 2018 14:12:28 +0000	[thread overview]
Message-ID: <AM6PR08MB3686181290347EC355AEDCF986CF0@AM6PR08MB3686.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20181102134649.GB3983@leoy-ThinkPad-X240s>

> root@debian:~/coresight_test# perf buildid-list
> 0242d9154c78df1d8fe1d0512c36a236d0861a18 [kernel.kallsyms]
> b8c89e8ba41a2ea486c66a50c29c60d38c34a759 /root/coresight_test/main
> 26b12a9d1a54ed2b0478cb0203435b76aabab3fb /usr/lib/aarch64-linux-gnu/ld-
> 2.27.so
> 8fca7ed524c9469b065af83bc8a529fe72858f53 [vdso]
> 25829a59e21012cfde7850b30a310cd3a58f531c
> /root/coresight_test/libcstest.so
> 70512527439ef76c8802a7a2a546bde6a5a6e967 /usr/lib/aarch64-linux-
> gnu/libc-2.27.so
> root@debian:~/coresight_test# ls
> ~/.debug/\[kernel.kallsyms\]/0242d9154c78df1d8fe1d0512c36a236d0861a18/
> kallsyms

What's in that last file? I've seen it happen that the copy of kallsyms
in ~/.debug has the symbol addresses as zeroes - possibly because it
was created when you didn't have permissions. That's really a bug
in perf, as cacheing a copy of this file with the addresses zeroed out
is kind of pointless. Again, this happens on Intel too.

Then, you can give yourself permissions - but perf's already cached
the file and won't update it!

If you delete it, and then rerun perf record (either as sudo or now
that you've got kptr_restrict=0) you should see it reappear, with
correct kernel addresses.

Perhaps nobody spotted this on Intel because perf report goes directly
to /proc/kallsyms. But it would be an issue if you ran a perf report
on a perf.data from an older kernel and it had to go to ~/.debug.
At that point the fact that ~/.debug/[kernel.kallsyms] had zeroes would
mean you couldn't symbolicate any addresses.

Al



>
> > Does it all work if you run perf record as sudo? Or if you do
> >
> >    sudo sysctl kernel.kptr_restrict=0
> >
> > before you run perf record?
>
> Yes, tested this on Juno board with Debian rootFS and logined in with 'root' user.
> I suspected the pointer permission issue so checked with below command:
>
> root@debian:~/coresight_test# cat /proc/sys/kernel/kptr_restrict
> 0
>
> Thanks,
> Leo Yan
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

  reply	other threads:[~2018-11-02 14:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02  2:55 Question: perf dso support for /proc/kallsyms leo.yan
2018-11-02 12:08 ` Al Grant
2018-11-02 13:46   ` leo.yan
2018-11-02 14:12     ` Al Grant [this message]
2018-11-02 14:43       ` leo.yan
2018-11-02 13:08 ` Mike Leach
2018-11-02 14:02   ` leo.yan
2018-11-07  3:33 ` leo.yan
2018-11-07 14:10 ` Jiri Olsa
2018-11-08  8:51   ` leo.yan
2018-11-09  8:11     ` Jiri Olsa

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=AM6PR08MB3686181290347EC355AEDCF986CF0@AM6PR08MB3686.eurprd08.prod.outlook.com \
    --to=al.grant@arm.com \
    --cc=acme@redhat.com \
    --cc=coresight@lists.linaro.org \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.