mirror of
https://github.com/torvalds/linux.git
synced 2026-09-27 02:22:02 +02:00
Test cases for veristat file/prog name filtering logic. Check various formulations for any (*foo*), file (*foo*/), prog (/bar) and file/prog (*foo*/bar) filters, alongside erroneous filters and mixed allow/deny filter expressions. Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20260811-veristat-filter-fix-v2-2-6c234c4cd6ef@gmail.com
32 lines
612 B
C
32 lines
612 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
|
|
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
/*
|
|
* Programs below exist only to exercise veristat's -f name filters,
|
|
* their bodies are irrelevant, only the names matter.
|
|
* This file is also included by veristat_bar.c, so that the same set of
|
|
* program names is available in two differently named object files.
|
|
*/
|
|
|
|
SEC("socket")
|
|
int foo(void *ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
SEC("socket")
|
|
int bar(void *ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
SEC("socket")
|
|
int buz(void *ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
char _license[] SEC("license") = "GPL";
|