aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/scripts.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-07-17 08:08:55 -0700
committerNamhyung Kim <namhyung@kernel.org>2025-07-22 18:17:53 -0700
commit008b75759eb98fa6ee83eae8e9e19722121de633 (patch)
tree2e980e3d0d53c7c1288e18b58017ff8a5f046318 /tools/perf/ui/browsers/scripts.c
parentperf pmu: Switch FILENAME_MAX to NAME_MAX (diff)
downloadlinux-008b75759eb98fa6ee83eae8e9e19722121de633.tar.gz
linux-008b75759eb98fa6ee83eae8e9e19722121de633.zip
perf ui scripts: Switch FILENAME_MAX to NAME_MAX
FILENAME_MAX is the same as PATH_MAX (4kb) in glibc rather than NAME_MAX's 255. Switch to using NAME_MAX and ensure the '\0' is accounted for in the path's buffer size. Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250717150855.1032526-3-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/ui/browsers/scripts.c')
-rw-r--r--tools/perf/ui/browsers/scripts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index 2d04ece833aa..1e8c2c2f952d 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -94,7 +94,7 @@ static int check_ev_match(int dir_fd, const char *scriptname, struct perf_sessio
FILE *fp;
{
- char filename[FILENAME_MAX + 5];
+ char filename[NAME_MAX + 5];
int fd;
scnprintf(filename, sizeof(filename), "bin/%s-record", scriptname);