On Thu, May 14, 2026 at 03:53 PM +02, Jiri Olsa wrote:
> We now expect nop combo with 10 bytes nop instead of 5 bytes nop,
> fixing has_nop_combo to reflect that.
>
> Signed-off-by: Jiri Olsa <[email protected]>
> ---
>  tools/lib/bpf/usdt.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/tools/lib/bpf/usdt.c b/tools/lib/bpf/usdt.c
> index e3710933fd52..7e62e4d5bedd 100644
> --- a/tools/lib/bpf/usdt.c
> +++ b/tools/lib/bpf/usdt.c
> @@ -305,7 +305,7 @@ struct usdt_manager *usdt_manager_new(struct bpf_object 
> *obj)
>  
>       /*
>        * Detect kernel support for uprobe() syscall, it's presence means we 
> can
> -      * take advantage of faster nop5 uprobe handling.
> +      * take advantage of faster nop10 uprobe handling.
>        * Added in: 56101b69c919 ("uprobes/x86: Add uprobe syscall to speed up 
> uprobe")
>        */
>       man->has_uprobe_syscall = kernel_supports(obj, FEAT_UPROBE_SYSCALL);
> @@ -596,14 +596,14 @@ static int parse_usdt_spec(struct usdt_spec *spec, 
> const struct usdt_note *note,
>  #if defined(__x86_64__)
>  static bool has_nop_combo(int fd, long off)
>  {
> -     unsigned char nop_combo[6] = {
> -             0x90, 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nop,nop5 */
> +     unsigned char nop_combo[11] = {
> +             0x90, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 
> 0x00,
>       };
> -     unsigned char buf[6];
> +     unsigned char buf[11];
>  
> -     if (pread(fd, buf, 6, off) != 6)
> +     if (pread(fd, buf, 11, off) != 11)
>               return false;
> -     return memcmp(buf, nop_combo, 6) == 0;
> +     return memcmp(buf, nop_combo, 11) == 0;
>  }
>  #else
>  static bool has_nop_combo(int fd, long off)

Nit: Would use ARRAY_SIZE(buf) instead of repeating the scalar value
in multiple places. Otherwise:

Reviewed-by: Jakub Sitnicki <[email protected]>

Reply via email to