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.
This commit is contained in:
Yinzuo Jiang
2025-11-10 02:20:35 +08:00
committed by GitHub
parent 2c9870bf83
commit ca927133b7

View File

@@ -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"