From: Namhyung Kim <namhyung@kernel.org>
To: Dmitry Antipov <dmitry.antipov@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Ingo Molnar <mingo@redhat.com>, Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org,
patches@linaro.org
Subject: Re: [PATCH] perf report: fix event name reporting
Date: Mon, 11 Jun 2012 14:18:02 +0900 [thread overview]
Message-ID: <87txyipgtx.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1339158207-20575-1-git-send-email-dmitry.antipov@linaro.org> (Dmitry Antipov's message of "Fri, 8 Jun 2012 16:23:27 +0400")
Hi,
On Fri, 8 Jun 2012 16:23:27 +0400, Dmitry Antipov wrote:
> Use trace_find_event to find event name before looking through
> /sys files. This helps 'perf report' to show real event names
> instead of 'unknown:unknown' when processing perf.data recorded
> on another machine.
>
Right, it should be a default action for a tracepoint event IMHO. (But
this patch doesn't check it's a tracepoint) There are a lot of places
call event_name() to be converted like this, so I suggest changing
event_name itself (or recent perf_evsel__name() ?) instead of just a
call-site. It might require checking whether the pevent is initialized
and if not, falls back to the sysfs walking.
Thanks,
Namhyung
> Signed-off-by: Dmitry Antipov <dmitry.antipov@linaro.org>
> ---
> tools/perf/builtin-report.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 8c767c6..a6fd309 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -24,6 +24,7 @@
> #include "util/evlist.h"
> #include "util/evsel.h"
> #include "util/header.h"
> +#include "util/trace-event.h"
> #include "util/session.h"
> #include "util/tool.h"
>
> @@ -314,7 +315,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
>
> list_for_each_entry(pos, &evlist->entries, node) {
> struct hists *hists = &pos->hists;
> - const char *evname = event_name(pos);
> + struct event_format *event = trace_find_event(pos->attr.config);
> + const char *evname = event ? event->name : event_name(pos);
>
> hists__fprintf_nr_sample_events(hists, evname, stdout);
> hists__fprintf(hists, NULL, false, true, 0, 0, stdout);
next prev parent reply other threads:[~2012-06-11 5:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 12:23 [PATCH] perf report: fix event name reporting Dmitry Antipov
2012-06-11 5:18 ` Namhyung Kim [this message]
2012-06-11 14:14 ` Arnaldo Carvalho de Melo
2012-06-12 6:34 ` Namhyung Kim
2012-06-12 14:43 ` Arnaldo Carvalho de Melo
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=87txyipgtx.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=dmitry.antipov@linaro.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=patches@linaro.org \
--cc=paulus@samba.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