tools/perf/util/pmu.y
Source file repositories/reference/linux-study-clean/tools/perf/util/pmu.y
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/pmu.y- Extension
.y- Size
- 1515 bytes
- Lines
- 102
- 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.
Dependency Surface
linux/compiler.hlinux/list.hlinux/bitmap.hstring.hpmu.hpmu-bison.h
Detected Declarations
function perf_pmu__set_formatfunction perf_pmu_error
Annotated Snippet
%define api.pure full
%parse-param {void *format}
%parse-param {void *scanner}
%lex-param {void* scanner}
%{
#ifndef NDEBUG
#define YYDEBUG 1
#endif
#include <linux/compiler.h>
#include <linux/list.h>
#include <linux/bitmap.h>
#include <string.h>
#include "pmu.h"
#include "pmu-bison.h"
int perf_pmu_lex(YYSTYPE * yylval_param , void *yyscanner);
#define ABORT_ON(val) \
do { \
if (val) \
YYABORT; \
} while (0)
static void perf_pmu_error(void *format, void *scanner, const char *msg);
static void perf_pmu__set_format(unsigned long *bits, long from, long to)
{
long b;
if (!to)
to = from;
memset(bits, 0, BITS_TO_BYTES(PERF_PMU_FORMAT_BITS));
for (b = from; b <= to; b++)
__set_bit(b, bits);
}
%}
%token PP_CONFIG
%token PP_VALUE PP_ERROR
%type <num> PP_VALUE
%type <bits> bit_term
%type <bits> bits
%union
{
unsigned long num;
DECLARE_BITMAP(bits, PERF_PMU_FORMAT_BITS);
}
%%
format:
format format_term
|
format_term
format_term:
PP_CONFIG ':' bits
{
perf_pmu_format__set_value(format, PERF_PMU_FORMAT_VALUE_CONFIG, $3);
}
|
PP_CONFIG PP_VALUE ':' bits
{
perf_pmu_format__set_value(format, $2, $4);
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/list.h`, `linux/bitmap.h`, `string.h`, `pmu.h`, `pmu-bison.h`.
- Detected declarations: `function perf_pmu__set_format`, `function perf_pmu_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.