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
7int run_cnt = 0;
8
9SEC("perf_event")
10int handler(struct pt_regs *ctx)
11{
12 __sync_fetch_and_add(&run_cnt, 1);
13 return 0;
14}
15
16char _license[] SEC("license") = "GPL";
17

source code of linux/tools/testing/selftests/bpf/progs/test_perf_link.c