Skip to content

Commit

Permalink
bpflist: linter cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaigno committed Oct 7, 2017
1 parent 7c9d8c9 commit e617bf4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/bpflist.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@ def comm_for_pid(pid):
counts = {}

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):
# Probes opened by bcc have a specific pattern that includes the pid
# of the requesting process.
match = re.search('_bcc_(\\d+)\\s', probe)
if match:
pid = int(match.group(1))
counts[(pid, typ)] = counts.get((pid, typ), 0) + 1
if args.verbosity > 1: print(probe.strip())
if args.verbosity > 1: print("")
if args.verbosity > 1:
print(probe.strip())
if args.verbosity > 1:
print("")

if args.verbosity > 0:
parse_probes("kprobe")
Expand Down

0 comments on commit e617bf4

Please sign in to comment.