public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 bpf-next 0/3] libbpf: Fix event name too long error and add tests
@ 2025-04-14  9:33 Feng Yang
  2025-04-14  9:34 ` [PATCH v3 bpf-next 1/3] libbpf: Fix event name too long error Feng Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Feng Yang @ 2025-04-14  9:33 UTC (permalink / raw)
  To: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, hengqi.chen
  Cc: bpf, linux-kernel

From: Feng Yang <yangfeng@kylinos.cn>

Hi everyone,

This series tries to fix event name too long error and add tests.

When the binary path is excessively long, the generated probe_name in libbpf
exceeds the kernel's MAX_EVENT_NAME_LEN limit (64 bytes).
This causes legacy uprobe event attachment to fail with error code -22.

---
Changes in v3:
- add __sync_fetch_and_add(&index) and let snprintf() do the trimming. Thanks, Andrii Nakryiko!
- add selftests.
- Link to v2: https://lore.kernel.org/all/20250411080545.319865-1-yangfeng59949@163.com/

Changes in v2:
- Use basename() and %.32s to fix. Thanks, Hengqi Chen!
- Link to v1: https://lore.kernel.org/all/20250410052712.206785-1-yangfeng59949@163.com/

Feng Yang (3):
  libbpf: Fix event name too long error
  selftests/bpf: Add test for attaching uprobe with long event names
  selftests/bpf: Add test for attaching kprobe with long event names

 tools/lib/bpf/libbpf.c                        | 19 +++--
 .../selftests/bpf/prog_tests/attach_probe.c   | 84 +++++++++++++++++++
 .../selftests/bpf/test_kmods/bpf_testmod.c    |  5 ++
 .../bpf/test_kmods/bpf_testmod_kfunc.h        |  2 +
 4 files changed, 103 insertions(+), 7 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-04-15  7:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14  9:33 [PATCH v3 bpf-next 0/3] libbpf: Fix event name too long error and add tests Feng Yang
2025-04-14  9:34 ` [PATCH v3 bpf-next 1/3] libbpf: Fix event name too long error Feng Yang
2025-04-14 11:43   ` Jiri Olsa
2025-04-15  2:01     ` Feng Yang
2025-04-15  7:20       ` Jiri Olsa
2025-04-14  9:34 ` [PATCH v3 bpf-next 2/3] selftests/bpf: Add test for attaching uprobe with long event names Feng Yang
2025-04-14  9:34 ` [PATCH v3 bpf-next 3/3] selftests/bpf: Add test for attaching kprobe " Feng Yang
2025-04-14 11:47   ` Jiri Olsa
2025-04-15  2:52     ` Feng Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox