All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining
@ 2022-03-06 12:15 Muhammad Falak R Wani
  2022-03-07  6:25 ` Yonghong Song
  2022-03-08  6:11 ` Andrii Nakryiko
  0 siblings, 2 replies; 5+ messages in thread
From: Muhammad Falak R Wani @ 2022-03-06 12:15 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, netdev, bpf, linux-kernel, Muhammad Falak R Wani

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.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
 samples/bpf/task_fd_query_kern.c | 2 +-
 samples/bpf/tracex3_kern.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/bpf/task_fd_query_kern.c b/samples/bpf/task_fd_query_kern.c
index c821294e1774..186ac0a79c0a 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_done")
+SEC("kretprobe/__blk_account_io_done")
 int bpf_prog2(struct pt_regs *ctx)
 {
 	return 0;
diff --git a/samples/bpf/tracex3_kern.c b/samples/bpf/tracex3_kern.c
index 710a4410b2fb..bde6591cb20c 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_done")
+SEC("kprobe/__blk_account_io_done")
 int bpf_prog2(struct pt_regs *ctx)
 {
 	long rq = PT_REGS_PARM1(ctx);
-- 
2.35.1


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

* Re: [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining
  2022-03-06 12:15 [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining Muhammad Falak R Wani
@ 2022-03-07  6:25 ` Yonghong Song
  2022-03-08  6:11 ` Andrii Nakryiko
  1 sibling, 0 replies; 5+ messages in thread
From: Yonghong Song @ 2022-03-07  6:25 UTC (permalink / raw)
  To: Muhammad Falak R Wani, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, John Fastabend, KP Singh, netdev,
	bpf, linux-kernel



On 3/6/22 4:15 AM, Muhammad Falak R Wani wrote:
> 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.
> 
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>

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

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

* Re: [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining
  2022-03-06 12:15 [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining Muhammad Falak R Wani
  2022-03-07  6:25 ` Yonghong Song
@ 2022-03-08  6:11 ` Andrii Nakryiko
  2022-03-08 10:43   ` Muhammad Falak R Wani
  1 sibling, 1 reply; 5+ messages in thread
From: Andrii Nakryiko @ 2022-03-08  6:11 UTC (permalink / raw)
  To: Muhammad Falak R Wani
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Networking, bpf, open list

On Sun, Mar 6, 2022 at 4:15 AM Muhammad Falak R Wani
<falakreyaz@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> ---
>  samples/bpf/task_fd_query_kern.c | 2 +-
>  samples/bpf/tracex3_kern.c       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/samples/bpf/task_fd_query_kern.c b/samples/bpf/task_fd_query_kern.c
> index c821294e1774..186ac0a79c0a 100644
> --- a/samples/bpf/task_fd_query_kern.c
> +++ b/samples/bpf/task_fd_query_kern.c

samples/bpf/task_fd_query_user.c also needs adjusting, no? Have you
tried running those samples?


> @@ -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;
> diff --git a/samples/bpf/tracex3_kern.c b/samples/bpf/tracex3_kern.c
> index 710a4410b2fb..bde6591cb20c 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_done")
> +SEC("kprobe/__blk_account_io_done")
>  int bpf_prog2(struct pt_regs *ctx)
>  {
>         long rq = PT_REGS_PARM1(ctx);
> --
> 2.35.1
>

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

* Re: [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining
  2022-03-08  6:11 ` Andrii Nakryiko
@ 2022-03-08 10:43   ` Muhammad Falak R Wani
  2022-03-08 17:56     ` Andrii Nakryiko
  0 siblings, 1 reply; 5+ messages in thread
From: Muhammad Falak R Wani @ 2022-03-08 10:43 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Networking, bpf, open list

On Mon, Mar 07, 2022 at 10:11:36PM -0800, Andrii Nakryiko wrote:
> On Sun, Mar 6, 2022 at 4:15 AM Muhammad Falak R Wani
> <falakreyaz@gmail.com> wrote:
> >
> > 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.
> >
> > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> > ---
> >  samples/bpf/task_fd_query_kern.c | 2 +-
> >  samples/bpf/tracex3_kern.c       | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/samples/bpf/task_fd_query_kern.c b/samples/bpf/task_fd_query_kern.c
> > index c821294e1774..186ac0a79c0a 100644
> > --- a/samples/bpf/task_fd_query_kern.c
> > +++ b/samples/bpf/task_fd_query_kern.c
> 
> samples/bpf/task_fd_query_user.c also 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` ?

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

* Re: [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining
  2022-03-08 10:43   ` Muhammad Falak R Wani
@ 2022-03-08 17:56     ` Andrii Nakryiko
  0 siblings, 0 replies; 5+ messages in thread
From: Andrii Nakryiko @ 2022-03-08 17:56 UTC (permalink / raw)
  To: Muhammad Falak R Wani
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Networking, bpf, open list

On Tue, Mar 8, 2022 at 2:43 AM Muhammad Falak R Wani
<falakreyaz@gmail.com> wrote:
>
> On Mon, Mar 07, 2022 at 10:11:36PM -0800, Andrii Nakryiko wrote:
> > On Sun, Mar 6, 2022 at 4:15 AM Muhammad Falak R Wani
> > <falakreyaz@gmail.com> wrote:
> > >
> > > 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.
> > >
> > > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> > > ---
> > >  samples/bpf/task_fd_query_kern.c | 2 +-
> > >  samples/bpf/tracex3_kern.c       | 2 +-
> > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/samples/bpf/task_fd_query_kern.c b/samples/bpf/task_fd_query_kern.c
> > > index c821294e1774..186ac0a79c0a 100644
> > > --- a/samples/bpf/task_fd_query_kern.c
> > > +++ b/samples/bpf/task_fd_query_kern.c
> >
> > samples/bpf/task_fd_query_user.c also 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` ?

No, send a patch fixing everything in one patch

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

end of thread, other threads:[~2022-03-08 17:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-06 12:15 [PATCH bpf-next] samples/bpf: fix broken bpf programs due to function inlining Muhammad Falak R Wani
2022-03-07  6:25 ` Yonghong Song
2022-03-08  6:11 ` Andrii Nakryiko
2022-03-08 10:43   ` Muhammad Falak R Wani
2022-03-08 17:56     ` Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.