Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH bpf-next] samples: bpf: Fix broken bpf programs due to removed symbol
@ 2020-08-18  5:16 Daniel T. Lee
  2020-08-18 16:00 ` Yonghong Song
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel T. Lee @ 2020-08-18  5:16 UTC (permalink / raw)
  To: Daniel Borkmann, Alexei Starovoitov; +Cc: netdev, bpf

From commit f1394b798814 ("block: mark blk_account_io_completion
static") symbol blk_account_io_completion() has been marked as static,
which makes it no longer possible to attach kprobe to this event.
Currently, there are broken samples due to this reason.

As a solution to this, attach kprobe events to blk_account_io_done()
to modify them to perform the same behavior as before.

Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
---
 samples/bpf/task_fd_query_kern.c | 2 +-
 samples/bpf/task_fd_query_user.c | 2 +-
 samples/bpf/tracex3_kern.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/bpf/task_fd_query_kern.c b/samples/bpf/task_fd_query_kern.c
index 278ade5427c8..c821294e1774 100644
--- a/samples/bpf/task_fd_query_kern.c
+++ b/samples/bpf/task_fd_query_kern.c
@@ -10,7 +10,7 @@ int bpf_prog1(struct pt_regs *ctx)
 	return 0;
 }
 
-SEC("kretprobe/blk_account_io_completion")
+SEC("kretprobe/blk_account_io_done")
 int bpf_prog2(struct pt_regs *ctx)
 {
 	return 0;
diff --git a/samples/bpf/task_fd_query_user.c b/samples/bpf/task_fd_query_user.c
index ff2e9c1c7266..4a74531dc403 100644
--- a/samples/bpf/task_fd_query_user.c
+++ b/samples/bpf/task_fd_query_user.c
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
 	/* test two functions in the corresponding *_kern.c file */
 	CHECK_AND_RET(test_debug_fs_kprobe(0, "blk_mq_start_request",
 					   BPF_FD_TYPE_KPROBE));
-	CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_completion",
+	CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_done",
 					   BPF_FD_TYPE_KRETPROBE));
 
 	/* test nondebug fs kprobe */
diff --git a/samples/bpf/tracex3_kern.c b/samples/bpf/tracex3_kern.c
index 659613c19a82..710a4410b2fb 100644
--- a/samples/bpf/tracex3_kern.c
+++ b/samples/bpf/tracex3_kern.c
@@ -49,7 +49,7 @@ struct {
 	__uint(max_entries, SLOTS);
 } lat_map SEC(".maps");
 
-SEC("kprobe/blk_account_io_completion")
+SEC("kprobe/blk_account_io_done")
 int bpf_prog2(struct pt_regs *ctx)
 {
 	long rq = PT_REGS_PARM1(ctx);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] samples: bpf: Fix broken bpf programs due to removed symbol
  2020-08-18  5:16 [PATCH bpf-next] samples: bpf: Fix broken bpf programs due to removed symbol Daniel T. Lee
@ 2020-08-18 16:00 ` Yonghong Song
  2020-08-19  0:10   ` Alexei Starovoitov
  0 siblings, 1 reply; 3+ messages in thread
From: Yonghong Song @ 2020-08-18 16:00 UTC (permalink / raw)
  To: Daniel T. Lee, Daniel Borkmann, Alexei Starovoitov; +Cc: netdev, bpf



On 8/17/20 10:16 PM, Daniel T. Lee wrote:
>  From commit f1394b798814 ("block: mark blk_account_io_completion
> static") symbol blk_account_io_completion() has been marked as static,
> which makes it no longer possible to attach kprobe to this event.
> Currently, there are broken samples due to this reason.
> 
> As a solution to this, attach kprobe events to blk_account_io_done()
> to modify them to perform the same behavior as before.
> 
> Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>

Acked-by: Yonghong Song <yhs@fb.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] samples: bpf: Fix broken bpf programs due to removed symbol
  2020-08-18 16:00 ` Yonghong Song
@ 2020-08-19  0:10   ` Alexei Starovoitov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2020-08-19  0:10 UTC (permalink / raw)
  To: Yonghong Song
  Cc: Daniel T. Lee, Daniel Borkmann, Alexei Starovoitov,
	Network Development, bpf

On Tue, Aug 18, 2020 at 9:01 AM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 8/17/20 10:16 PM, Daniel T. Lee wrote:
> >  From commit f1394b798814 ("block: mark blk_account_io_completion
> > static") symbol blk_account_io_completion() has been marked as static,
> > which makes it no longer possible to attach kprobe to this event.
> > Currently, there are broken samples due to this reason.
> >
> > As a solution to this, attach kprobe events to blk_account_io_done()
> > to modify them to perform the same behavior as before.
> >
> > Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
>
> Acked-by: Yonghong Song <yhs@fb.com>

Applied. Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-19  0:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18  5:16 [PATCH bpf-next] samples: bpf: Fix broken bpf programs due to removed symbol Daniel T. Lee
2020-08-18 16:00 ` Yonghong Song
2020-08-19  0:10   ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).