FreeBSD/lib/libpmc/libpmc.c
/*
 * Match an event name against all the event named supported by a
 * PMC class.
 *
 * Returns an event descriptor pointer on match or NULL otherwise.
 */
Match an event name against all the event named supported by a
PMC class.

Returns an event descriptor pointer on match or NULL otherwise.
Match an event name against all the event named supported by a PMC class . Returns an event descriptor pointer on match or NULL otherwise .
static const struct pmc_event_descr *
pmc_match_event_class(const char *name,
    const struct pmc_class_descr *pcd)
{
	size_t n;
	const struct pmc_event_descr *ev;
	ev = pcd->pm_evc_event_table;
	for (n = 0; n < pcd->pm_evc_event_table_size; n++, ev++)
		if (pmc_match_event_name(name, ev->pm_ev_name))
			return (ev);
	return (NULL);
}
static const struct pmc_event_descr * pmc_match_event_class ( const char * name , const struct pmc_class_descr * pcd ) { size_t n ; const struct pmc_event_descr * ev ; ev = pcd -> pm_evc_event_table ; for ( n = 0 ; n < pcd -> pm_evc_event_table_size ; n ++ , ev ++ ) if ( pmc_match_event_name ( name , ev -> pm_ev_name ) ) return ( ev ) ; return ( NULL ) ; }
Match an event name against all the event named supported by a
 PMC class.
Match an event name against all the event named supported by a PMC class .