projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03f2357
)
perf probe-event: Un-hardcode sizeof(buf)
author
Dima Kogan
<dima@secretsauce.net>
Tue, 16 Apr 2024 04:55:10 +0000
(21:55 -0700)
committer
Arnaldo Carvalho de Melo
<acme@redhat.com>
Fri, 19 Apr 2024 01:22:51 +0000
(22:22 -0300)
In several places we had
char buf[64];
...
snprintf(buf, 64, ...);
This patch changes it to
char buf[64];
...
snprintf(buf, sizeof(buf), ...);
so the "64" is only stated once.
Signed-off-by: Dima Kogan <dima@secretsauce.net>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link:
https://lore.kernel.org/r/20240416045533.162692-2-dima@secretsauce.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/probe-event.c
b/tools/perf/util/probe-event.c
index 5c12459e9765f6a20d76a559700b5a02b5e17d0f..c1dbad8a83dcbc597767cfad12a3fa34dd6de62f 100644
(file)
--- a/
tools/perf/util/probe-event.c
+++ b/
tools/perf/util/probe-event.c
@@
-236,7
+236,7
@@
static int convert_exec_to_group(const char *exec, char **result)
}
}
- ret = e_snprintf(buf,
64
, "%s_%s", PERFPROBE_GROUP, ptr1);
+ ret = e_snprintf(buf,
sizeof(buf)
, "%s_%s", PERFPROBE_GROUP, ptr1);
if (ret < 0)
goto out;
@@
-2867,7
+2867,7
@@
static int probe_trace_event__set_name(struct probe_trace_event *tev,
group = PERFPROBE_GROUP;
/* Get an unused new event name */
- ret = get_new_event_name(buf,
64
, event, namelist,
+ ret = get_new_event_name(buf,
sizeof(buf)
, event, namelist,
tev->point.retprobe, allow_suffix);
if (ret < 0)
return ret;