tools/perf/util/bpf-filter.y
Source file repositories/reference/linux-study-clean/tools/perf/util/bpf-filter.y
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/bpf-filter.y- Extension
.y- Size
- 2005 bytes
- Lines
- 110
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hstring.hlinux/compiler.hlinux/list.hbpf-filter.hcgroup.h
Detected Declarations
function perf_bpf_filter_error
Annotated Snippet
%parse-param {struct list_head *expr_head}
%define parse.error verbose
%{
#ifndef NDEBUG
#define YYDEBUG 1
#endif
#include <stdio.h>
#include <string.h>
#include <linux/compiler.h>
#include <linux/list.h>
#include "bpf-filter.h"
#include "cgroup.h"
int perf_bpf_filter_lex(void);
/* To indicate if the current term needs a pathname or not */
int perf_bpf_filter_needs_path;
static void perf_bpf_filter_error(struct list_head *expr __maybe_unused,
char const *msg)
{
printf("perf_bpf_filter: %s\n", msg);
}
%}
%union
{
unsigned long num;
char *path;
struct {
enum perf_bpf_filter_term term;
int part;
} sample;
enum perf_bpf_filter_op op;
struct perf_bpf_filter_expr *expr;
}
%token BFT_SAMPLE BFT_SAMPLE_PATH BFT_OP BFT_ERROR BFT_NUM BFT_LOGICAL_OR BFT_PATH
%type <expr> filter_term filter_expr
%destructor { free ($$); } <expr>
%type <sample> BFT_SAMPLE BFT_SAMPLE_PATH
%type <op> BFT_OP
%type <num> BFT_NUM
%type <path> BFT_PATH
%%
filter:
filter ',' filter_term
{
list_add_tail(&$3->list, expr_head);
}
|
filter_term
{
list_add_tail(&$1->list, expr_head);
}
filter_term:
filter_term BFT_LOGICAL_OR filter_expr
{
struct perf_bpf_filter_expr *expr;
if ($1->op == PBF_OP_GROUP_BEGIN) {
expr = $1;
} else {
Annotation
- Immediate include surface: `stdio.h`, `string.h`, `linux/compiler.h`, `linux/list.h`, `bpf-filter.h`, `cgroup.h`.
- Detected declarations: `function perf_bpf_filter_error`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.