samples/bpf: fix broken bpf programs due to function inlining
Subsystems (3)
PATCH 1/1 samples/bpf: fix broken bpf programs due to function inlining
commit: "be6bfe36db17 block: inline hot paths of blk_account_io_*()" inlines the function blk_account_io_done. As a result we can't attach a kprobe to the function anymore. Use __blk_account_io_done instead.
--- samples/bpf/task_fd_query_kern.c | 2 +- samples/bpf/tracex3_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
samples/bpf/task_fd_query_kern.c +1 -1
@@ -10,7 +10,7 @@ int bpf_prog1(struct pt_regs *ctx)return 0 ; } -SEC("kretprobe/blk_account_io_done") +SEC("kretprobe/__blk_account_io_done")int bpf_prog2 (struct pt_regs *ctx) {return 0 ;
samples/bpf/tracex3_kern.c +1 -1
@@ -49,7 +49,7 @@ struct {__uint (max_entries,SLOTS ); } lat_map SEC(".maps"); -SEC("kprobe/blk_account_io_done") +SEC("kprobe/__blk_account_io_done")int bpf_prog2 (struct pt_regs *ctx) {long rq =PT_REGS_PARM1 (ctx);
Signature · 1 line
2.35.1
Quoted 5 lines · Muhammad Falak R Wani
commit: "
be6bfe36db17block: inline hot paths of blk_account_io_*()" inlines the functionblk_account_io_done. As a result we can't attach a kprobe to the function anymore. Use__blk_account_io_doneinstead.Signed-off-by Muhammad Falak R Wani <[email protected]>
samples/bpf/task_fd_query_kern.c
Quoted 15 lines · Muhammad Falak R Wani
commit: "
be6bfe36db17block: inline hot paths of blk_account_io_*()" inlines the functionblk_account_io_done. As a result we can't attach a kprobe to the function anymore. Use__blk_account_io_doneinstead.Signed-off-by Muhammad Falak R Wani <[email protected]>--- samples/bpf/task_fd_query_kern.c | 2 +- samples/bpf/tracex3_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)samples/bpf/task_fd_query_kern.c +0
-0
samples/bpf/task_fd_query_user.c also needs adjusting, no? Have you tried running those samples?
Quoted 25 lines
samples/bpf/task_fd_query_kern.c +1
-1@@ -10,7 +10,7 @@ int bpf_prog1(struct pt_regs *ctx)return 0 ; } -SEC("kretprobe/blk_account_io_done") +SEC("kretprobe/__blk_account_io_done")int bpf_prog2 (struct pt_regs *ctx) {return 0 ;samples/bpf/tracex3_kern.c +1
-2@@ -49,7 +49,7 @@ struct {__uint (max_entries,SLOTS ); } lat_map SEC(".maps"); -SEC("kprobe/blk_account_io_done") +SEC("kprobe/__blk_account_io_done")int bpf_prog2 (struct pt_regs *ctx) {long rq =PT_REGS_PARM1 (ctx); --2.35.1
Quoted 13 lines · Andrii Nakryiko
Quoted 11 lines · Muhammad Falak R Wani
commit: "
be6bfe36db17block: inline hot paths of blk_account_io_*()" inlines the functionblk_account_io_done. As a result we can't attach a kprobe to the function anymore. Use__blk_account_io_doneinstead.Signed-off-by Muhammad Falak R Wani <[email protected]>--- samples/bpf/task_fd_query_kern.c | 2 +- samples/bpf/tracex3_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 7 lines
samples/bpf/task_fd_query_kern.c
Quoted 4 lines
samples/bpf/task_fd_query_kern.c +0
-0
samples/bpf/task_fd_query_user.calso needs adjusting, no? Have you tried running those samples?
Aplologies, I ran the tracex3 program, but missed to verify task_fd_query. Should I send a V2 where I modify only the tracex3 ?
Quoted 22 lines · Muhammad Falak R Wani
Quoted 13 lines · Andrii Nakryiko
Quoted 11 lines · Muhammad Falak R Wani
commit: "
be6bfe36db17block: inline hot paths of blk_account_io_*()" inlines the functionblk_account_io_done. As a result we can't attach a kprobe to the function anymore. Use__blk_account_io_doneinstead.Signed-off-by Muhammad Falak R Wani <[email protected]>--- samples/bpf/task_fd_query_kern.c | 2 +- samples/bpf/tracex3_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Quoted 7 lines
samples/bpf/task_fd_query_kern.c
Quoted 4 lines
samples/bpf/task_fd_query_kern.c +0
-0
samples/bpf/task_fd_query_user.calso needs adjusting, no? Have you tried running those samples?
Quoted 2 lines
Aplologies, I ran the
tracex3program, but missed to verifytask_fd_query. Should I send a V2 where I modify only thetracex3?
No, send a patch fixing everything in one patch