Skip to content

Commit

Permalink
tools: handle renamed lookup_fast function in dcache tools
Browse files Browse the repository at this point in the history
The lookup_fast function can be rename lookup_fast.constprop.x by gcc
constant propagation optimization and that breaks dcstat and
dcsnoop. Let's look for both name using a regular expression.
  • Loading branch information
jeromemarchand authored and yonghong-song committed Mar 20, 2021
1 parent 31d8bdf commit cdfddc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/dcsnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
# initialize BPF
b = BPF(text=bpf_text)
if args.all:
b.attach_kprobe(event="lookup_fast", fn_name="trace_fast")
b.attach_kprobe(event_re="^lookup_fast$|^lookup_fast.constprop.*.\d$", fn_name="trace_fast")

mode_s = {
0: 'M',
Expand Down
2 changes: 1 addition & 1 deletion tools/dcstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def usage():

# load BPF program
b = BPF(text=bpf_text)
b.attach_kprobe(event="lookup_fast", fn_name="count_fast")
b.attach_kprobe(event_re="^lookup_fast$|^lookup_fast.constprop.*.\d$", fn_name="count_fast")
b.attach_kretprobe(event="d_lookup", fn_name="count_lookup")

# stat column labels and indexes
Expand Down

0 comments on commit cdfddc4

Please sign in to comment.