Commit c15ed444 authored by Dima Kogan's avatar Dima Kogan Committed by Arnaldo Carvalho de Melo

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: default avatarDima Kogan <dima@secretsauce.net>
Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20240416045533.162692-3-dima@secretsauce.netSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a529bec0
...@@ -2758,7 +2758,7 @@ static int get_new_event_name(char *buf, size_t len, const char *base, ...@@ -2758,7 +2758,7 @@ static int get_new_event_name(char *buf, size_t len, const char *base,
/* Try no suffix number */ /* Try no suffix number */
ret = e_snprintf(buf, len, "%s%s", nbase, ret_event ? "__return" : ""); ret = e_snprintf(buf, len, "%s%s", nbase, ret_event ? "__return" : "");
if (ret < 0) { 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; goto out;
} }
if (!strlist__has_entry(namelist, buf)) if (!strlist__has_entry(namelist, buf))
......
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