]> Git Repo - linux.git/blob - tools/testing/selftests/bpf/progs/test_build_id.c
Linux 6.14-rc3
[linux.git] / tools / testing / selftests / bpf / progs / test_build_id.c
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
3
4 #include "vmlinux.h"
5 #include <bpf/bpf_helpers.h>
6
7 struct bpf_stack_build_id stack_sleepable[128];
8 int res_sleepable;
9
10 struct bpf_stack_build_id stack_nofault[128];
11 int res_nofault;
12
13 SEC("uprobe.multi/./uprobe_multi:uprobe")
14 int uprobe_nofault(struct pt_regs *ctx)
15 {
16         res_nofault = bpf_get_stack(ctx, stack_nofault, sizeof(stack_nofault),
17                                     BPF_F_USER_STACK | BPF_F_USER_BUILD_ID);
18
19         return 0;
20 }
21
22 SEC("uprobe.multi.s/./uprobe_multi:uprobe")
23 int uprobe_sleepable(struct pt_regs *ctx)
24 {
25         res_sleepable = bpf_get_stack(ctx, stack_sleepable, sizeof(stack_sleepable),
26                                       BPF_F_USER_STACK | BPF_F_USER_BUILD_ID);
27
28         return 0;
29 }
30
31 char _license[] SEC("license") = "GPL";
This page took 0.034587 seconds and 4 git commands to generate.