| 261 | |
| 262 | #ifdef GUPROF |
| 263 | void |
| 264 | mexitcount(uintfptr_t selfpc) |
| 265 | { |
| 266 | struct gmonparam *p; |
| 267 | uintfptr_t selfpcdiff; |
| 268 | |
| 269 | p = &_gmonparam; |
| 270 | #ifdef MCOUNT_DETRAMP |
| 271 | MCOUNT_DETRAMP(selfpc); |
| 272 | #endif |
| 273 | selfpcdiff = selfpc - (uintfptr_t)p->lowpc; |
| 274 | if (selfpcdiff < p->textsize) { |
| 275 | int delta; |
| 276 | |
| 277 | /* |
| 278 | * Count the time since cputime() was previously called |
| 279 | * against `selfpc'. Compensate for overheads. |
| 280 | */ |
| 281 | delta = cputime() - cputime_bias - p->mexitcount_pre_overhead; |
| 282 | cputime_bias = p->mexitcount_post_overhead; |
| 283 | KCOUNT(p, selfpcdiff) += delta; |
| 284 | *p->cputime_count += p->cputime_overhead; |
| 285 | *p->mexitcount_count += p->mexitcount_overhead; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | #ifndef __GNUCLIKE_ASM |
| 290 | #error "This file uses null asms to prevent timing loops being optimized away." |