1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */
7 #include <bpf/bpf_helpers.h>
9 #include "bpf_tcp_helpers.h"
11 char _license[] SEC("license") = "GPL";
18 __uint(type, BPF_MAP_TYPE_ARRAY);
19 __uint(max_entries, 1);
21 __type(value, struct elem);
22 } timer_map SEC(".maps");
24 static int timer_cb_ret1(void *map, int *key, struct bpf_timer *timer)
26 if (bpf_get_smp_processor_id() % 2)
32 SEC("fentry/bpf_fentry_test1")
33 __failure __msg("should have been in (0x0; 0x0)")
34 int BPF_PROG2(test_ret_1, int, a)
37 struct bpf_timer *timer;
39 timer = bpf_map_lookup_elem(&timer_map, &key);
41 bpf_timer_init(timer, &timer_map, CLOCK_BOOTTIME);
42 bpf_timer_set_callback(timer, timer_cb_ret1);
43 bpf_timer_start(timer, 1000, 0);