]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf tools: Replace basename() calls with perf_basename()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 8 Apr 2026 17:32:03 +0000 (14:32 -0300)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 9 Apr 2026 02:21:05 +0000 (19:21 -0700)
commit19a9ed115fda95317c98bef0c716ea8412cd8ce0
tree8756286240543453592e3a0cbcb081fde634f93e
parentfbfb858552fb9a4c869e22f3303c7c7365367509
perf tools: Replace basename() calls with perf_basename()

As noticed in a sashiko review for a patch adding a missing libgen.h
in a file using basename():

  https://sashiko.dev/#/patchset/20260402001740.2220481-1-acme%40kernel.org

So avoid these subtleties and instead reuse the gnu_basename() function
we had in srcline.c, renaming it to perf_basename() and replace
basename() calls with it, simplifying several cases by removing now
needless strdups.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-daemon.c
tools/perf/util/annotate.c
tools/perf/util/data-convert-json.c
tools/perf/util/dsos.c
tools/perf/util/probe-event.c
tools/perf/util/srcline.c
tools/perf/util/symbol.h
tools/perf/util/util.c
tools/perf/util/util.h