Skip to content
Commit 588730fc authored by Robin Murphy's avatar Robin Murphy
Browse files

perf: Garbage-collect event_init checks



All these boilerplate event_init checks are now redundant. Of course
many of them were already redundant, or done in the wrong order so as to
be pointless, and what we don't see here is all the ones which were
missing, but have now been implicitly gained thanks to some of these new
core code behaviours. In summary:

- event->attr.type
	Now only relevant to PERF_TYPE_RAW PMUs or those advertising
	PERF_PMU_CAP_RAW_EVENTS.

- event->cpu < 0
	Already rejected by perf_event_alloc() unless a task is passed,
	wherein that will also set PERF_ATTACH_TASK prior to reaching
	perf_init_event(), so is always redundant with...

- PERF_ATTACH_TASK
	Since at least commit bd275681 ("perf: Rewrite core context
	handling"), only relevant to PMUs using perf_hw_context or
	perf_sw_context; for uncore PMUs this is covered by
	perf_event_alloc() again, right after perf_init_event() returns,
	by virtue of the same non-NULL task which caused attach_state to
	be set in the first place.

- is_sampling_event() (and variations)
	Now only relevant to PMUs advertising PERF_PMU_CAP_SAMPLING.

- has_branch_stack()
	Now doubly-illogical for PMUs which never supported sampling
	anyway.

Signed-off-by: Robin Murphy's avatarRobin Murphy <robin.murphy@arm.com>
parent 2584846b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment