public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>
Subject: [PATCH bpf-next 0/4] libbpf: Make optimized uprobes backward compatible
Date: Mon, 17 Nov 2025 09:35:47 +0100	[thread overview]
Message-ID: <20251117083551.517393-1-jolsa@kernel.org> (raw)

hi,
we can currently optimize uprobes on top of nop5 instructions,
so application can define USDT_NOP to nop5 and use USDT macro
to define optimized usdt probes.

This works fine on new kernels, but could have performance penalty
on older kernels, that do not have the support to optimize and to
emulate nop5 instruction.

This patchset adds support to workaround the performance penalty
on older kernels that do not support uprobe optimization, please
see detailed description in patch 1.

Note patch 1 will need to get pushed to libbpf/usdt [1] as well.

thanks,
jirka


[1] https://github.com/libbpf/usdt
---
Jiri Olsa (4):
      selftests/bpf: Emit nop,nop5 instructions for x86_64 usdt probe
      libbpf: Add uprobe syscall feature detection
      libbpf: Add support to parse extra info in usdt note record
      selftests/bpf: Add test for checking correct nop of optimized usdt

 tools/lib/bpf/features.c                      | 22 ++++++++++++++++++++++
 tools/lib/bpf/libbpf_internal.h               |  2 ++
 tools/lib/bpf/usdt.c                          | 27 ++++++++++++++++++++++++++-
 tools/testing/selftests/bpf/.gitignore        |  2 ++
 tools/testing/selftests/bpf/Makefile          |  7 ++++++-
 tools/testing/selftests/bpf/prog_tests/usdt.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/test_usdt.c |  9 +++++++++
 tools/testing/selftests/bpf/usdt.h            | 17 +++++++++++++++++
 tools/testing/selftests/bpf/usdt_1.c          | 14 ++++++++++++++
 tools/testing/selftests/bpf/usdt_2.c          | 13 +++++++++++++
 10 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/usdt_1.c
 create mode 100644 tools/testing/selftests/bpf/usdt_2.c

             reply	other threads:[~2025-11-17  8:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17  8:35 Jiri Olsa [this message]
2025-11-17  8:35 ` [PATCH bpf-next 1/4] selftests/bpf: Emit nop,nop5 instructions for x86_64 usdt probe Jiri Olsa
2025-11-24 17:29   ` Andrii Nakryiko
2025-11-26  8:29     ` Jiri Olsa
2025-11-17  8:35 ` [PATCH bpf-next 2/4] libbpf: Add uprobe syscall feature detection Jiri Olsa
2025-11-24 17:29   ` Andrii Nakryiko
2025-11-26  8:29     ` Jiri Olsa
2025-11-17  8:35 ` [PATCH bpf-next 3/4] libbpf: Add support to parse extra info in usdt note record Jiri Olsa
2025-11-24 17:29   ` Andrii Nakryiko
2025-11-26  8:30     ` Jiri Olsa
2025-11-17  8:35 ` [PATCH bpf-next 4/4] selftests/bpf: Add test for checking correct nop of optimized usdt Jiri Olsa
2025-11-24 17:34   ` Andrii Nakryiko
2025-11-26  8:29     ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251117083551.517393-1-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox