aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-08-26 18:28:13 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-08-26 18:39:11 -0400
commit3f604b5f61dbff80725392c99827d6617f7bb180 (patch)
treeaefe07b07bfb36259ea1988998cf25bafb06cf89
parent6a1b359821eb8d929c4dd9f53178da84888d79ec (diff)
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.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-script.c4
-rw-r--r--tools/perf/util/bpf-event.c11
-rw-r--r--tools/perf/util/bpf-event.h10
-rw-r--r--tools/perf/util/event.c14
-rw-r--r--tools/perf/util/event.h10
-rw-r--r--tools/perf/util/machine.c2
-rw-r--r--tools/perf/util/session.c6
-rw-r--r--tools/perf/util/tool.h2
8 files changed, 29 insertions, 30 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 6f389b33fbe5..51e7e6d0eee6 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -2492,8 +2492,8 @@ static int __cmd_script(struct perf_script *script)
2492 script->tool.finished_round = process_finished_round_event; 2492 script->tool.finished_round = process_finished_round_event;
2493 } 2493 }
2494 if (script->show_bpf_events) { 2494 if (script->show_bpf_events) {
2495 script->tool.ksymbol = process_bpf_events; 2495 script->tool.ksymbol = process_bpf_events;
2496 script->tool.bpf_event = process_bpf_events; 2496 script->tool.bpf = process_bpf_events;
2497 } 2497 }
2498 2498
2499 if (perf_script__setup_per_event_dump(script)) { 2499 if (perf_script__setup_per_event_dump(script)) {
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index 28fa2b1ce66e..2d6d500c9af7 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -64,12 +64,11 @@ static int machine__process_bpf_event_load(struct machine *machine,
64 return 0; 64 return 0;
65} 65}
66 66
67int machine__process_bpf_event(struct machine *machine __maybe_unused, 67int machine__process_bpf(struct machine *machine, union perf_event *event,
68 union perf_event *event, 68 struct perf_sample *sample)
69 struct perf_sample *sample __maybe_unused)
70{ 69{
71 if (dump_trace) 70 if (dump_trace)
72 perf_event__fprintf_bpf_event(event, stdout); 71 perf_event__fprintf_bpf(event, stdout);
73 72
74 switch (event->bpf.type) { 73 switch (event->bpf.type) {
75 case PERF_BPF_EVENT_PROG_LOAD: 74 case PERF_BPF_EVENT_PROG_LOAD:
@@ -83,7 +82,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused,
83 */ 82 */
84 break; 83 break;
85 default: 84 default:
86 pr_debug("unexpected bpf_event type of %d\n", event->bpf.type); 85 pr_debug("unexpected bpf event type of %d\n", event->bpf.type);
87 break; 86 break;
88 } 87 }
89 return 0; 88 return 0;
@@ -410,7 +409,7 @@ static int bpf_event__sb_cb(union perf_event *event, void *data)
410 */ 409 */
411 break; 410 break;
412 default: 411 default:
413 pr_debug("unexpected bpf_event type of %d\n", event->bpf.type); 412 pr_debug("unexpected bpf event type of %d\n", event->bpf.type);
414 break; 413 break;
415 } 414 }
416 415
diff --git a/tools/perf/util/bpf-event.h b/tools/perf/util/bpf-event.h
index 26ab9239f986..417b78835ea0 100644
--- a/tools/perf/util/bpf-event.h
+++ b/tools/perf/util/bpf-event.h
@@ -30,8 +30,8 @@ struct btf_node {
30}; 30};
31 31
32#ifdef HAVE_LIBBPF_SUPPORT 32#ifdef HAVE_LIBBPF_SUPPORT
33int machine__process_bpf_event(struct machine *machine, union perf_event *event, 33int machine__process_bpf(struct machine *machine, union perf_event *event,
34 struct perf_sample *sample); 34 struct perf_sample *sample);
35 35
36int perf_event__synthesize_bpf_events(struct perf_session *session, 36int perf_event__synthesize_bpf_events(struct perf_session *session,
37 perf_event__handler_t process, 37 perf_event__handler_t process,
@@ -43,9 +43,9 @@ void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
43 struct perf_env *env, 43 struct perf_env *env,
44 FILE *fp); 44 FILE *fp);
45#else 45#else
46static inline int machine__process_bpf_event(struct machine *machine __maybe_unused, 46static inline int machine__process_bpf(struct machine *machine __maybe_unused,
47 union perf_event *event __maybe_unused, 47 union perf_event *event __maybe_unused,
48 struct perf_sample *sample __maybe_unused) 48 struct perf_sample *sample __maybe_unused)
49{ 49{
50 return 0; 50 return 0;
51} 51}
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 17304df44fc2..33616ea62a47 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1343,12 +1343,12 @@ int perf_event__process_ksymbol(struct perf_tool *tool __maybe_unused,
1343 return machine__process_ksymbol(machine, event, sample); 1343 return machine__process_ksymbol(machine, event, sample);
1344} 1344}
1345 1345
1346int perf_event__process_bpf_event(struct perf_tool *tool __maybe_unused, 1346int perf_event__process_bpf(struct perf_tool *tool __maybe_unused,
1347 union perf_event *event, 1347 union perf_event *event,
1348 struct perf_sample *sample __maybe_unused, 1348 struct perf_sample *sample,
1349 struct machine *machine) 1349 struct machine *machine)
1350{ 1350{
1351 return machine__process_bpf_event(machine, event, sample); 1351 return machine__process_bpf(machine, event, sample);
1352} 1352}
1353 1353
1354size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp) 1354size_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 event->ksymbol.flags, event->ksymbol.name); 1491 event->ksymbol.flags, event->ksymbol.name);
1492} 1492}
1493 1493
1494size_t perf_event__fprintf_bpf_event(union perf_event *event, FILE *fp) 1494size_t perf_event__fprintf_bpf(union perf_event *event, FILE *fp)
1495{ 1495{
1496 return fprintf(fp, " type %u, flags %u, id %u\n", 1496 return fprintf(fp, " type %u, flags %u, id %u\n",
1497 event->bpf.type, event->bpf.flags, event->bpf.id); 1497 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 ret += perf_event__fprintf_ksymbol(event, fp); 1536 ret += perf_event__fprintf_ksymbol(event, fp);
1537 break; 1537 break;
1538 case PERF_RECORD_BPF_EVENT: 1538 case PERF_RECORD_BPF_EVENT:
1539 ret += perf_event__fprintf_bpf_event(event, fp); 1539 ret += perf_event__fprintf_bpf(event, fp);
1540 break; 1540 break;
1541 default: 1541 default:
1542 ret += fprintf(fp, "\n"); 1542 ret += fprintf(fp, "\n");
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 7251e2eee441..429a3fe52d6c 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -683,10 +683,10 @@ int perf_event__process_ksymbol(struct perf_tool *tool,
683 union perf_event *event, 683 union perf_event *event,
684 struct perf_sample *sample, 684 struct perf_sample *sample,
685 struct machine *machine); 685 struct machine *machine);
686int perf_event__process_bpf_event(struct perf_tool *tool, 686int perf_event__process_bpf(struct perf_tool *tool,
687 union perf_event *event, 687 union perf_event *event,
688 struct perf_sample *sample, 688 struct perf_sample *sample,
689 struct machine *machine); 689 struct machine *machine);
690int perf_tool__process_synth_event(struct perf_tool *tool, 690int perf_tool__process_synth_event(struct perf_tool *tool,
691 union perf_event *event, 691 union perf_event *event,
692 struct machine *machine, 692 struct machine *machine,
@@ -751,7 +751,7 @@ size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp);
751size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp); 751size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp);
752size_t perf_event__fprintf_namespaces(union perf_event *event, FILE *fp); 752size_t perf_event__fprintf_namespaces(union perf_event *event, FILE *fp);
753size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp); 753size_t perf_event__fprintf_ksymbol(union perf_event *event, FILE *fp);
754size_t perf_event__fprintf_bpf_event(union perf_event *event, FILE *fp); 754size_t perf_event__fprintf_bpf(union perf_event *event, FILE *fp);
755size_t perf_event__fprintf(union perf_event *event, FILE *fp); 755size_t perf_event__fprintf(union perf_event *event, FILE *fp);
756 756
757int kallsyms__get_function_start(const char *kallsyms_filename, 757int kallsyms__get_function_start(const char *kallsyms_filename,
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 86b7fd24b1e1..93483f1764d3 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1922,7 +1922,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,
1922 case PERF_RECORD_KSYMBOL: 1922 case PERF_RECORD_KSYMBOL:
1923 ret = machine__process_ksymbol(machine, event, sample); break; 1923 ret = machine__process_ksymbol(machine, event, sample); break;
1924 case PERF_RECORD_BPF_EVENT: 1924 case PERF_RECORD_BPF_EVENT:
1925 ret = machine__process_bpf_event(machine, event, sample); break; 1925 ret = machine__process_bpf(machine, event, sample); break;
1926 default: 1926 default:
1927 ret = -1; 1927 ret = -1;
1928 break; 1928 break;
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 4bfec9db36d6..5786e9c807c5 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -473,8 +473,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
473 tool->context_switch = perf_event__process_switch; 473 tool->context_switch = perf_event__process_switch;
474 if (tool->ksymbol == NULL) 474 if (tool->ksymbol == NULL)
475 tool->ksymbol = perf_event__process_ksymbol; 475 tool->ksymbol = perf_event__process_ksymbol;
476 if (tool->bpf_event == NULL) 476 if (tool->bpf == NULL)
477 tool->bpf_event = perf_event__process_bpf_event; 477 tool->bpf = perf_event__process_bpf;
478 if (tool->read == NULL) 478 if (tool->read == NULL)
479 tool->read = process_event_sample_stub; 479 tool->read = process_event_sample_stub;
480 if (tool->throttle == NULL) 480 if (tool->throttle == NULL)
@@ -1452,7 +1452,7 @@ static int machines__deliver_event(struct machines *machines,
1452 case PERF_RECORD_KSYMBOL: 1452 case PERF_RECORD_KSYMBOL:
1453 return tool->ksymbol(tool, event, sample, machine); 1453 return tool->ksymbol(tool, event, sample, machine);
1454 case PERF_RECORD_BPF_EVENT: 1454 case PERF_RECORD_BPF_EVENT:
1455 return tool->bpf_event(tool, event, sample, machine); 1455 return tool->bpf(tool, event, sample, machine);
1456 default: 1456 default:
1457 ++evlist->stats.nr_unknown_events; 1457 ++evlist->stats.nr_unknown_events;
1458 return -1; 1458 return -1;
diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h
index 7f95dd1d6883..2abbf668b8de 100644
--- a/tools/perf/util/tool.h
+++ b/tools/perf/util/tool.h
@@ -56,7 +56,7 @@ struct perf_tool {
56 throttle, 56 throttle,
57 unthrottle, 57 unthrottle,
58 ksymbol, 58 ksymbol,
59 bpf_event; 59 bpf;
60 60
61 event_attr_op attr; 61 event_attr_op attr;
62 event_attr_op event_update; 62 event_attr_op event_update;