perf evsel: Cache associated event_format
authorArnaldo Carvalho de Melo <[email protected]>
Tue, 7 Aug 2012 12:58:03 +0000 (09:58 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 8 Aug 2012 02:43:37 +0000 (23:43 -0300)
commitfcf65bf149afa91b875ffde4455967cb63ee0be9
tree9b6137e60d4142b1aa00f9e20860bdd8374035d3
parent8b6ee4c5d48d93527dcf6e36c51cbb7703d7fffb
perf evsel: Cache associated event_format

We already lookup the associated event_format when reading the perf.data
header, so that we can cache the tracepoint name in evsel->name, so do
it a little further and save the event_format itself, so that we can
avoid relookups in tools that need to access it.

Change the tools to take the most obvious advantage, when they were
using pevent_find_event directly. More work is needed for further
removing the need of a pointer to pevent, such as when asking for event
field values ("common_pid" and the other common fields and per
event_format fields).

This is something that was planned but only got actually done when
Andrey Wagin needed to do this lookup at perf_tool->sample() time, when
we don't have access to pevent (session->pevent) to use with
pevent_find_event().

Cc: Andrey Wagin <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-kmem.c
tools/perf/builtin-lock.c
tools/perf/builtin-sched.c
tools/perf/builtin-script.c
tools/perf/util/evsel.h
tools/perf/util/header.c
tools/perf/util/scripting-engines/trace-event-perl.c
tools/perf/util/scripting-engines/trace-event-python.c
tools/perf/util/trace-event-parse.c
tools/perf/util/trace-event.h