Skip to content

Commit

Permalink
toplev: Avoid root warning for import
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Jul 14, 2023
1 parent a474162 commit da4ec1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linux_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ def __init__(self, r):
r.force_metric(BlockIOs())
r.force_metric(NetworkTX())
r.force_metric(NetworkRX())
elif sys.argv[0].find("toplev") >= 0 and not warned:
elif sys.argv[0].find("toplev") >= 0 and not "--import" in sys.argv and not warned:
warned = True
print("Need to be root for trace point Linux software metrics.", file=sys.stderr)

0 comments on commit da4ec1e

Please sign in to comment.