Re: [PATCH 02/48] perf tools: Remove perf_tool from event_op3

From: Arnaldo Carvalho de Melo
Date: Tue Sep 18 2018 - 16:56:14 EST


Em Thu, Sep 13, 2018 at 02:54:04PM +0200, Jiri Olsa escreveu:
> Now when we keep perf_tool pointer inside perf_session,
> there's no need to have perf_tool argument in the
> event_op3 callback. Removing it.
>
> Link: http://lkml.kernel.org/n/tip-78u9m0jbre3bn16l6guqfyrf@xxxxxxxxxxxxxx
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> ---
> tools/perf/builtin-inject.c | 6 +++---
> tools/perf/util/auxtrace.c | 7 +++----
> tools/perf/util/auxtrace.h | 5 ++---
> tools/perf/util/session.c | 8 +++-----
> tools/perf/util/tool.h | 4 +---
> 5 files changed, 12 insertions(+), 18 deletions(-)
>
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index d77ed2aea95a..03fc65da0657 100644
> --- a/tools/perf/builtin-inject.c
> +++ b/tools/perf/builtin-inject.c
> @@ -131,10 +131,10 @@ static int copy_bytes(struct perf_inject *inject, int fd, off_t size)
> return 0;
> }
>
> -static s64 perf_event__repipe_auxtrace(struct perf_tool *tool,
> - union perf_event *event,
> - struct perf_session *session)
> +static s64 perf_event__repipe_auxtrace(struct perf_session *session,
> + union perf_event *event)
> {
> + struct perf_tool *tool = session->tool;
> struct perf_inject *inject = container_of(tool, struct perf_inject,
> tool);
> int ret;

You forgot the !HAVE_AUXTRACE_SUPPORT case, fixed with:


diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 03fc65da0657..b4a29f435b06 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -172,9 +172,8 @@ static s64 perf_event__repipe_auxtrace(struct perf_session *session,
#else

static s64
-perf_event__repipe_auxtrace(struct perf_tool *tool __maybe_unused,
- union perf_event *event __maybe_unused,
- struct perf_session *session __maybe_unused)
+perf_event__repipe_auxtrace(struct perf_session *session __maybe_unused,
+ union perf_event *event __maybe_unused)
{
pr_err("AUX area tracing not supported\n");
return -EINVAL;