diff options
author | Jiri Olsa <jolsa@kernel.org> | 2018-09-13 08:54:03 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-09-19 09:25:10 -0400 |
commit | 89f1688a57a8f0b685fccd648e601a1f830fa744 (patch) | |
tree | e098f3e4df8037281aa8e717aeee3aed77990ac0 /tools/perf/builtin-script.c | |
parent | e381d1c21eea186daed6834af444575e06841355 (diff) |
perf tools: Remove perf_tool from event_op2
Now that we keep a perf_tool pointer inside perf_session, there's no
need to have a perf_tool argument in the event_op2 callback. Remove it.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180913125450.21342-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 6176bae177c2..765391b6c88c 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -2965,9 +2965,8 @@ static void script__setup_sample_type(struct perf_script *script) | |||
2965 | } | 2965 | } |
2966 | } | 2966 | } |
2967 | 2967 | ||
2968 | static int process_stat_round_event(struct perf_tool *tool __maybe_unused, | 2968 | static int process_stat_round_event(struct perf_session *session, |
2969 | union perf_event *event, | 2969 | union perf_event *event) |
2970 | struct perf_session *session) | ||
2971 | { | 2970 | { |
2972 | struct stat_round_event *round = &event->stat_round; | 2971 | struct stat_round_event *round = &event->stat_round; |
2973 | struct perf_evsel *counter; | 2972 | struct perf_evsel *counter; |
@@ -2981,9 +2980,8 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused, | |||
2981 | return 0; | 2980 | return 0; |
2982 | } | 2981 | } |
2983 | 2982 | ||
2984 | static int process_stat_config_event(struct perf_tool *tool __maybe_unused, | 2983 | static int process_stat_config_event(struct perf_session *session __maybe_unused, |
2985 | union perf_event *event, | 2984 | union perf_event *event) |
2986 | struct perf_session *session __maybe_unused) | ||
2987 | { | 2985 | { |
2988 | perf_event__read_stat_config(&stat_config, &event->stat_config); | 2986 | perf_event__read_stat_config(&stat_config, &event->stat_config); |
2989 | return 0; | 2987 | return 0; |
@@ -3009,10 +3007,10 @@ static int set_maps(struct perf_script *script) | |||
3009 | } | 3007 | } |
3010 | 3008 | ||
3011 | static | 3009 | static |
3012 | int process_thread_map_event(struct perf_tool *tool, | 3010 | int process_thread_map_event(struct perf_session *session, |
3013 | union perf_event *event, | 3011 | union perf_event *event) |
3014 | struct perf_session *session __maybe_unused) | ||
3015 | { | 3012 | { |
3013 | struct perf_tool *tool = session->tool; | ||
3016 | struct perf_script *script = container_of(tool, struct perf_script, tool); | 3014 | struct perf_script *script = container_of(tool, struct perf_script, tool); |
3017 | 3015 | ||
3018 | if (script->threads) { | 3016 | if (script->threads) { |
@@ -3028,10 +3026,10 @@ int process_thread_map_event(struct perf_tool *tool, | |||
3028 | } | 3026 | } |
3029 | 3027 | ||
3030 | static | 3028 | static |
3031 | int process_cpu_map_event(struct perf_tool *tool __maybe_unused, | 3029 | int process_cpu_map_event(struct perf_session *session, |
3032 | union perf_event *event, | 3030 | union perf_event *event) |
3033 | struct perf_session *session __maybe_unused) | ||
3034 | { | 3031 | { |
3032 | struct perf_tool *tool = session->tool; | ||
3035 | struct perf_script *script = container_of(tool, struct perf_script, tool); | 3033 | struct perf_script *script = container_of(tool, struct perf_script, tool); |
3036 | 3034 | ||
3037 | if (script->cpus) { | 3035 | if (script->cpus) { |
@@ -3046,21 +3044,21 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused, | |||
3046 | return set_maps(script); | 3044 | return set_maps(script); |
3047 | } | 3045 | } |
3048 | 3046 | ||
3049 | static int process_feature_event(struct perf_tool *tool, | 3047 | static int process_feature_event(struct perf_session *session, |
3050 | union perf_event *event, | 3048 | union perf_event *event) |
3051 | struct perf_session *session) | ||
3052 | { | 3049 | { |
3053 | if (event->feat.feat_id < HEADER_LAST_FEATURE) | 3050 | if (event->feat.feat_id < HEADER_LAST_FEATURE) |
3054 | return perf_event__process_feature(tool, event, session); | 3051 | return perf_event__process_feature(session, event); |
3055 | return 0; | 3052 | return 0; |
3056 | } | 3053 | } |
3057 | 3054 | ||
3058 | #ifdef HAVE_AUXTRACE_SUPPORT | 3055 | #ifdef HAVE_AUXTRACE_SUPPORT |
3059 | static int perf_script__process_auxtrace_info(struct perf_tool *tool, | 3056 | static int perf_script__process_auxtrace_info(struct perf_session *session, |
3060 | union perf_event *event, | 3057 | union perf_event *event) |
3061 | struct perf_session *session) | ||
3062 | { | 3058 | { |
3063 | int ret = perf_event__process_auxtrace_info(tool, event, session); | 3059 | struct perf_tool *tool = session->tool; |
3060 | |||
3061 | int ret = perf_event__process_auxtrace_info(session, event); | ||
3064 | 3062 | ||
3065 | if (ret == 0) { | 3063 | if (ret == 0) { |
3066 | struct perf_script *script = container_of(tool, struct perf_script, tool); | 3064 | struct perf_script *script = container_of(tool, struct perf_script, tool); |