From: Dima Kogan Date: Tue, 16 Apr 2024 04:55:11 +0000 (-0700) Subject: perf probe-event: Better error message for a too-long probe name X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c15ed4442981ccf8e7e0d885f5cb500400dde9d7;p=linux.git perf probe-event: Better error message for a too-long probe name This is a common failure mode when probing userspace C++ code (where the mangling adds significant length to the symbol names). Prior to this patch, only a very generic error message is produced, making the user guess at what the issue is. Signed-off-by: Dima Kogan Acked-by: Masami Hiramatsu Link: https://lore.kernel.org/r/20240416045533.162692-3-dima@secretsauce.net Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index c1dbad8a83dcb..8a73c9464b709 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -2758,7 +2758,7 @@ static int get_new_event_name(char *buf, size_t len, const char *base, /* Try no suffix number */ ret = e_snprintf(buf, len, "%s%s", nbase, ret_event ? "__return" : ""); if (ret < 0) { - pr_debug("snprintf() failed: %d\n", ret); + pr_warning("snprintf() failed: %d; the event name nbase='%s' is too long\n", ret, nbase); goto out; } if (!strlist__has_entry(namelist, buf))