From: Ivan Babrou <ibobrik@gmail.com>
To: arnaldo.melo@gmail.com
Cc: linux-perf-users@vger.kernel.org, daniel@iogearbox.net,
ast@kernel.org, davem@davemloft.net, dsahern@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: eBPF program symbols in perf top
Date: Wed, 28 Nov 2018 16:20:03 -0800 [thread overview]
Message-ID: <CANWdNRBxserM6h_u1WNXgW0qiBzoAWM433aU-RT4+WGmZ=wPmQ@mail.gmail.com> (raw)
In-Reply-To: <20181128130438.GB31608@kernel.org>
On Wed, Nov 28, 2018 at 5:04 AM Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
>
> Em Tue, Nov 27, 2018 at 11:41:19PM -0800, Ivan Babrou escreveu:
> > Hey Arnaldo,
> >
> > Thanks for the quick response. I've tried your patch and it works as
> > expected with perf top.
>
> Ok, I'll add the patch to my perf/core branch with your Reported-by and
> Tested-by, is that ok with you?
Sounds good to me.
> > What are the reasons for not giving kallsyms precedence at this moment?
>
> The use of vmlinux for these things predates having many of the code
> modifications that are performed in a live kernel these days, also
> pre-dates eBPF, etc, etc, so using vmlinux, when found, was better
> because ELF symtabs are more expressive, kallsyms have just the start of
> a symbol, for instance, etc.
>
> Having that said, with the advent of things like Intel PT, etc using
> /proc/kcore + /proc/kallsyms became a requirement, there is even code to
> stash copies of those in ~/.debug/ for post processing (off-site using
> 'perf archive' even, etc).
>
> I _think_ that switch to using /proc/kallsyms as default now is becoming
> a requirement, just haven't thought thru all possible implications of
> doing that.
I'm looking forward to having it enabled by default, also happy to apply
a patch and start using it internally when you have it.
> I don't recall if there is a way to set kallsyms precedence in
> ~/.perfconfig, have to look at that.
>
> - Arnaldo
>
> > On Tue, Nov 27, 2018 at 5:30 AM Arnaldo Carvalho de Melo
> > <arnaldo.melo@gmail.com> wrote:
> > >
> > > Em Mon, Nov 26, 2018 at 04:21:15PM -0800, Ivan Babrou escreveu:
> > > > It's possible to see eBPF programs in "perf report" and "perf script"
> > > > started with "--kallsyms=/proc/kallsyms", if net.core.bpf_jit_kallsyms
> > > > sysctl is set to 1. However, it's not possible to pass "--kallsyms" to
> > > > "perf top".
> > >
> > >
> > > So, the first step, I think, is to check if having 'perf top
> > > --kallsyms=..." would help, i.e. to check the patch that introduced
> > > '--kallsyms' to 'perf report' and see if that would be difficult to have
> > > the same functionality in 'perf top', the cset where it is introduced
> > > is:
> > >
> > > b226a5a72901b ("perf report: Allow user to specify path to kallsyms file"
> > >
> > > Below is the resulting patch, can you please check if with that you get
> > > the result you want? We can then go from there to some simplification,
> > > perhaps give precedence to kallsyms.
> > >
> > > diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
> > > index 808b664343c9..44d89fb9c788 100644
> > > --- a/tools/perf/Documentation/perf-top.txt
> > > +++ b/tools/perf/Documentation/perf-top.txt
> > > @@ -70,6 +70,9 @@ Default is to monitor all CPUS.
> > > --ignore-vmlinux::
> > > Ignore vmlinux files.
> > >
> > > +--kallsyms=<file>::
> > > + kallsyms pathname
> > > +
> > > -m <pages>::
> > > --mmap-pages=<pages>::
> > > Number of mmap data pages (must be a power of two) or size
> > > diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> > > index aa0c73e57924..1252d1759064 100644
> > > --- a/tools/perf/builtin-top.c
> > > +++ b/tools/perf/builtin-top.c
> > > @@ -1289,6 +1289,8 @@ int cmd_top(int argc, const char **argv)
> > > "file", "vmlinux pathname"),
> > > OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
> > > "don't load vmlinux even if found"),
> > > + OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
> > > + "file", "kallsyms pathname"),
> > > OPT_BOOLEAN('K', "hide_kernel_symbols", &top.hide_kernel_symbols,
> > > "hide kernel symbols"),
> > > OPT_CALLBACK('m', "mmap-pages", &opts->mmap_pages, "pages",
>
> --
>
> - Arnaldo
prev parent reply other threads:[~2018-11-29 0:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANWdNRAD2XBnztZN760mOX+LfXY_uAvsRqEnkTJnqwrZCBK92w@mail.gmail.com>
[not found] ` <20181127133054.GE15747@kernel.org>
[not found] ` <CANWdNRDdSMeQ1RHpHMoG7-aRVjufG79jyrZqYqho2_3gX3hrfw@mail.gmail.com>
2018-11-28 13:04 ` eBPF program symbols in perf top Arnaldo Carvalho de Melo
2018-11-29 0:20 ` Ivan Babrou [this message]
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='CANWdNRBxserM6h_u1WNXgW0qiBzoAWM433aU-RT4+WGmZ=wPmQ@mail.gmail.com' \
--to=ibobrik@gmail.com \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.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).