mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
Adding test that attaches bpf program on usdt probe in 2 scenarios; - attach program on top of usdt_1, which is single nop instruction, so the probe stays on nop instruction and is not optimized. - attach program on top of usdt_2 which is probe defined on top of nop,nop5 combo, so the probe is placed on top of nop5 and is optimized. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20260224103915.1369690-5-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
19 lines
288 B
C
19 lines
288 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#if defined(__x86_64__)
|
|
|
|
/*
|
|
* Include usdt.h with defined USDT_NOP macro to use single
|
|
* nop instruction.
|
|
*/
|
|
#define USDT_NOP .byte 0x90
|
|
#include "usdt.h"
|
|
|
|
__attribute__((aligned(16)))
|
|
void usdt_1(void)
|
|
{
|
|
USDT(optimized_attach, usdt_1);
|
|
}
|
|
|
|
#endif
|