Bug 1224403

Summary: bpftrace: ERROR: Error attaching probe: 'kprobe:swap_readpage'
Product: [openSUSE] openSUSE Tumbleweed Reporter: Petr Vorel <petr.vorel>
Component: DevelopmentAssignee: Shung-Hsi Yu <shung-hsi.yu>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: ailiopoulos, pcervinka
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Petr Vorel 2024-05-17 08:45:32 UTC
bpftrace fails to attach probe:

# echo -e "\ninterval:s:5 { exit(); }" | cat /usr/share/bpftrace/tools/swapin.bt - | bpftrace -
stdin:1-16: WARNING: swap_readpage is not traceable (either non-existing, inlined, or marked as "notrace"); attaching to it will likely fail
Attaching 3 probes...
cannot attach kprobe, probe entry may not exist
ERROR: Error attaching probe: 'kprobe:swap_readpage'

# echo $?
255

It has been failing for some time (at least since 20240412, but probably much longer).
Comment 1 Anthony Iliopoulos 2024-05-17 09:24:38 UTC
That's due to upstream kernel commit commit c9bdf768dd93 ("mm: convert swap_readpage() to swap_read_folio()"), merged in v6.8-rc1.

The swapin.bt probe needs to be changed accordingly from kprobe:swap_readpage to kprobe:swap_read_folio.