Skip to content

libbpf: support "module:function" syntax for tracing programs

Viktor Malik bpf 2 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- stylistic changes (suggested by Andrii)
- added Andrii's ack to the second patch

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2libbpf: support "module:function" syntax for tracing programstools/lib/bpf/libbpf.c+26 -90 repliesApplied
2/2selftests/bpf: add tests for the "module:function" syntaxtools/testing/selftests/bpf/prog_tests/module_attach.c tools/testing/selftests/bpf/progs/test_module_attach.c+29 -00 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAndrii Nakryiko
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/2] libbpf: support "module:function" syntax for tracing programs

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.

---

Changes in v2:
- stylistic changes (suggested by Andrii)
- added Andrii's ack to the second patch

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                        | 35 ++++++++++++++-----
 .../selftests/bpf/prog_tests/module_attach.c  |  6 ++++
 .../selftests/bpf/progs/test_module_attach.c  | 23 ++++++++++++
 3 files changed, 55 insertions(+), 9 deletions(-)
Signature · 1 line
2.44.0