aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-03-03 12:37:54 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-12 12:39:49 -0300
commitd704ebdae4aaeec89180dcfd0ca74e5bba318853 (patch)
treefeb48de01669999de08213cde76525c222ef9634 /tools/perf/util/session.c
parentperf ordered_events: Allow tools to specify a deliver method (diff)
downloadlinux-dev-d704ebdae4aaeec89180dcfd0ca74e5bba318853.tar.xz
linux-dev-d704ebdae4aaeec89180dcfd0ca74e5bba318853.zip
perf tools: tool->finished_round() doesn't need perf_session
It is all about flushing the ordered queue or piping it thru, no need for a perf_session pointer. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-g47fx3ys0t9271cp0dcabjc7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index e2f318a3f17a..703a370ae5b6 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -225,10 +225,17 @@ static int process_event_stub(struct perf_tool *tool __maybe_unused,
return 0;
}
+static int process_build_id_stub(struct perf_tool *tool __maybe_unused,
+ union perf_event *event __maybe_unused,
+ struct perf_session *session __maybe_unused)
+{
+ dump_printf(": unhandled!\n");
+ return 0;
+}
+
static int process_finished_round_stub(struct perf_tool *tool __maybe_unused,
union perf_event *event __maybe_unused,
- struct perf_session *perf_session
- __maybe_unused)
+ struct ordered_events *oe __maybe_unused)
{
dump_printf(": unhandled!\n");
return 0;
@@ -236,7 +243,7 @@ static int process_finished_round_stub(struct perf_tool *tool __maybe_unused,
static int process_finished_round(struct perf_tool *tool,
union perf_event *event,
- struct perf_session *session);
+ struct ordered_events *oe);
static int process_id_index_stub(struct perf_tool *tool __maybe_unused,
union perf_event *event __maybe_unused,
@@ -274,7 +281,7 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
if (tool->tracing_data == NULL)
tool->tracing_data = process_event_synth_tracing_data_stub;
if (tool->build_id == NULL)
- tool->build_id = process_finished_round_stub;
+ tool->build_id = process_build_id_stub;
if (tool->finished_round == NULL) {
if (tool->ordered_events)
tool->finished_round = process_finished_round;
@@ -526,10 +533,8 @@ static perf_event__swap_op perf_event__swap_ops[] = {
*/
static int process_finished_round(struct perf_tool *tool __maybe_unused,
union perf_event *event __maybe_unused,
- struct perf_session *session)
+ struct ordered_events *oe)
{
- struct ordered_events *oe = &session->ordered_events;
-
return ordered_events__flush(oe, OE_FLUSH__ROUND);
}
@@ -961,7 +966,8 @@ static s64 perf_session__process_user_event(struct perf_session *session,
union perf_event *event,
u64 file_offset)
{
- struct perf_tool *tool = session->ordered_events.tool;
+ struct ordered_events *oe = &session->ordered_events;
+ struct perf_tool *tool = oe->tool;
int fd = perf_data_file__fd(session->file);
int err;
@@ -989,7 +995,7 @@ static s64 perf_session__process_user_event(struct perf_session *session,
case PERF_RECORD_HEADER_BUILD_ID:
return tool->build_id(tool, event, session);
case PERF_RECORD_FINISHED_ROUND:
- return tool->finished_round(tool, event, session);
+ return tool->finished_round(tool, event, oe);
case PERF_RECORD_ID_INDEX:
return tool->id_index(tool, event, session);
default: