tools/perf/util/parse-events.l
Source file repositories/reference/linux-study-clean/tools/perf/util/parse-events.l
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/parse-events.l- Extension
.l- Size
- 11057 bytes
- Lines
- 373
- 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
errno.hstdlib.hstdio.hparse-events.hparse-events-bison.h
Detected Declarations
function get_columnfunction valuefunction strfunction quoted_strfunction drv_strfunction termfunction modifiers_errorfunction modifiers
Annotated Snippet
if (mod.field) { \
modifiers_error(parse_state, scanner, i, c, #field); \
return PE_ERROR; \
} \
mod.field = true; \
break
switch (text[i]) {
CASE('u', user);
CASE('k', kernel);
CASE('h', hypervisor);
CASE('I', non_idle);
CASE('G', guest);
CASE('H', host);
case 'p':
mod.precise++;
/*
* precise ip:
*
* 0 - SAMPLE_IP can have arbitrary skid
* 1 - SAMPLE_IP must have constant skid
* 2 - SAMPLE_IP requested to have 0 skid
* 3 - SAMPLE_IP must have 0 skid
*
* See also PERF_RECORD_MISC_EXACT_IP
*/
if (mod.precise > 3) {
struct parse_events_error *error = parse_state->error;
char *help = strdup("Maximum precise value is 3");
if (help) {
parse_events_error__handle(error, get_column(scanner) + i,
help , NULL);
}
return PE_ERROR;
}
break;
CASE('P', precise_max);
CASE('S', sample_read);
CASE('D', pinned);
CASE('W', weak);
CASE('e', exclusive);
CASE('b', bpf);
CASE('R', retire_lat);
CASE('X', dont_regroup);
default:
return PE_ERROR;
}
#undef CASE
}
yylval->mod = mod;
return PE_MODIFIER_EVENT;
}
#define YY_USER_ACTION \
do { \
yylloc->last_column = yylloc->first_column; \
yylloc->first_column = yycolumn; \
yycolumn += yyleng; \
} while (0);
%}
%x mem
%s config
%x event
group [^,{}/]*[{][^}]*[}][^,{}/]*
event_pmu [^,{}/]+[/][^/]*[/][^,{}/]*
event [^,{}/]+
Annotation
- Immediate include surface: `errno.h`, `stdlib.h`, `stdio.h`, `parse-events.h`, `parse-events-bison.h`.
- Detected declarations: `function get_column`, `function value`, `function str`, `function quoted_str`, `function drv_str`, `function term`, `function modifiers_error`, `function modifiers`.
- 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.