0001
0002
0003 #include <linux/bpf.h>
0004 #include <bpf/bpf_helpers.h>
0005 #include "bpf_legacy.h"
0006
0007 struct ipv_counts {
0008 unsigned int v4;
0009 unsigned int v6;
0010 };
0011
0012 struct {
0013 __uint(type, BPF_MAP_TYPE_ARRAY);
0014 __uint(max_entries, 4);
0015 __type(key, int);
0016 __type(value, struct ipv_counts);
0017 } btf_map SEC(".maps");
0018
0019 __attribute__((noinline))
0020 int test_long_fname_2(void)
0021 {
0022 struct ipv_counts *counts;
0023 int key = 0;
0024
0025 counts = bpf_map_lookup_elem(&btf_map, &key);
0026 if (!counts)
0027 return 0;
0028
0029 counts->v6++;
0030
0031 return 0;
0032 }
0033
0034 __attribute__((noinline))
0035 int test_long_fname_1(void)
0036 {
0037 return test_long_fname_2();
0038 }
0039
0040 SEC("dummy_tracepoint")
0041 int _dummy_tracepoint(void *arg)
0042 {
0043 return test_long_fname_1();
0044 }
0045
0046 char _license[] SEC("license") = "GPL";