From ca927133b7d909cb6f78d1eb2904bbbfbb426122 Mon Sep 17 00:00:00 2001 From: Yinzuo Jiang Date: Mon, 10 Nov 2025 02:20:35 +0800 Subject: [PATCH] fix(32-wallclock-profiler): use absolute path to find tool paths (#186) Problem: `Path(__file__)` can be ".", in such case `self.oncpu_tool` is "oncputime", which can not be found by the shell. Solution: Translate `Path(__file__)` to absolute path. --- src/32-wallclock-profiler/wallclock_profiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/32-wallclock-profiler/wallclock_profiler.py b/src/32-wallclock-profiler/wallclock_profiler.py index a7b64c5..dcf843f 100755 --- a/src/32-wallclock-profiler/wallclock_profiler.py +++ b/src/32-wallclock-profiler/wallclock_profiler.py @@ -32,7 +32,7 @@ class CombinedProfiler: self.offcpu_error = None # Find tool paths - self.script_dir = Path(__file__).parent + self.script_dir = Path(__file__).absolute().parent self.oncpu_tool = self.script_dir / "oncputime" self.offcpu_tool = self.script_dir / "offcputime" @@ -916,4 +916,4 @@ Examples: sys.exit(1) if __name__ == "__main__": - main() \ No newline at end of file + main()