linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Adrian Hunter <ajhunter@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Stephane Eranian <eranian@google.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/15] perf session: Simplify tool stubs
Date: Mon,  7 Mar 2016 16:44:39 -0300	[thread overview]
Message-ID: <1457379891-28516-4-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1457379891-28516-1-git-send-email-acme@kernel.org>

From: Adrian Hunter <ajhunter@gmail.com>

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

Signed-off-by: Adrian Hunter <ajhunter@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1457005856-6143-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/session.c | 40 +++++++---------------------------------
 1 file changed, 7 insertions(+), 33 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 40b7a0d0905b..60b3593d210d 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -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,10 +278,9 @@ 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,
-				      union perf_event *event __maybe_unused,
-				      struct perf_session *session __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)
 {
 	dump_printf(": unhandled!\n");
 	return 0;
@@ -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)
-- 
2.5.0

  parent reply	other threads:[~2016-03-07 19:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 19:44 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 01/15] perf tools: Explicitly declare inc_group_count as a void function Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 02/15] perf inject: Hit all DSOs for AUX data in JIT and other cases Arnaldo Carvalho de Melo
2016-03-07 19:44 ` Arnaldo Carvalho de Melo [this message]
2016-03-08  7:45   ` [PATCH 03/15] perf session: Simplify tool stubs Adrian Hunter
2016-03-08  9:17     ` Ingo Molnar
2016-03-07 19:44 ` [PATCH 04/15] perf jit: Let jit_process() return errors Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 05/15] perf jit: Move clockid validation Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 06/15] perf tools: Use 64-bit shifts with (TSC) time conversion Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 07/15] perf hists: Add level field to struct perf_hpp_fmt Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 08/15] perf stat: Document --detailed option Arnaldo Carvalho de Melo
2016-03-08  9:10   ` Ingo Molnar
2016-03-07 19:44 ` [PATCH 09/15] perf hists: Introduce perf_hpp__setup_hists_formats() Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 10/15] perf hists: Use own hpp_list for hierarchy mode Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 11/15] perf hists: Support multiple sort keys in a hierarchy level Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 12/15] perf hists: Fix indent for multiple hierarchy sort key Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 13/15] perf report: Use hierarchy hpp list on stdio Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 14/15] perf hists browser: Use hierarchy hpp list Arnaldo Carvalho de Melo
2016-03-07 19:44 ` [PATCH 15/15] perf report: Use hierarchy hpp list on gtk Arnaldo Carvalho de Melo
2016-03-10  9:32 ` [PATCH] perf tool: Build jitdump only on supported archs Jiri Olsa
2016-03-10 15:57   ` Arnaldo Carvalho de Melo
2016-03-10 16:04     ` Jiri Olsa
2016-03-10 16:13       ` Arnaldo Carvalho de Melo
2016-03-10 16:41         ` [PATCHv2] " Jiri Olsa
2016-03-11  8:47           ` [tip:perf/core] perf jitdump: Build " tip-bot for Jiri Olsa

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=1457379891-28516-4-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ajhunter@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.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;
as well as URLs for NNTP newsgroup(s).