From fc6f26515525b2ac032dc4b2804f9dd24892451b Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Fri, 5 Nov 2021 20:45:51 +0100 Subject: [PATCH] Profiler: Use existing path split when mmapping libraries We already extracted the `path` part of the segment name, so use that for checking if the filename looks like a shared library. --- Userland/DevTools/Profiler/Process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/DevTools/Profiler/Process.cpp b/Userland/DevTools/Profiler/Process.cpp index af9a4d2a9d..c4874300c7 100644 --- a/Userland/DevTools/Profiler/Process.cpp +++ b/Userland/DevTools/Profiler/Process.cpp @@ -90,7 +90,7 @@ void LibraryMetadata::handle_mmap(FlatPtr base, size_t size, const String& name) } else { String path_string = path.to_string(); String full_path; - if (name.contains(".so"sv)) + if (path_string.ends_with(".so"sv)) full_path = String::formatted("/usr/lib/{}", path); else full_path = path_string;