selftests/bpf: Add get_stackid_cannot_attach
authorSong Liu <songliubraving@fb.com>
Thu, 23 Jul 2020 18:06:48 +0000 (11:06 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Jul 2020 03:16:35 +0000 (20:16 -0700)
commit346938e9380cc0b2ad8e2566389cdc570386fe22
treec87d99dabe2c42a178399bffc9c9e94c2be496a2
parent1da4864c2b20f81afbb18b2a0b914d0c776331fc
selftests/bpf: Add get_stackid_cannot_attach

This test confirms that BPF program that calls bpf_get_stackid() cannot
attach to perf_event with precise_ip > 0 but not PERF_SAMPLE_CALLCHAIN;
and cannot attach if the perf_event has exclude_callchain_kernel.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200723180648.1429892-6-songliubraving@fb.com
tools/testing/selftests/bpf/prog_tests/get_stackid_cannot_attach.c [new file with mode: 0644]