Skip to content

Commit d08e3f1

Browse files
Leo-Yannamhyung
authored andcommitted
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>
1 parent 3662f82 commit d08e3f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/perf/util/probe-event.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151

5252
#define PERFPROBE_GROUP "probe"
5353

54+
/* Defined in kernel/trace/trace.h */
55+
#define MAX_EVENT_NAME_LEN 64
56+
5457
bool probe_event_dry_run; /* Dry run flag */
5558
struct probe_conf probe_conf = { .magic_num = DEFAULT_PROBE_MAGIC_NUM };
5659

@@ -2841,7 +2844,7 @@ static int probe_trace_event__set_name(struct probe_trace_event *tev,
28412844
bool allow_suffix)
28422845
{
28432846
const char *event, *group;
2844-
char buf[64];
2847+
char buf[MAX_EVENT_NAME_LEN];
28452848
int ret;
28462849

28472850
/* If probe_event or trace_event already have the name, reuse it */

0 commit comments

Comments
 (0)