Commit e617bf40 authored by Paul Chaignon's avatar Paul Chaignon

bpflist: linter cleanup

parent 7c9d8c93
...@@ -40,7 +40,8 @@ def comm_for_pid(pid): ...@@ -40,7 +40,8 @@ def comm_for_pid(pid):
counts = {} counts = {}
def parse_probes(typ): def parse_probes(typ):
if args.verbosity > 1: print("open %ss:" % typ) if args.verbosity > 1:
print("open %ss:" % typ)
for probe in open("/sys/kernel/debug/tracing/%s_events" % typ): for probe in open("/sys/kernel/debug/tracing/%s_events" % typ):
# Probes opened by bcc have a specific pattern that includes the pid # Probes opened by bcc have a specific pattern that includes the pid
# of the requesting process. # of the requesting process.
...@@ -48,8 +49,10 @@ def parse_probes(typ): ...@@ -48,8 +49,10 @@ def parse_probes(typ):
if match: if match:
pid = int(match.group(1)) pid = int(match.group(1))
counts[(pid, typ)] = counts.get((pid, typ), 0) + 1 counts[(pid, typ)] = counts.get((pid, typ), 0) + 1
if args.verbosity > 1: print(probe.strip()) if args.verbosity > 1:
if args.verbosity > 1: print("") print(probe.strip())
if args.verbosity > 1:
print("")
if args.verbosity > 0: if args.verbosity > 0:
parse_probes("kprobe") parse_probes("kprobe")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment