summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_perf_link.c
blob: c1db9fd98d0c4d3bec1bdf9aa95a62ff95437d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>

int run_cnt = 0;

SEC("perf_event")
int handler(struct pt_regs *ctx)
{
	__sync_fetch_and_add(&run_cnt, 1);
	return 0;
}

char _license[] SEC("license") = "GPL";