xref: /linux/tools/testing/selftests/bpf/progs/test_perf_link.c (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2021 Facebook */
3 #include "vmlinux.h"
4 #include <bpf/bpf_helpers.h>
5 #include <bpf/bpf_tracing.h>
6 
7 int run_cnt = 0;
8 
9 SEC("perf_event")
10 int handler(struct pt_regs *ctx)
11 {
12 	__sync_fetch_and_add(&run_cnt, 1);
13 	return 0;
14 }
15 
16 char _license[] SEC("license") = "GPL";
17