Skip to content

Commit

Permalink
tools: fix cachetop.py with 5.15 kernel
Browse files Browse the repository at this point in the history
The tool cachetop.py doesn't work with 5.15 kernel due to
kprobe function renaming. Adapt to the new function.
Commit 61087b9 ("tools: fix cachestat.py with 5.15 kernel")
fixed a similar issue for cachestat.py.

Signed-off-by: Yonghong Song <[email protected]>
  • Loading branch information
yonghong-song committed Nov 11, 2021
1 parent 61087b9 commit bf49924
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/cachetop.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,14 @@ def handle_loop(stdscr, args):
b = BPF(text=bpf_text)
b.attach_kprobe(event="add_to_page_cache_lru", fn_name="do_count")
b.attach_kprobe(event="mark_page_accessed", fn_name="do_count")
b.attach_kprobe(event="account_page_dirtied", fn_name="do_count")
b.attach_kprobe(event="mark_buffer_dirty", fn_name="do_count")

# Function account_page_dirtied() is changed to folio_account_dirtied() in 5.15.
if BPF.get_kprobe_functions(b'folio_account_dirtied'):
b.attach_kprobe(event="folio_account_dirtied", fn_name="do_count")
elif BPF.get_kprobe_functions(b'account_page_dirtied'):
b.attach_kprobe(event="account_page_dirtied", fn_name="do_count")

exiting = 0

while 1:
Expand Down

0 comments on commit bf49924

Please sign in to comment.