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

uintptr_t ip;

SEC("perf_event")
int handler(struct bpf_perf_event_data *data)
{
	/* Skip events that have the correct ip. */
	return ip != PT_REGS_IP(&data->regs);
}

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