lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Jan 2018 19:57:59 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Wang YanQing <udknight@...il.com>, acme@...nel.org,
        peterz@...radead.org, mingo@...hat.com,
        alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf report: Provide libtraceevent with a kernel symbol
 resolver

On Thu, Jan 18, 2018 at 10:22:30PM +0800, Wang YanQing wrote:
> On Thu, Jan 18, 2018 at 10:43:18AM +0100, Jiri Olsa wrote:
> > On Wed, Jan 17, 2018 at 12:48:12AM +0800, Wang YanQing wrote:
> > > On Mon, Jan 15, 2018 at 11:06:11AM +0100, Jiri Olsa wrote:
> > > > On Mon, Jan 15, 2018 at 12:47:32PM +0800, Wang YanQing wrote:
> > > > > So that beautifiers wanting to resolve kernel function addresses to
> > > > > names can do its work, and when we use "perf report" for output of
> > > > > "perf kmem record", we will get kernel symbol output.
> > > > > 
> > > > > Signed-off-by: Wang YanQing <udknight@...il.com>
> > > > > ---
> > > > >  tools/perf/builtin-report.c | 9 +++++++++
> > > > >  1 file changed, 9 insertions(+)
> > > > > 
> > > > > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> > > > > index dd4df9a..7b65100 100644
> > > > > --- a/tools/perf/builtin-report.c
> > > > > +++ b/tools/perf/builtin-report.c
> > > > > @@ -1317,6 +1317,15 @@ int cmd_report(int argc, const char **argv)
> > > > >  		report.range_num = 1;
> > > > >  	}
> > > > >  
> > > > > +	if (session->tevent.pevent &&
> > > > > +	    pevent_set_function_resolver(session->tevent.pevent,
> > > > > +					 machine__resolve_kernel_addr,
> > > > > +					 &session->machines.host) < 0) {
> > > > > +		pr_err("%s: failed to set libtraceevent function resolver\n",
> > > > > +		       __func__);
> > > > > +		return -1;
> > > > > +	}
> > > > 
> > > > why not calling the wrapper trace_event__register_resolver?
> > > The reason is the same as builtin-script doesn't use trace_event__register_resolver,
> > > because we only use report and script to analyze offline perf.data, and there could
> > > be no tracepoints in perf.data.
> > 
> > hum, I missed this functionality.. so we need this even if there
> > are no tracepoints in the perf.data?
> 
> In "perf report", when there are tracepoints in perf.data, session->tevent.pevent
> will be initialized in trace-event-read.c:trace_report, then "if (session->tevent.pevent"
> will become true, and we should calling pevent_set_function_resolver.
> 
> But if we calling trace_event__register_resolver, then it will initialize tevent.pevent
> no matter whether there are tracepoints in perf.data.

ok, should we call it from perf_session__read_header then?
below perf_evlist__prepare_tracepoint_events perhaps

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ