Re: [PATCHv4 bpf-next 2/5] libbpf: Add support to detect nop,nop5 instructions combo for usdt probe

From: bot+bpf-ci

Date: Fri Feb 20 2026 - 06:24:59 EST


> diff --git a/tools/lib/bpf/usdt.c b/tools/lib/bpf/usdt.c
> index d1524f6f54ae..c81e0a58caf5 100644
> --- a/tools/lib/bpf/usdt.c
> +++ b/tools/lib/bpf/usdt.c

[ ... ]

> +#if defined(__x86_64__)
> +static bool has_nop_combo(int fd, long off)
> +{
> + static unsigned char nop_combo[6] = {
^^^^^^^^^^^^^^^^^^^^^^

Should nop_combo be declared const? It is a read-only lookup table
used only in the memcmp() below.

> + 0x90, 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nop,nop5 */
> + };
> + unsigned char buf[6] = {};
> +
> + if (pread(fd, buf, 6, off) != 6)
> + return false;
> + return memcmp(buf, nop_combo, 6) == 0;
> +}

[ ... ]


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/22221513473

AI-authorship-score: low
AI-authorship-explanation: Domain-specific optimization from established BPF/tracing maintainer with iterative lore review history and deep x86_64 uprobe internals knowledge.
issues-found: 1
issue-severity-score: low
issue-severity-explanation: Missing const qualifier on a static read-only byte array is a minor C best practice deviation with no runtime impact.