Lines Matching refs:api

230    APInfo* api   = NULL;  in intro_Block()  local
236 api = (APInfo*)valW; in intro_Block()
239 api = VG_(malloc)( "dh.main.intro_Block.1", sizeof(APInfo) ); in intro_Block()
240 VG_(memset)(api, 0, sizeof(*api)); in intro_Block()
241 api->ap = bk->ap; in intro_Block()
243 (UWord)bk->ap, (UWord)api ); in intro_Block()
246 tl_assert(api->deaths == 0); in intro_Block()
247 api->xsize_tag = Unknown; in intro_Block()
248 api->xsize = 0; in intro_Block()
249 if (0) VG_(printf)("api %p --> Unknown\n", api); in intro_Block()
252 tl_assert(api->ap == bk->ap); in intro_Block()
257 api->cur_blocks_live++; in intro_Block()
260 api->cur_bytes_live += bk->req_szB; in intro_Block()
261 if (api->cur_bytes_live > api->max_bytes_live) { in intro_Block()
262 api->max_bytes_live = api->cur_bytes_live; in intro_Block()
263 api->max_blocks_live = api->cur_blocks_live; in intro_Block()
267 api->tot_blocks++; in intro_Block()
268 api->tot_bytes += bk->req_szB; in intro_Block()
296 APInfo* api = NULL; in retire_Block() local
303 api = (APInfo*)valW; in retire_Block()
304 tl_assert(api->ap == bk->ap); in retire_Block()
309 bk->ap, api->cur_bytes_live, (ULong)bk->req_szB); in retire_Block()
313 tl_assert(api->cur_blocks_live >= 1); in retire_Block()
314 tl_assert(api->cur_bytes_live >= bk->req_szB); in retire_Block()
315 api->cur_blocks_live--; in retire_Block()
316 api->cur_bytes_live -= bk->req_szB; in retire_Block()
318 api->deaths++; in retire_Block()
321 api->death_ages_sum += (g_guest_instrs_executed - bk->allocd_at); in retire_Block()
331 api->n_reads += bk->n_reads; in retire_Block()
332 api->n_writes += bk->n_writes; in retire_Block()
335 switch (api->xsize_tag) { in retire_Block()
338 tl_assert(api->xsize == 0); in retire_Block()
339 tl_assert(api->deaths == 1 || api->deaths == 0); in retire_Block()
340 tl_assert(!api->histo); in retire_Block()
341 api->xsize_tag = Exactly; in retire_Block()
342 api->xsize = bk->req_szB; in retire_Block()
343 if (0) VG_(printf)("api %p --> Exactly(%lu)\n", api, api->xsize); in retire_Block()
346 api->histo = VG_(malloc)("dh.main.retire_Block.1", in retire_Block()
347 api->xsize * sizeof(UInt)); in retire_Block()
348 VG_(memset)(api->histo, 0, api->xsize * sizeof(UInt)); in retire_Block()
354 if (bk->req_szB != api->xsize) { in retire_Block()
356 api, api->xsize, bk->req_szB); in retire_Block()
357 api->xsize_tag = Mixed; in retire_Block()
358 api->xsize = 0; in retire_Block()
360 if (api->histo) { in retire_Block()
361 VG_(free)(api->histo); in retire_Block()
362 api->histo = NULL; in retire_Block()
377 if (api->xsize_tag == Exactly && api->histo && bk->histoW) { in retire_Block()
378 tl_assert(api->xsize == bk->req_szB); in retire_Block()
380 for (i = 0; i < api->xsize; i++) { in retire_Block()
383 if (api->histo[i] <= 0xFFFE0000) in retire_Block()
384 api->histo[i] += (UInt)bk->histoW[i]; in retire_Block()
386 if (0) VG_(printf)("fold in, AP = %p\n", api); in retire_Block()
408 APInfo* api = NULL; in apinfo_change_cur_bytes_live() local
415 api = (APInfo*)valW; in apinfo_change_cur_bytes_live()
416 tl_assert(api->ap == ec); in apinfo_change_cur_bytes_live()
419 tl_assert(api->cur_bytes_live >= -delta); in apinfo_change_cur_bytes_live()
424 api->cur_bytes_live += delta; in apinfo_change_cur_bytes_live()
427 if (delta > 0 && api->cur_bytes_live > api->max_bytes_live) { in apinfo_change_cur_bytes_live()
428 api->max_bytes_live = api->cur_bytes_live; in apinfo_change_cur_bytes_live()
429 api->max_blocks_live = api->cur_blocks_live; in apinfo_change_cur_bytes_live()
442 api->tot_bytes += delta; in apinfo_change_cur_bytes_live()
1094 static void show_APInfo ( APInfo* api ) in show_APInfo() argument
1098 if (api->tot_blocks > 0) { in show_APInfo()
1099 show_N_div_100( bufA, ((ULong)api->tot_bytes * 100ULL) in show_APInfo()
1100 / (ULong)api->tot_blocks ); in show_APInfo()
1106 api->max_bytes_live, api->max_blocks_live); in show_APInfo()
1108 api->tot_bytes, api->tot_blocks, bufA); in show_APInfo()
1110 tl_assert(api->tot_blocks >= api->max_blocks_live); in show_APInfo()
1111 tl_assert(api->tot_bytes >= api->max_bytes_live); in show_APInfo()
1113 if (api->deaths > 0) { in show_APInfo()
1115 ULong aad = api->deaths == 0 in show_APInfo()
1116 ? 0 : (api->death_ages_sum / api->deaths); in show_APInfo()
1127 api->deaths, aad, buf ); in show_APInfo()
1135 if (api->tot_bytes > 0) { in show_APInfo()
1136 show_N_div_100(bufR, (100ULL * api->n_reads) / api->tot_bytes); in show_APInfo()
1137 show_N_div_100(bufW, (100ULL * api->n_writes) / api->tot_bytes); in show_APInfo()
1146 api->n_reads, api->n_writes); in show_APInfo()
1148 VG_(pp_ExeContext)(api->ap); in show_APInfo()
1150 if (api->histo && api->xsize_tag == Exactly) { in show_APInfo()
1154 if (api->xsize > 0) in show_APInfo()
1156 for (i = 0; i < api->xsize; i++) { in show_APInfo()
1157 if (i > 0 && (i % 16) == 0 && i != api->xsize-1) { in show_APInfo()
1161 VG_(umsg)("%u ", api->histo[i]); in show_APInfo()
1169 static ULong get_metric__max_bytes_live ( APInfo* api ) { in get_metric__max_bytes_live() argument
1170 return api->max_bytes_live; in get_metric__max_bytes_live()
1172 static ULong get_metric__tot_bytes ( APInfo* api ) { in get_metric__tot_bytes() argument
1173 return api->tot_bytes; in get_metric__tot_bytes()
1175 static ULong get_metric__max_blocks_live ( APInfo* api ) { in get_metric__max_blocks_live() argument
1176 return api->max_blocks_live; in get_metric__max_blocks_live()
1229 APInfo* api = (APInfo*)valW; in show_top_n_apinfos() local
1230 tl_assert(api && api->ap == (ExeContext*)keyW); in show_top_n_apinfos()
1231 api->shown = False; in show_top_n_apinfos()
1243 APInfo* api = (APInfo*)valW; in show_top_n_apinfos() local
1244 if (api->shown) in show_top_n_apinfos()
1246 ULong metric = get_metric(api); in show_top_n_apinfos()
1249 best_api = api; in show_top_n_apinfos()