mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-02 17:59:47 +08:00
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:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user