Skip to content

Commit 15d4a6f

Browse files
captain5050acmel
authored andcommitted
perf tool: Remove perf_tool__fill_defaults()
Now all tools are fully initialized prior to use it has no use so remove. Signed-off-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Anshuman Khandual <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Ilkka Koskinen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Kan Liang <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Nick Terrell <[email protected]> Cc: Oliver Upton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Song Liu <[email protected]> Cc: Sun Haiyong <[email protected]> Cc: Suzuki Poulouse <[email protected]> Cc: Will Deacon <[email protected]> Cc: Yanteng Si <[email protected]> Cc: Yicong Yang <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent fcd00f3 commit 15d4a6f

File tree

3 files changed

+0
-96
lines changed

3 files changed

+0
-96
lines changed

tools/perf/util/session.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,8 +1781,6 @@ static int __perf_session__process_pipe_events(struct perf_session *session)
17811781
void *p;
17821782
bool update_prog = false;
17831783

1784-
perf_tool__fill_defaults(tool);
1785-
17861784
/*
17871785
* If it's from a file saving pipe data (by redirection), it would have
17881786
* 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)
22062204
struct ui_progress prog;
22072205
int err;
22082206

2209-
perf_tool__fill_defaults(tool);
2210-
22112207
if (rd.data_size == 0)
22122208
return -1;
22132209

@@ -2260,8 +2256,6 @@ static int __perf_session__process_dir_events(struct perf_session *session)
22602256
u64 total_size = perf_data__size(session->data);
22612257
struct reader *rd;
22622258

2263-
perf_tool__fill_defaults(tool);
2264-
22652259
ui_progress__init_size(&prog, total_size, "Processing events...");
22662260

22672261
nr_readers = 1;

tools/perf/util/tool.c

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -288,95 +288,6 @@ void perf_tool__init(struct perf_tool *tool, bool ordered_events)
288288
tool->finished_init = process_event_op2_stub;
289289
}
290290

291-
void perf_tool__fill_defaults(struct perf_tool *tool)
292-
{
293-
if (tool->sample == NULL)
294-
tool->sample = process_event_sample_stub;
295-
if (tool->mmap == NULL)
296-
tool->mmap = process_event_stub;
297-
if (tool->mmap2 == NULL)
298-
tool->mmap2 = process_event_stub;
299-
if (tool->comm == NULL)
300-
tool->comm = process_event_stub;
301-
if (tool->namespaces == NULL)
302-
tool->namespaces = process_event_stub;
303-
if (tool->cgroup == NULL)
304-
tool->cgroup = process_event_stub;
305-
if (tool->fork == NULL)
306-
tool->fork = process_event_stub;
307-
if (tool->exit == NULL)
308-
tool->exit = process_event_stub;
309-
if (tool->lost == NULL)
310-
tool->lost = perf_event__process_lost;
311-
if (tool->lost_samples == NULL)
312-
tool->lost_samples = perf_event__process_lost_samples;
313-
if (tool->aux == NULL)
314-
tool->aux = perf_event__process_aux;
315-
if (tool->itrace_start == NULL)
316-
tool->itrace_start = perf_event__process_itrace_start;
317-
if (tool->context_switch == NULL)
318-
tool->context_switch = perf_event__process_switch;
319-
if (tool->ksymbol == NULL)
320-
tool->ksymbol = perf_event__process_ksymbol;
321-
if (tool->bpf == NULL)
322-
tool->bpf = perf_event__process_bpf;
323-
if (tool->text_poke == NULL)
324-
tool->text_poke = perf_event__process_text_poke;
325-
if (tool->aux_output_hw_id == NULL)
326-
tool->aux_output_hw_id = perf_event__process_aux_output_hw_id;
327-
if (tool->read == NULL)
328-
tool->read = process_event_sample_stub;
329-
if (tool->throttle == NULL)
330-
tool->throttle = process_event_stub;
331-
if (tool->unthrottle == NULL)
332-
tool->unthrottle = process_event_stub;
333-
if (tool->attr == NULL)
334-
tool->attr = process_event_synth_attr_stub;
335-
if (tool->event_update == NULL)
336-
tool->event_update = process_event_synth_event_update_stub;
337-
if (tool->tracing_data == NULL)
338-
tool->tracing_data = process_event_synth_tracing_data_stub;
339-
if (tool->build_id == NULL)
340-
tool->build_id = process_event_op2_stub;
341-
if (tool->finished_round == NULL) {
342-
if (tool->ordered_events)
343-
tool->finished_round = perf_event__process_finished_round;
344-
else
345-
tool->finished_round = process_finished_round_stub;
346-
}
347-
if (tool->id_index == NULL)
348-
tool->id_index = process_event_op2_stub;
349-
if (tool->auxtrace_info == NULL)
350-
tool->auxtrace_info = process_event_op2_stub;
351-
if (tool->auxtrace == NULL)
352-
tool->auxtrace = process_event_auxtrace_stub;
353-
if (tool->auxtrace_error == NULL)
354-
tool->auxtrace_error = process_event_op2_stub;
355-
if (tool->thread_map == NULL)
356-
tool->thread_map = process_event_thread_map_stub;
357-
if (tool->cpu_map == NULL)
358-
tool->cpu_map = process_event_cpu_map_stub;
359-
if (tool->stat_config == NULL)
360-
tool->stat_config = process_event_stat_config_stub;
361-
if (tool->stat == NULL)
362-
tool->stat = process_stat_stub;
363-
if (tool->stat_round == NULL)
364-
tool->stat_round = process_stat_round_stub;
365-
if (tool->time_conv == NULL)
366-
tool->time_conv = process_event_time_conv_stub;
367-
if (tool->feature == NULL)
368-
tool->feature = process_event_op2_stub;
369-
if (tool->compressed == NULL) {
370-
#ifdef HAVE_ZSTD_SUPPORT
371-
tool->compressed = perf_session__process_compressed_event;
372-
#else
373-
tool->compressed = perf_session__process_compressed_event_stub;
374-
#endif
375-
}
376-
if (tool->finished_init == NULL)
377-
tool->finished_init = process_event_op2_stub;
378-
}
379-
380291
bool perf_tool__compressed_is_stub(const struct perf_tool *tool)
381292
{
382293
return tool->compressed == perf_session__process_compressed_event_stub;

tools/perf/util/tool.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ struct perf_tool {
9090
};
9191

9292
void perf_tool__init(struct perf_tool *tool, bool ordered_events);
93-
void perf_tool__fill_defaults(struct perf_tool *tool);
9493

9594
bool perf_tool__compressed_is_stub(const struct perf_tool *tool);
9695

0 commit comments

Comments
 (0)