summaryrefslogtreecommitdiff
path: root/tools/perf/util/bpf_skel/bench_uprobe.bpf.c
blob: 2c55896bb33c31169ca9d668ade29c0f4802370b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
// Copyright (c) 2023 Red Hat
#include "vmlinux.h"
#include <bpf/bpf_tracing.h>

unsigned int nr_uprobes;

SEC("uprobe")
int BPF_UPROBE(empty)
{
       return 0;
}

SEC("uprobe")
int BPF_UPROBE(trace_printk)
{
	char fmt[] = "perf bench uprobe %u";

	bpf_trace_printk(fmt, sizeof(fmt), ++nr_uprobes);
	return 0;
}

char LICENSE[] SEC("license") = "Dual BSD/GPL";