[PATCH v1 00/11] perf tools: Enhance namespace and chroot handling

From: Namhyung Kim

Date: Fri Oct 23 2026 - 03:21:28 EST


Hello,

This patchset improves namespace and chroot handling with regards to
file access. Basically it reads the information from the proc file
system but it's only meaningful when you run the perf command on the
same machine and the target thread is still alive.

Also some file types don't need to namespace and chroot translation
because they are located in a global directory and expected to be in
the same namespace and root directory with the perf command itself.

Thanks,
Namhyung


Namhyung Kim (11):
perf tools: Add HEADER_BOOT_ID feature
perf tools: Add perf_env__is_same_boot()
perf tools: Add nsinfo__new_thread() to track tid
perf tools: Defer /proc lookup until nsinfo is used
perf tools: Verify thread status and mount namespace inode
perf tools: Check thread liveness when accessing /proc
perf tools: Handle chroot inside nsinfo__mountns_enter()
perf tools: Export filename__read_build_id_ns()
perf tools: Remove redundant chroot handling
perf tools: Only enter mount namespace if necessary
perf tools: Scope mount namespace entry in dso__load()

.../Documentation/perf.data-file-format.txt | 5 +
tools/perf/builtin-inject.c | 13 +-
tools/perf/builtin-trace.c | 2 +-
tools/perf/util/build-id.c | 6 +-
tools/perf/util/capstone.c | 6 +-
tools/perf/util/dso.c | 41 +---
tools/perf/util/dso.h | 36 ++-
tools/perf/util/dsos.c | 17 +-
tools/perf/util/env.c | 65 +++++
tools/perf/util/env.h | 3 +
tools/perf/util/header.c | 28 +++
tools/perf/util/header.h | 1 +
tools/perf/util/machine.c | 12 +-
tools/perf/util/namespaces.c | 230 +++++++++++++++---
tools/perf/util/namespaces.h | 12 +
tools/perf/util/symbol.c | 51 ++--
tools/perf/util/symbol.h | 3 +
tools/perf/util/thread.c | 39 ++-
tools/perf/util/thread.h | 7 +-
tools/perf/util/util.c | 31 ---
tools/perf/util/util.h | 2 -
21 files changed, 436 insertions(+), 174 deletions(-)

--
2.56.0.257.gf7497c7d27-goog