xref: /linux/tools/testing/selftests/bpf/progs/test_enable_stats.c (revision 24bce201d79807b668bf9d9e0aca801c5c0d5f78)
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2020 Facebook
3 
4 #include <linux/bpf.h>
5 #include <stdint.h>
6 #include <linux/types.h>
7 #include <bpf/bpf_helpers.h>
8 
9 char _license[] SEC("license") = "GPL";
10 
11 __u64 count = 0;
12 
13 SEC("raw_tracepoint/sys_enter")
14 int test_enable_stats(void *ctx)
15 {
16 	__sync_fetch_and_add(&count, 1);
17 	return 0;
18 }
19