FreeBSD/sys/dev/hwpmc/hwpmc_mod.c
/*
 * find an owner descriptor corresponding to proc 'p'
 */
find an owner descriptor corresponding to proc 'p'
find an owner descriptor corresponding to proc ' p '
static struct pmc_owner *
pmc_find_owner_descriptor(struct proc *p)
{
	uint32_t hindex;
	struct pmc_owner *po;
	struct pmc_ownerhash *poh;
	hindex = PMC_HASH_PTR(p, pmc_ownerhashmask);
	poh = &pmc_ownerhash[hindex];
	po = NULL;
	LIST_FOREACH(po, poh, po_next)
	    if (po->po_owner == p)
		    break;
	PMCDBG5(OWN,FND,1, "find-owner proc=%p (%d, %s) hindex=0x%x -> "
	    "pmc-owner=%p", p, p->p_pid, p->p_comm, hindex, po);
	return po;
}
static struct pmc_owner * pmc_find_owner_descriptor ( struct proc * p ) { uint32_t hindex ; struct pmc_owner * po ; struct pmc_ownerhash * poh ; hindex = PMC_HASH_PTR ( p , pmc_ownerhashmask ) ; poh = & pmc_ownerhash [ hindex ] ; po = NULL ; LIST_FOREACH ( po , poh , po_next ) if ( po -> po_owner == p ) break ; PMCDBG5 ( OWN , FND , 1 , " " " " , p , p -> p_pid , p -> p_comm , hindex , po ) ; return po ; }
find an owner descriptor corresponding to proc 'p'
find an owner descriptor corresponding to proc ' p '