Lines Matching +full:- +full:p
1 // SPDX-License-Identifier: (BSD-2-Clause AND BSD-3-Clause)
34 *-
115 static uint32_t _gprof_file_id; /* File id returned by tee-supplicant */
123 return pc - (unsigned long)__text_start + sizeof(struct ta_head); in adjust_pc()
130 struct gmonparam *p = &_gmonparam; in __utee_gprof_init() local
145 p->lowpc = ROUNDDOWN(lowpc, HISTFRACTION * sizeof(HISTCOUNTER)); in __utee_gprof_init()
146 p->highpc = ROUNDUP(highpc, HISTFRACTION * sizeof(HISTCOUNTER)); in __utee_gprof_init()
147 p->textsize = p->highpc - p->lowpc; in __utee_gprof_init()
148 p->kcountsize = ROUNDUP(p->textsize / HISTFRACTION, sizeof(*p->froms)); in __utee_gprof_init()
149 p->hashfraction = HASHFRACTION; in __utee_gprof_init()
150 p->log_hashfraction = -1; in __utee_gprof_init()
155 if ((HASHFRACTION & (HASHFRACTION - 1)) == 0) { in __utee_gprof_init()
160 p->log_hashfraction = __builtin_ffs(p->hashfraction * in __utee_gprof_init()
161 sizeof(*p->froms)) - 1; in __utee_gprof_init()
163 p->fromssize = p->textsize / HASHFRACTION; in __utee_gprof_init()
164 p->tolimit = p->textsize * ARCDENSITY / 100; in __utee_gprof_init()
165 if (p->tolimit < MINARCS) in __utee_gprof_init()
166 p->tolimit = MINARCS; in __utee_gprof_init()
167 else if (p->tolimit > MAXARCS) in __utee_gprof_init()
168 p->tolimit = MAXARCS; in __utee_gprof_init()
169 p->tossize = p->tolimit * sizeof(struct tostruct); in __utee_gprof_init()
171 bufsize = p->kcountsize + p->fromssize + p->tossize; in __utee_gprof_init()
175 __text_end - __text_start, bufsize); in __utee_gprof_init()
180 p->tos = NULL; in __utee_gprof_init()
181 p->state = GMON_PROF_ERROR; in __utee_gprof_init()
185 p->tos = (struct tostruct *)cp; in __utee_gprof_init()
186 cp += p->tossize; in __utee_gprof_init()
187 p->kcount = (HISTCOUNTER *)cp; in __utee_gprof_init()
188 cp += p->kcountsize; in __utee_gprof_init()
189 p->froms = (ARCINDEX *)cp; in __utee_gprof_init()
191 p->tos[0].link = 0; in __utee_gprof_init()
193 if (p->kcountsize < p->textsize) in __utee_gprof_init()
194 _gprof_s_scale = ((float)p->kcountsize / p->textsize) * in __utee_gprof_init()
199 res = __pta_gprof_pc_sampling_start(p->kcount, p->kcountsize, in __utee_gprof_init()
200 p->lowpc + in __utee_gprof_init()
201 ((unsigned long)__text_start - in __utee_gprof_init()
207 p->state = GMON_PROF_ON; in __utee_gprof_init()
335 struct gmonparam *p; in __mcount_internal() local
339 p = &_gmonparam; in __mcount_internal()
344 if (p->state != GMON_PROF_ON) in __mcount_internal()
346 p->state = GMON_PROF_BUSY; in __mcount_internal()
352 frompc -= p->lowpc; in __mcount_internal()
353 if (frompc > p->textsize) in __mcount_internal()
357 if ((HASHFRACTION & (HASHFRACTION - 1)) == 0) { in __mcount_internal()
359 i = frompc >> p->log_hashfraction; in __mcount_internal()
361 i = frompc / (p->hashfraction * sizeof(*p->froms)); in __mcount_internal()
363 frompcindex = &p->froms[i]; in __mcount_internal()
367 toindex = ++p->tos[0].link; in __mcount_internal()
368 if (toindex >= p->tolimit) { in __mcount_internal()
374 top = &p->tos[toindex]; in __mcount_internal()
375 top->selfpc = selfpc; in __mcount_internal()
376 top->count = 1; in __mcount_internal()
377 top->link = 0; in __mcount_internal()
380 top = &p->tos[toindex]; in __mcount_internal()
381 if (top->selfpc == selfpc) { in __mcount_internal()
383 top->count++; in __mcount_internal()
393 if (top->link == 0) { in __mcount_internal()
396 * had top->selfpc == selfpc. in __mcount_internal()
400 toindex = ++p->tos[0].link; in __mcount_internal()
401 if (toindex >= p->tolimit) in __mcount_internal()
404 top = &p->tos[toindex]; in __mcount_internal()
405 top->selfpc = selfpc; in __mcount_internal()
406 top->count = 1; in __mcount_internal()
407 top->link = *frompcindex; in __mcount_internal()
415 top = &p->tos[top->link]; in __mcount_internal()
416 if (top->selfpc == selfpc) { in __mcount_internal()
421 top->count++; in __mcount_internal()
422 toindex = prevtop->link; in __mcount_internal()
423 prevtop->link = top->link; in __mcount_internal()
424 top->link = *frompcindex; in __mcount_internal()
430 p->state = GMON_PROF_ON; in __mcount_internal()
433 p->state = GMON_PROF_ERROR; in __mcount_internal()