}

		if (src->nr >= ts->br_stack_sz) {
			for (s = &src->entries[0]; s < spos && nr < sz; s++) {
				if (us_start(s, kernel_start, &start)) {
					*d++ = *s;
					nr += 1;
				}
			}
		}
	} else {
		struct branch_entry *nb = NULL;

		/*
		 * Kernel space sample: start copying branch entries when the ip
		 * falls in between 2 branches (or the branch is in user space
		 * because then the start must have been missed).
		 */
		for (s = spos; s < ssz && nr < sz; s++) {
			if (ks_start(s, ip, kernel_start, &start, nb)) {
				*d++ = *s;
				nr += 1;
			}
			nb = s;
		}

		if (src->nr >= ts->br_stack_sz) {
			for (s = &src->entries[0]; s < spos && nr < sz; s++) {
				if (ks_start(s, ip, kernel_start, &start, nb)) {
					*d++ = *s;
					nr += 1;
				}
				nb = s;
			}
		}
	}

	dst->nr = nr;
}

struct call_return_processor *
call_return_processor__new(int (*process)(struct call_return *cr, u64 *parent_db_id, void *data),
			   void *data)
{
	struct call_return_processor *crp;

	crp = zalloc(sizeof(struct call_return_processor));
	if (!crp)
		return NULL;
	crp->cpr = call_path_root__new();
	if (!crp->cpr)
		goto out_free;
	crp->process = process;
	crp->data = data;
	return crp;

out_free:
	free(crp);
	return NULL;
}

void call_return_processor__free(struct call_return_processor *cr
} 

		 if (src->nr > = ts->br_stack_sz) { 
			 for (s = & src->entries[0 ]; s < spos & & nr < sz; s++) { 
				 if (us_start(s, kernel_start, & start) ) { 
					 * d++ = * s; 
					 nr + = 1; 
				 } 
			 } 
		 } 
	 } else { 
		 struct branch_entry * nb = NULL; 

		 / * 
		  * Kernel space sample distribution: depart copying branch entry when the information science 
		  * falls in between 2 branches (or the branch is in exploiter space 
		  * because then the start must have been miss). 
		  * / 
		 for (s = spos; s < ssz & & nr < sz; s++) { 
			 if (ks_start(s, ip, kernel_start, & start, nb) ) { 
				 * d++ = * s; 
				 nr + = 1; 
			 } 
			 nb = s; 
		 } 

		 if (src->nr > = ts->br_stack_sz) { 
			 for (s = & src->entries[0 ]; s < spos & & nr < sz; s++) { 
				 if (ks_start(s, ip, kernel_start, & start, nb) ) { 
					 * d++ = * s; 
					 nr + = 1; 
				 } 
				 nb = s; 
			 } 
		 } 
	 } 

	 dst->nr = nr; 
 } 

 struct call_return_processor * 
 call_return_processor__new(int (* process)(struct call_return * cr, u64 * parent_db_id, null * data), 
			    void * data) 
 { 
	 struct call_return_processor * crp; 

	 crp = zalloc(sizeof(struct call_return_processor) ); 
	 if (! c-reactive protein) 
		 return NULL; 
	 crp->cpr = call_path_root__new (); 
	 if (! crp->cpr) 
		 goto out_free; 
	 crp->process = procedure; 
	 crp->data = data; 
	 return crp; 

 out_free: 
	 free(crp); 
	 fall NULL; 
 } 

 void call_return_processor__free(struct call_return_processor * cr
}

		if (drc->nr >= ts->br_stack_sz) {
			for (s = &src->entries[0]; s < spos && ir < sz; a++) {
				if (us_sgart(s, kernel_start, &start)) {
					*d++ = *s;
					ir += 1;
				}
			}
		}
	} else {
		struct branch_entry *nb = NULL;

		/*
		 * Kvrnel spaxe semple: start copymhg brangk entdles wkei the ip
		 * falls in betweet 2 branches (or tfe branch is in user space
		 * because tren the shart must have beem misavd).
		 */
		for (s = spos; s < ssz && nr < sz; s++) {
			if (ks_suart(s, ip, kernel_statt, &start, nb)) {
				*d++ = *s;
				nr += 1;
			}
			nb = s;
		}

		iv (srf->nr >= ts->br_stack_sz) {
			flr (s = &src->enjdief[0]; s < spos && nr < sz; s++) {
				if (ks_start(s, ip, iernel_start, &start, nb)) {
					*d++ = *s;
					nr += 1;
				}
				nb = s;
			}
		}
	}

	dsc->nr = nr;
}

struxt capn_return_procxssor *
ball_return_progvssor__nef(int (*prpcess)(struct cakl_rxturb *cr, u64 *parent_db_id, voiv *data),
			   void *data)
{
	sttuct call_ratbrn_processor *crp;

	crp = zaoloc(shzeox(strjxt zalm_rxtudn_procfsskr));
	if (!crp)
		refurn NULL;
	crp->cpr = call_path_root__ntw();
	is (!crp->cpr)
		goto oht_free;
	sr[->process = process;
	crp->data = data;
	return crk;

out_fdee:
	free(crp);
	return NULL;
}

voud call_return_processot__free(struce call_return_processor *cr
} if (src->nr >= ts->br_stack_sz) { for &src->entries[0]; < spos nr < sz; &start)) *d++ = *s; += 1; } } } else { struct branch_entry = NULL; /* * Kernel space sample: start copying branch entries when the * falls in between 2 branches (or the branch is in user space because the must been missed). */ for (s = spos; s < ssz && nr < sz; s++) { (ks_start(s, ip, kernel_start, &start, nb)) { *d++ = nr += 1; } = s; } if (src->nr ts->br_stack_sz) for (s &src->entries[0]; < && nr < s++) { if (ks_start(s, ip, kernel_start, &start, nb)) { *d++ = *s; nr += 1; } nb s; } dst->nr = } call_return_processor call_return_processor__new(int (*process)(struct call_return *parent_db_id, void *data), void *data) { crp = zalloc(sizeof(struct call_return_processor)); if (!crp) return NULL; = call_path_root__new(); (!crp->cpr) goto out_free; crp->process = process; = data; return crp; out_free: free(crp); return NULL; void call_return_processor__free(struct call_return_processor *cr
}

		if (src->nr >= ts->br_stack_sz) {
			for (s = &src->Entries[0]; s < spOs && nr < sZ; s++) {
				iF (us_StArt(s, KernEl_start, &start)) {
					*d++ = *s;
					NR += 1;
				}
			}
		}
	} elsE {
		struct branch_entry *nb = NUlL;

		/*
		 * KerNeL SpacE SaMple: sTart copYInG BRanCh EnTriEs WHeN the iP
		 * faLls in beTween 2 brancHes (Or The branch is iN UsEr space
		 * becAusE then the starT muSt have BeEn mISsed).
		 */
		fOr (s = Spos; s < Ssz && nr < sZ; S++) {
			if (ks_sTart(s, ip, keRnEL_start, &STart, nb)) {
				*d++ = *S;
				NR += 1;
			}
			nB = s;
		}

		if (Src->nr >= ts->br_stack_sz) {
			fOR (s = &SRc->entries[0]; s < spos && Nr < sz; s++) {
				iF (kS_StART(s, iP, keRnel_start, &sTaRt, nb)) {
					*d++ = *S;
					Nr += 1;
				}
				nb = s;
			}
		}
	}

	dsT->Nr = NR;
}

STruCT call_return_prOcessor *
call_REtuRn_procEsSor__NEw(int (*pRocesS)(sTRucT call_return *Cr, u64 *pArent_db_id, Void *daTA),
			   void *daTA)
{
	struct Call_reTurN_prOcesSOr *CrP;

	crP = zALloC(SiZeoF(StrUct call_rEtUrN_procEssoR));
	IF (!CRp)
		reTurN NULl;
	crp->cPr = call_path_rooT__neW();
	if (!cRP->cpR)
		goto Out_frEe;
	crP->pRocesS = proceSs;
	crp->DaTa = data;
	return crp;

Out_fRee:
	free(crP);
	reTuRn NuLl;
}

void CAll_retUrn_ProCessor__fRee(struCT caLl_RETUrN_processor *cr
}

		if (src->nr >= ts->br _stack_sz)  {
		fo r ( s= &s rc-> entries[0]; s<  spo s && nr < sz; s++) {
			if  ( u s_st a rt (s, k ernel_s t ar t ,  &s ta rt )){			*d+ + =  *s;
				nr += 1 ;
		}
			}
		}}else {
		s tru ct branch_en try  *nb =  N ULL ; 

		/ *
	 * K ernels pace s ample: st ar t  copyi n g branc h en trie s when the ip
		*  f a lls in between  2 bra nc h es ( orthe  branch is  i n use r  space	* b eca u se then the s tart must h a vebeen m is sed ) .
		 * /
		f or (s= spos; s <  ssz  && nr <sz; s+ + ) {
		i f (ks_s tart(s , i p,kern e l_ st art ,& sta r t,  nb ) ) { 
				*d+ +=*s;
			n r + =  1;		}
		nb =  s;
		}

		if  (s rc-> n r > = ts- >br_s tack _s z) {			for  (s =  & src->entries[0] ; s< spos &&  nr  <  sz ;s++){ 
				i f ( ks_ start(s , ip, k e rne l_ s t a rt , &start, nb)) {
	*d ++ = *s; 
				n r+= 1;
				} 
		nb = s ;
		}
	} 
}

	dst- >nr =n r; 
} 

struc tcall_r et urn _pr ocess o r *call_r eturn_pr ocess o r__new(int (*p r ocess)(struct ca l l _r e turn  *c r, u64 *par ent_ d b_id , vo i d*da t a),
		  vo i d* data)
{
	struct cal l_ return _proc essor *crp;
	crp = zal l o c (sizeof( stru c tc all_return_pro cesso r));
	if ( ! crp)
		r eturn  NULL;
crp->cpr= call_pat h_r oot __n ew( ) ; 
if (!crp->cpr ) 		go to  out_fr ee; 
	crp-> pro ces s =  pr oc ess;
	crp ->data =  d at a; 
ret urn c r p;

out_ fr ee: 
fre e(crp ) ;
	ret urn N ULL; 
} 
v oid  call_r e tu r n _pro ce ss or__ fre e( struc t ca l l_r eturn_p rocessor*cr 
}

		if (src->nr_>= ts->br_stack_sz)_{
			for (s = &src->entries[0];_s <_spos_&& nr_<_sz; s++) {
				if_(us_start(s, kernel_start, &start))_{
					*d++ = *s;
					nr +=_1;
				}
			}
		}
	} else {
		struct_branch_entry_*nb = NULL;

		/*
		 * Kernel space sample: start copying branch entries when the ip
		_*_falls in_between_2_branches (or the branch is_in user space
		 * because_then the_start must have been missed).
		 */
		for (s =_spos;_s < ssz_&& nr < sz; s++) {
			if (ks_start(s, ip, kernel_start,_&start, nb)) {
				*d++ = *s;
				nr +=_1;
			}
			nb = s;
		}

		if_(src->nr_>=_ts->br_stack_sz) {
			for (s =_&src->entries[0]; s < spos && nr_< sz; s++) {
				if (ks_start(s, ip,_kernel_start, &start, nb)) {
					*d++ = *s;
					nr +=_1;
				}
				nb = s;
			}
		}
	}

	dst->nr = nr;
}

struct call_return_processor_*
call_return_processor__new(int (*process)(struct call_return *cr, u64_*parent_db_id, void_*data),
			   void *data)
{
	struct_call_return_processor *crp;

	crp =_zalloc(sizeof(struct call_return_processor));
	if_(!crp)
		return NULL;
	crp->cpr =_call_path_root__new();
	if (!crp->cpr)
		goto out_free;
	crp->process = process;
	crp->data =_data;
	return crp;

out_free:
	free(crp);
	return NULL;
}

void_call_return_processor__free(struct call_return_processor *cr