mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 01:43:18 +00:00
Adds test for libbpf APIs that toggle bpf program auto-attaching. Signed-off-by: Hao Luo <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
24 lines
352 B
C
24 lines
352 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2022 Google */
|
|
|
|
#include "vmlinux.h"
|
|
#include <bpf/bpf_tracing.h>
|
|
|
|
bool prog1_called = false;
|
|
bool prog2_called = false;
|
|
|
|
SEC("raw_tp/sys_enter")
|
|
int prog1(const void *ctx)
|
|
{
|
|
prog1_called = true;
|
|
return 0;
|
|
}
|
|
|
|
SEC("raw_tp/sys_exit")
|
|
int prog2(const void *ctx)
|
|
{
|
|
prog2_called = true;
|
|
return 0;
|
|
}
|
|
|