aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLeo Yan <leo.yan@arm.com>2024-10-12 21:47:23 +0100
committerNamhyung Kim <namhyung@kernel.org>2024-10-17 09:55:58 -0700
commitd08e3f14e87259b9d63bf7eea7072d1bd61392ef (patch)
tree0fe4f50822027647c471bf196b0517290b100466
parentperf test: Speed up some tests using perf list (diff)
downloadwireguard-linux-d08e3f14e87259b9d63bf7eea7072d1bd61392ef.tar.xz
wireguard-linux-d08e3f14e87259b9d63bf7eea7072d1bd61392ef.zip
perf probe: Use the MAX_EVENT_NAME_LEN macro
The MAX_EVENT_NAME_LEN macro has been defined in the kernel. Use the same definition in the tool for more readable. Signed-off-by: Leo Yan <leo.yan@arm.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20241012204725.928794-2-leo.yan@arm.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-rw-r--r--tools/perf/util/probe-event.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 698a92875374..83b5744da50c 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -51,6 +51,9 @@
#define PERFPROBE_GROUP "probe"
+/* Defined in kernel/trace/trace.h */
+#define MAX_EVENT_NAME_LEN 64
+
bool probe_event_dry_run; /* Dry run flag */
struct probe_conf probe_conf = { .magic_num = DEFAULT_PROBE_MAGIC_NUM };
@@ -2841,7 +2844,7 @@ static int probe_trace_event__set_name(struct probe_trace_event *tev,
bool allow_suffix)
{
const char *event, *group;
- char buf[64];
+ char buf[MAX_EVENT_NAME_LEN];
int ret;
/* If probe_event or trace_event already have the name, reuse it */