From 7479f8e73eac2be5bdeaeed7b655a15308c848be Mon Sep 17 00:00:00 2001 From: Francisco Javier Honduvilla Coto Date: Mon, 23 Sep 2024 15:29:59 +0100 Subject: [PATCH] Warn on potential unknown special paths As we would rather known about this than silently fail to continue as the error will early bail from dealing with all the mappings. Test Plan ========= Ran for some minutes without issues. --- src/profiler.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/profiler.rs b/src/profiler.rs index 138e1d8..667a14d 100644 --- a/src/profiler.rs +++ b/src/profiler.rs @@ -1270,11 +1270,18 @@ impl Profiler<'_> { let abs_path = format!("/proc/{}/root/{}", pid, path.to_string_lossy()); // We've seen debug info executables that get deleted in Rust applications. - // There are probably other cases, but we'll handle them as we bump into them. if abs_path.contains("(deleted)") { continue; } + // There are probably other cases, but we'll handle them as we bump into them. + if abs_path.contains("(") { + warn!( + "absolute path ({}) contains '(', it might be special", + abs_path + ); + } + // We want to open the file as quickly as possible to minimise the chances of races // if the file is deleted. let file = match fs::File::open(&abs_path) {