/* Return 1 if we might be able to put event on a limited PMC, or 0 if not. A event can only go on a limited PMC if it counts something that a limited PMC can count, doesn't require interrupts, and doesn't exclude any processor mode.  */
static int can_go_on_limited_pmc(struct perf_event *event, u64 ev, unsigned int flags)
/* Return 1 if we might be able to put event on a limited PMC, or 0 if not. A event can only go on a limited PMC if it counts something that a limited PMC can count, doesn't require interrupts, and doesn't exclude any processor mode.  */
static int can_go_on_limited_pmc(struct perf_event *event, u64 ev, unsigned int flags)
{
	int n;
	u64 alt[MAX_EVENT_ALTERNATIVES];
	if (event->attr.exclude_user
	    || event->attr.exclude_kernel
	    || event->attr.exclude_hv
	    || event->attr.sample_period)
		return 0;
	if (ppmu->limited_pmc_event(ev))
		return 1;
	if (!ppmu->get_alternatives)
		return 0;
	flags |= PPMU_LIMITED_PMC_OK | PPMU_LIMITED_PMC_REQD;
	n = ppmu->get_alternatives(ev, flags, alt);
	return n > 0;
}