Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf: event: Remove deadcode

event_format__print() last use was removed by 2017's
commit 894f3f1732cb ("perf script: Use event_format__fprintf()")

evlist__find_tracepoint_by_id() last use was removed by 2012's
commit e60fc847cefa ("perf evlist: Remove some unused methods")

evlist__set_tp_filter_pid() last use was removed by 2017's
commit dd1a50377c92 ("perf trace: Introduce filter_loop_pids()")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20241106144826.91728-1-linux@treblig.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Dr. David Alan Gilbert and committed by
Namhyung Kim
9ac98662 5fb8e565

-29
-18
tools/perf/util/evlist.c
··· 320 320 } 321 321 #endif 322 322 323 - struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id) 324 - { 325 - struct evsel *evsel; 326 - 327 - evlist__for_each_entry(evlist, evsel) { 328 - if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT && 329 - (int)evsel->core.attr.config == id) 330 - return evsel; 331 - } 332 - 333 - return NULL; 334 - } 335 - 336 323 struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name) 337 324 { 338 325 struct evsel *evsel; ··· 1142 1155 1143 1156 free(filter); 1144 1157 return ret; 1145 - } 1146 - 1147 - int evlist__set_tp_filter_pid(struct evlist *evlist, pid_t pid) 1148 - { 1149 - return evlist__set_tp_filter_pids(evlist, 1, &pid); 1150 1158 } 1151 1159 1152 1160 int evlist__append_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids)
-2
tools/perf/util/evlist.h
··· 132 132 __evlist__set_tracepoints_handlers(evlist, array, ARRAY_SIZE(array)) 133 133 134 134 int evlist__set_tp_filter(struct evlist *evlist, const char *filter); 135 - int evlist__set_tp_filter_pid(struct evlist *evlist, pid_t pid); 136 135 int evlist__set_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids); 137 136 138 137 int evlist__append_tp_filter(struct evlist *evlist, const char *filter); ··· 139 140 int evlist__append_tp_filter_pid(struct evlist *evlist, pid_t pid); 140 141 int evlist__append_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids); 141 142 142 - struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id); 143 143 struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name); 144 144 145 145 int evlist__add_pollfd(struct evlist *evlist, int fd);
-6
tools/perf/util/trace-event-parse.c
··· 116 116 trace_seq_destroy(&s); 117 117 } 118 118 119 - void event_format__print(struct tep_event *event, 120 - int cpu, void *data, int size) 121 - { 122 - return event_format__fprintf(event, cpu, data, size, stdout); 123 - } 124 - 125 119 /* 126 120 * prev_state is of size long, which is 32 bits on 32 bit architectures. 127 121 * As it needs to have the same bits for both 32 bit and 64 bit architectures
-3
tools/perf/util/trace-event.h
··· 42 42 void event_format__fprintf(struct tep_event *event, 43 43 int cpu, void *data, int size, FILE *fp); 44 44 45 - void event_format__print(struct tep_event *event, 46 - int cpu, void *data, int size); 47 - 48 45 int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long size); 49 46 int parse_event_file(struct tep_handle *pevent, 50 47 char *buf, unsigned long size, char *sys);