Add permission error handling in trace_pipe

This commit is contained in:
Pragyansh Chaturvedi
2025-10-22 04:09:18 +05:30
parent 84fdf52658
commit 77c0d131be

View File

@ -7,6 +7,8 @@ def trace_pipe():
subprocess.run(["cat", "/sys/kernel/tracing/trace_pipe"])
except KeyboardInterrupt:
print("Tracing stopped.")
except (FileNotFoundError, PermissionError) as e:
print(f"Error accessing trace_pipe: {e}. Try running as root.")
def trace_fields():