perf tool: Rename perf_tool::bpf_event to bpf

No need for that _event suffix, do just like all the other meta event
handlers and suppress that suffix.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Link: https://lkml.kernel.org/n/tip-03spzxtqafbabbbmnm7y4xfx@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 6a1b3598
...@@ -2492,8 +2492,8 @@ static int __cmd_script(struct perf_script *script) ...@@ -2492,8 +2492,8 @@ static int __cmd_script(struct perf_script *script)
script->tool.finished_round = process_finished_round_event; script->tool.finished_round = process_finished_round_event;
} }
if (script->show_bpf_events) { if (script->show_bpf_events) {
script->tool.ksymbol = process_bpf_events; script->tool.ksymbol = process_bpf_events;
script->tool.bpf_event = process_bpf_events; script->tool.bpf = process_bpf_events;
} }
if (perf_script__setup_per_event_dump(script)) { if (perf_script__setup_per_event_dump(script)) {
......
...@@ -64,12 +64,11 @@ static int machine__process_bpf_event_load(struct machine *machine, ...@@ -64,12 +64,11 @@ static int machine__process_bpf_event_load(struct machine *machine,
return 0; return 0;
} }
int machine__process_bpf_event(struct machine *machine __maybe_unused, int machine__process_bpf(struct machine *machine, union perf_event *event,
union perf_event *event, struct perf_sample *sample)
struct perf_sample *sample __maybe_unused)
{ {
if (dump_trace) if (dump_trace)
perf_event__fprintf_bpf_event(event, stdout); perf_event__fprintf_bpf(event, stdout);
switch (event->bpf.type) { switch (event->bpf.type) {
case PERF_BPF_EVENT_PROG_LOAD: case PERF_BPF_EVENT_PROG_LOAD:
...@@ -83,7 +82,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused, ...@@ -83,7 +82,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused,
*/ */
break; break;
default: default:
pr_debug("unexpected bpf_event type of %d\n", event->bpf.type); pr_debug("unexpected bpf event type of %d\n", event->bpf.type);
break; break;
} }
return 0; return 0;
...@@ -410,7 +409,7 @@ static int bpf_event__sb_cb(union perf_event *event, void *data) ...@@ -410,7 +409,7 @@ static int bpf_event__sb_cb(union perf_event *event, void *data)
*/ */
break; break;
default: default:
pr_debug("unexpected bpf_event type of %d\n", event->bpf.type); pr_debug("unexpected bpf event type of %d\n", event->bpf.type);
break; break;
} }
......
...@@ -30,8 +30,8 @@ struct btf_node { ...@@ -30,8 +30,8 @@ struct btf_node {
}; };
#ifdef HAVE_LIBBPF_SUPPORT #ifdef HAVE_LIBBPF_SUPPORT
int machine__process_bpf_event(struct machine *machine, union perf_event *event, int machine__process_bpf(struct machine *machine, union perf_event *event,
struct perf_sample *sample); struct perf_sample *sample);
int perf_event__synthesize_bpf_events(struct perf_session *session, int perf_event__synthesize_bpf_events(struct perf_session *session,
perf_event__handler_t process, perf_event__handler_t process,
...@@ -43,9 +43,9 @@ void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info, ...@@ -43,9 +43,9 @@ void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
struct perf_env *env, struct perf_env *env,
FILE *fp); FILE *fp);
#else #else
static inline int machine__process_bpf_event(struct machine *machine __maybe_unused, static inline int machine__process_bpf(struct machine *machine __maybe_unused,
union perf_event *event __maybe_unused, union perf_event *event __maybe_unused,
struct perf_sample *sample __maybe_unused) struct perf_sample *sample __maybe_unused)
{ {
return 0; return 0;
} }
......
...@@ -1343,12 +1343,12 @@ int perf_event__process_ksymbol(struct perf_tool *tool __maybe_unused, ...@@ -1343,12 +1343,12 @@ int perf_event__process_ksymbol(struct perf_tool *tool __maybe_unused,
return machine__process_ksymbol(machine, event, sample); return machine__process_ksymbol(machine, event, sample);
} }
int perf_event__process_bpf_event(struct perf_tool *tool __maybe_unused, int perf_event__process_bpf(struct perf_tool *tool __maybe_unused,
union perf_event *event, union perf_event *event,
struct perf_sample *sample __maybe_unused, struct perf_sample *sample,
struct machine *machine) struct machine *machine)
{ {
return machine__process_bpf_event(machine, event, sample); return machine__process_bpf(machine, event, sample);
} }
size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp) size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp)
...@@ -1491,7 +1491,7 @@ size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp) ...@@ -1491,7 +1491,7 @@ size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp)
event->ksymbol.flags, event->ksymbol.name); event->ksymbol.flags, event->ksymbol.name);
} }
size_t perf_event__fprintf_bpf_event(union perf_event *event, FILE *fp) size_t perf_event__fprintf_bpf(union perf_event *event, FILE *fp)
{ {
return fprintf(fp, " type %u, flags %u, id %u\n", return fprintf(fp, " type %u, flags %u, id %u\n",
event->bpf.type, event->bpf.flags, event->bpf.id); event->bpf.type, event->bpf.flags, event->bpf.id);
...@@ -1536,7 +1536,7 @@ size_t perf_event__fprintf(union perf_event *event, FILE *fp) ...@@ -1536,7 +1536,7 @@ size_t perf_event__fprintf(union perf_event *event, FILE *fp)
ret += perf_event__fprintf_ksymbol(event, fp); ret += perf_event__fprintf_ksymbol(event, fp);
break; break;
case PERF_RECORD_BPF_EVENT: case PERF_RECORD_BPF_EVENT:
ret += perf_event__fprintf_bpf_event(event, fp); ret += perf_event__fprintf_bpf(event, fp);
break; break;
default: default:
ret += fprintf(fp, "\n"); ret += fprintf(fp, "\n");
......
...@@ -683,10 +683,10 @@ int perf_event__process_ksymbol(struct perf_tool *tool, ...@@ -683,10 +683,10 @@ int perf_event__process_ksymbol(struct perf_tool *tool,
union perf_event *event, union perf_event *event,
struct perf_sample *sample, struct perf_sample *sample,
struct machine *machine); struct machine *machine);
int perf_event__process_bpf_event(struct perf_tool *tool, int perf_event__process_bpf(struct perf_tool *tool,
union perf_event *event, union perf_event *event,
struct perf_sample *sample, struct perf_sample *sample,
struct machine *machine); struct machine *machine);
int perf_tool__process_synth_event(struct perf_tool *tool, int perf_tool__process_synth_event(struct perf_tool *tool,
union perf_event *event, union perf_event *event,
struct machine *machine, struct machine *machine,
...@@ -751,7 +751,7 @@ size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp); ...@@ -751,7 +751,7 @@ size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp); size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_namespaces(union perf_event *event, FILE *fp); size_t perf_event__fprintf_namespaces(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp); size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_bpf_event(union perf_event *event, FILE *fp); size_t perf_event__fprintf_bpf(union perf_event *event, FILE *fp);
size_t perf_event__fprintf(union perf_event *event, FILE *fp); size_t perf_event__fprintf(union perf_event *event, FILE *fp);
int kallsyms__get_function_start(const char *kallsyms_filename, int kallsyms__get_function_start(const char *kallsyms_filename,
......
...@@ -1922,7 +1922,7 @@ int machine__process_event(struct machine *machine, union perf_event *event, ...@@ -1922,7 +1922,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,
case PERF_RECORD_KSYMBOL: case PERF_RECORD_KSYMBOL:
ret = machine__process_ksymbol(machine, event, sample); break; ret = machine__process_ksymbol(machine, event, sample); break;
case PERF_RECORD_BPF_EVENT: case PERF_RECORD_BPF_EVENT:
ret = machine__process_bpf_event(machine, event, sample); break; ret = machine__process_bpf(machine, event, sample); break;
default: default:
ret = -1; ret = -1;
break; break;
......
...@@ -473,8 +473,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool) ...@@ -473,8 +473,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
tool->context_switch = perf_event__process_switch; tool->context_switch = perf_event__process_switch;
if (tool->ksymbol == NULL) if (tool->ksymbol == NULL)
tool->ksymbol = perf_event__process_ksymbol; tool->ksymbol = perf_event__process_ksymbol;
if (tool->bpf_event == NULL) if (tool->bpf == NULL)
tool->bpf_event = perf_event__process_bpf_event; tool->bpf = perf_event__process_bpf;
if (tool->read == NULL) if (tool->read == NULL)
tool->read = process_event_sample_stub; tool->read = process_event_sample_stub;
if (tool->throttle == NULL) if (tool->throttle == NULL)
...@@ -1452,7 +1452,7 @@ static int machines__deliver_event(struct machines *machines, ...@@ -1452,7 +1452,7 @@ static int machines__deliver_event(struct machines *machines,
case PERF_RECORD_KSYMBOL: case PERF_RECORD_KSYMBOL:
return tool->ksymbol(tool, event, sample, machine); return tool->ksymbol(tool, event, sample, machine);
case PERF_RECORD_BPF_EVENT: case PERF_RECORD_BPF_EVENT:
return tool->bpf_event(tool, event, sample, machine); return tool->bpf(tool, event, sample, machine);
default: default:
++evlist->stats.nr_unknown_events; ++evlist->stats.nr_unknown_events;
return -1; return -1;
......
...@@ -56,7 +56,7 @@ struct perf_tool { ...@@ -56,7 +56,7 @@ struct perf_tool {
throttle, throttle,
unthrottle, unthrottle,
ksymbol, ksymbol,
bpf_event; bpf;
event_attr_op attr; event_attr_op attr;
event_attr_op event_update; event_attr_op event_update;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment