f36d3557a1
Add tests utilizing low-level bpf_link_create() API to create perf BPF link. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20210815070609.987780-13-andrii@kernel.org
17 lines
311 B
C
17 lines
311 B
C
// 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";
|