aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <[email protected]>2023-04-17 21:28:01 +0000
committerArnaldo Carvalho de Melo <[email protected]>2023-04-17 21:47:55 +0000
commit7031edac9dbc0f880c9fbaa40ca08b5de34239c6 (patch)
tree41c376c2a746d69ac2fa143d35bc95c3163ef8e2 /tools/perf/util/annotate.c
parentperf cpumap: Add reference count checking (diff)
downloadkernel-7031edac9dbc0f880c9fbaa40ca08b5de34239c6.tar.gz
kernel-7031edac9dbc0f880c9fbaa40ca08b5de34239c6.zip
perf dso: Add dso__filename_with_chroot() to reduce number of accesses to dso->nsinfo members
We'll need to reference count dso->nsinfo, so reduce the number of direct accesses by having a shorter form of obtaining a filename with a chroot (namespace one). Cc: Adrian Hunter <[email protected]> Cc: Alexey Bayduraev <[email protected]> Cc: Dmitriy Vyukov <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Riccardo Mancini <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Stephen Brennan <[email protected]> Link: https://lore.kernel.org/lkml/[email protected] [ Used nsinfo__pid(dso->nsinfo), as it was already present ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index e2693a1c28d5..ca9f0add68f4 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1692,8 +1692,7 @@ fallback:
mutex_lock(&dso->lock);
if (access(filename, R_OK) && errno == ENOENT && dso->nsinfo) {
- char *new_name = filename_with_chroot(dso->nsinfo->pid,
- filename);
+ char *new_name = dso__filename_with_chroot(dso, filename);
if (new_name) {
strlcpy(filename, new_name, filename_size);
free(new_name);