tools/perf/util/parse-events.y

Source file repositories/reference/linux-study-clean/tools/perf/util/parse-events.y

File Facts

System
Linux kernel
Corpus path
tools/perf/util/parse-events.y
Extension
.y
Size
12112 bytes
Lines
648
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct tracepoint_name {
		char *sys;
		char *event;
	} tracepoint_name;
}
%%

 /*
  * Entry points. We are either parsing events or terminals. Just terminal
  * parsing is used for parsing events in sysfs.
  */
start:
PE_START_EVENTS start_events
|
PE_START_TERMS  start_terms

start_events: groups
{
	/* Take the parsed events, groups.. and place into parse_state. */
	struct list_head *groups  = $1;
	struct parse_events_state *parse_state = _parse_state;

	list_splice_tail(groups, &parse_state->list);
	free(groups);
}

groups: /* A list of groups or events. */
groups ',' group
{
	/* Merge group into the list of events/groups. */
	struct list_head *groups  = $1;
	struct list_head *group  = $3;

	list_splice_tail(group, groups);
	free(group);
	$$ = groups;
}
|
groups ',' event
{
	/* Merge event into the list of events/groups. */
	struct list_head *groups  = $1;
	struct list_head *event = $3;


	list_splice_tail(event, groups);
	free(event);
	$$ = groups;
}
|
group
|
event

group:
group_def ':' PE_MODIFIER_EVENT
{
	/* Apply the modifier to the events in the group_def. */
	struct list_head *list = $1;
	int err;

	err = parse_events__modifier_group(_parse_state, &@3, list, $3);
	if (err)
		YYABORT;
	$$ = list;
}
|
group_def

group_def:

Annotation

Implementation Notes