bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] libbpf: support "module:function" syntax for tracing programs
@ 2024-04-26 12:17 Viktor Malik
  2024-04-26 12:17 ` [PATCH bpf-next 1/2] " Viktor Malik
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Viktor Malik @ 2024-04-26 12:17 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Viktor Malik

In some situations, it is useful to explicitly specify a kernel module
to search for a tracing program target (e.g. when a function of the same
name exists in multiple modules or in vmlinux).

This change enables that by allowing the "module:function" syntax for
the find_kernel_btf_id function. Thanks to this, the syntax can be used
both from a SEC macro (i.e. `SEC(fentry/module:function)`) and via the
bpf_program__set_attach_target API call.

Viktor Malik (2):
  libbpf: support "module:function" syntax for tracing programs
  selftests/bpf: add tests for the "module:function" syntax

 tools/lib/bpf/libbpf.c                        | 33 ++++++++++++++-----
 .../selftests/bpf/prog_tests/module_attach.c  |  6 ++++
 .../selftests/bpf/progs/test_module_attach.c  | 23 +++++++++++++
 3 files changed, 53 insertions(+), 9 deletions(-)

-- 
2.44.0


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

end of thread, other threads:[~2024-04-29 20:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 12:17 [PATCH bpf-next 0/2] libbpf: support "module:function" syntax for tracing programs Viktor Malik
2024-04-26 12:17 ` [PATCH bpf-next 1/2] " Viktor Malik
2024-04-29 20:10   ` Andrii Nakryiko
2024-04-26 12:17 ` [PATCH bpf-next 2/2] selftests/bpf: add tests for the "module:function" syntax Viktor Malik
2024-04-29 20:13   ` Andrii Nakryiko
2024-04-26 16:54 ` [PATCH bpf-next 0/2] libbpf: support "module:function" syntax for tracing programs Andrii Nakryiko
2024-04-29 12:32   ` Viktor Malik
2024-04-29 20:07     ` Andrii Nakryiko

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).