[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120806220000.GH21441@infradead.org>
Date: Mon, 6 Aug 2012 19:00:00 -0300
From: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To: Andrey Wagin <avagin@...il.com>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH 2/3] perf: teach perf inject to merge sched_stat_* and
sched_switch events
Em Mon, Aug 06, 2012 at 11:43:04PM +0400, Andrey Wagin escreveu:
> 2012/8/6 Arnaldo Carvalho de Melo <acme@...stprotocols.net>:
> >> +struct perf_session *session;
>
> perf_event__sched_stat (perf_inject.sample) uses "session" for getting
> an event name. I don't know how to get it by another way
Can you try with the attached patch? We already lookup the event_format
entries when we read the perf.data header so that we can cache
evsel->name, we might as well cache the event_format in
evsel->tp_format, so that tools don't have to relookup this for each
sample.
It would look like:
static int perf_event__sched_stat(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct perf_evsel *evsel,
struct machine *machine)
{
int type;
struct event_format *e = evsel->tp_format;
const char *evname = e->name;
- Arnaldo
View attachment "a.patch" of type "text/plain" (661 bytes)
Powered by blists - more mailing lists