Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fb0ac16 authored by Adrian Hunter's avatar Adrian Hunter Committed by Ingo Molnar
Browse files

perf session: Simplify tool stubs



Some of the stubs are identical so just have one function for them.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1457005856-6143-3-git-send-email-adrian.hunter@intel.com


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 640dad47
Loading
Loading
Loading
Loading
+7 −33
Original line number Diff line number Diff line
@@ -240,14 +240,6 @@ 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 ordered_events *oe __maybe_unused)
@@ -260,23 +252,6 @@ static int process_finished_round(struct perf_tool *tool,
				  union perf_event *event,
				  struct ordered_events *oe);

static int process_id_index_stub(struct perf_tool *tool __maybe_unused,
				 union perf_event *event __maybe_unused,
				 struct perf_session *perf_session
				 __maybe_unused)
{
	dump_printf(": unhandled!\n");
	return 0;
}

static int process_event_auxtrace_info_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 skipn(int fd, off_t n)
{
	char buf[4096];
@@ -303,8 +278,7 @@ static s64 process_event_auxtrace_stub(struct perf_tool *tool __maybe_unused,
	return event->auxtrace.size;
}

static
int process_event_auxtrace_error_stub(struct perf_tool *tool __maybe_unused,
static int process_event_op2_stub(struct perf_tool *tool __maybe_unused,
				  union perf_event *event __maybe_unused,
				  struct perf_session *session __maybe_unused)
{
@@ -410,7 +384,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_build_id_stub;
		tool->build_id = process_event_op2_stub;
	if (tool->finished_round == NULL) {
		if (tool->ordered_events)
			tool->finished_round = process_finished_round;
@@ -418,13 +392,13 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
			tool->finished_round = process_finished_round_stub;
	}
	if (tool->id_index == NULL)
		tool->id_index = process_id_index_stub;
		tool->id_index = process_event_op2_stub;
	if (tool->auxtrace_info == NULL)
		tool->auxtrace_info = process_event_auxtrace_info_stub;
		tool->auxtrace_info = process_event_op2_stub;
	if (tool->auxtrace == NULL)
		tool->auxtrace = process_event_auxtrace_stub;
	if (tool->auxtrace_error == NULL)
		tool->auxtrace_error = process_event_auxtrace_error_stub;
		tool->auxtrace_error = process_event_op2_stub;
	if (tool->thread_map == NULL)
		tool->thread_map = process_event_thread_map_stub;
	if (tool->cpu_map == NULL)