]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf tool: Remove perf_tool__fill_defaults()
authorIan Rogers <irogers@google.com>
Mon, 12 Aug 2024 20:47:18 +0000 (13:47 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 12 Aug 2024 21:13:58 +0000 (18:13 -0300)
Now all tools are fully initialized prior to use it has no use so
remove.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <song@kernel.org>
Cc: Sun Haiyong <sunhaiyong@loongson.cn>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yanteng Si <siyanteng@loongson.cn>
Cc: Yicong Yang <yangyicong@hisilicon.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20240812204720.631678-27-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/session.c
tools/perf/util/tool.c
tools/perf/util/tool.h

index 5c0e0341d39e1c2c8ce23749ebacc754844885a6..a8404cc99cfcccfba1bcb7aeb105e059baa48478 100644 (file)
@@ -1781,8 +1781,6 @@ static int __perf_session__process_pipe_events(struct perf_session *session)
        void *p;
        bool update_prog = false;
 
-       perf_tool__fill_defaults(tool);
-
        /*
         * If it's from a file saving pipe data (by redirection), it would have
         * a file name other than "-".  Then we can get the total size and show
@@ -2206,8 +2204,6 @@ static int __perf_session__process_events(struct perf_session *session)
        struct ui_progress prog;
        int err;
 
-       perf_tool__fill_defaults(tool);
-
        if (rd.data_size == 0)
                return -1;
 
@@ -2260,8 +2256,6 @@ static int __perf_session__process_dir_events(struct perf_session *session)
        u64 total_size = perf_data__size(session->data);
        struct reader *rd;
 
-       perf_tool__fill_defaults(tool);
-
        ui_progress__init_size(&prog, total_size, "Processing events...");
 
        nr_readers = 1;
index a4ca16e5eefeea0fa574d409a58f54d3a881e8ef..3b7f390f26eb427d039219186e254b9804e67623 100644 (file)
@@ -288,95 +288,6 @@ void perf_tool__init(struct perf_tool *tool, bool ordered_events)
        tool->finished_init = process_event_op2_stub;
 }
 
-void perf_tool__fill_defaults(struct perf_tool *tool)
-{
-       if (tool->sample == NULL)
-               tool->sample = process_event_sample_stub;
-       if (tool->mmap == NULL)
-               tool->mmap = process_event_stub;
-       if (tool->mmap2 == NULL)
-               tool->mmap2 = process_event_stub;
-       if (tool->comm == NULL)
-               tool->comm = process_event_stub;
-       if (tool->namespaces == NULL)
-               tool->namespaces = process_event_stub;
-       if (tool->cgroup == NULL)
-               tool->cgroup = process_event_stub;
-       if (tool->fork == NULL)
-               tool->fork = process_event_stub;
-       if (tool->exit == NULL)
-               tool->exit = process_event_stub;
-       if (tool->lost == NULL)
-               tool->lost = perf_event__process_lost;
-       if (tool->lost_samples == NULL)
-               tool->lost_samples = perf_event__process_lost_samples;
-       if (tool->aux == NULL)
-               tool->aux = perf_event__process_aux;
-       if (tool->itrace_start == NULL)
-               tool->itrace_start = perf_event__process_itrace_start;
-       if (tool->context_switch == NULL)
-               tool->context_switch = perf_event__process_switch;
-       if (tool->ksymbol == NULL)
-               tool->ksymbol = perf_event__process_ksymbol;
-       if (tool->bpf == NULL)
-               tool->bpf = perf_event__process_bpf;
-       if (tool->text_poke == NULL)
-               tool->text_poke = perf_event__process_text_poke;
-       if (tool->aux_output_hw_id == NULL)
-               tool->aux_output_hw_id = perf_event__process_aux_output_hw_id;
-       if (tool->read == NULL)
-               tool->read = process_event_sample_stub;
-       if (tool->throttle == NULL)
-               tool->throttle = process_event_stub;
-       if (tool->unthrottle == NULL)
-               tool->unthrottle = process_event_stub;
-       if (tool->attr == NULL)
-               tool->attr = process_event_synth_attr_stub;
-       if (tool->event_update == NULL)
-               tool->event_update = process_event_synth_event_update_stub;
-       if (tool->tracing_data == NULL)
-               tool->tracing_data = process_event_synth_tracing_data_stub;
-       if (tool->build_id == NULL)
-               tool->build_id = process_event_op2_stub;
-       if (tool->finished_round == NULL) {
-               if (tool->ordered_events)
-                       tool->finished_round = perf_event__process_finished_round;
-               else
-                       tool->finished_round = process_finished_round_stub;
-       }
-       if (tool->id_index == NULL)
-               tool->id_index = process_event_op2_stub;
-       if (tool->auxtrace_info == NULL)
-               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_op2_stub;
-       if (tool->thread_map == NULL)
-               tool->thread_map = process_event_thread_map_stub;
-       if (tool->cpu_map == NULL)
-               tool->cpu_map = process_event_cpu_map_stub;
-       if (tool->stat_config == NULL)
-               tool->stat_config = process_event_stat_config_stub;
-       if (tool->stat == NULL)
-               tool->stat = process_stat_stub;
-       if (tool->stat_round == NULL)
-               tool->stat_round = process_stat_round_stub;
-       if (tool->time_conv == NULL)
-               tool->time_conv = process_event_time_conv_stub;
-       if (tool->feature == NULL)
-               tool->feature = process_event_op2_stub;
-       if (tool->compressed == NULL) {
-#ifdef HAVE_ZSTD_SUPPORT
-               tool->compressed = perf_session__process_compressed_event;
-#else
-               tool->compressed = perf_session__process_compressed_event_stub;
-#endif
-       }
-       if (tool->finished_init == NULL)
-               tool->finished_init = process_event_op2_stub;
-}
-
 bool perf_tool__compressed_is_stub(const struct perf_tool *tool)
 {
        return tool->compressed == perf_session__process_compressed_event_stub;
index c7fea58729a5dbed7e58d5d499b9af2b8e89c42e..db1c7642b0d1564d0ebd6a19a92eb05b5e906a18 100644 (file)
@@ -90,7 +90,6 @@ struct perf_tool {
 };
 
 void perf_tool__init(struct perf_tool *tool, bool ordered_events);
-void perf_tool__fill_defaults(struct perf_tool *tool);
 
 bool perf_tool__compressed_is_stub(const struct perf_tool *tool);