Home | History | Annotate | Download | only in callgrind

Lines Matching refs:bbcc

259  * Print function position of the BBCC, but only print info differing to
263 static Bool print_fn_pos(VgFile *fp, FnPos* last, BBCC* bbcc)
267 CLG_ASSERT(bbcc && bbcc->cxt);
271 CLG_(print_cxt)(16, bbcc->cxt, bbcc->rec_index);
275 if (last->rec_index != bbcc->rec_index) {
276 VG_(fprintf)(fp, "rec=%u\n\n", bbcc->rec_index);
277 last->rec_index = bbcc->rec_index;
282 if (last->cxt != bbcc->cxt) {
285 fn_node* curr_from = (bbcc->cxt->size >1) ?
286 bbcc->cxt->fn[1] : 0;
298 last->cxt = bbcc->cxt;
302 if (last->obj != bbcc->cxt->fn[0]->file->obj) {
303 print_obj(fp, "ob=", bbcc->cxt->fn[0]->file->obj);
304 last->obj = bbcc->cxt->fn[0]->file->obj;
308 if (last->file != bbcc->cxt->fn[0]->file) {
309 print_file(fp, "fl=", bbcc->cxt->fn[0]->file);
310 last->file = bbcc->cxt->fn[0]->file;
315 if (last->fn != bbcc->cxt->fn[0]) {
316 print_fn(fp, "fn", bbcc->cxt->fn[0]);
317 last->fn = bbcc->cxt->fn[0];
323 if ((last->rec_index != bbcc->rec_index) ||
324 (last->cxt != bbcc->cxt)) {
326 print_mangled_fn(fp, "fn", bbcc->cxt, bbcc->rec_index);
327 last->fn = bbcc->cxt->fn[0];
328 last->rec_index = bbcc->rec_index;
333 last->cxt = bbcc->cxt;
340 /* the debug lookup cache is useful if BBCC for same BB are
363 Bool get_debug_pos(BBCC* bbcc, Addr addr, AddrPos* p)
384 p->file = CLG_(get_file_node)(bbcc->bb->obj, dir, file);
392 /* Address offset from bbcc start address */
393 p->addr = addr - bbcc->bb->obj->offset;
394 p->bb_addr = bbcc->bb->offset;
397 addr, bb_addr(bbcc->bb), bbcc->cxt->fn[0]->name,
675 * Print all costs of a BBCC:
680 static Bool fprint_bbcc(VgFile *fp, BBCC* bbcc, AddrPos* last)
688 BB* bb = bbcc->bb;
690 CLG_ASSERT(bbcc->cxt != 0);
693 CLG_(print_bbcc)(15, bbcc);
700 ecounter = bbcc->ecounter_sum;
708 if (!get_debug_pos(bbcc, bb_addr(bb) + instr_info->instr_offset,
711 newCost->p.file = bbcc->cxt->fn[0]->file;
721 fprint_apos(fp, &(currCost->p), last, bbcc->cxt->fn[0]->file);
732 (*CLG_(cachesim).add_icost)(currCost->cost, bbcc, instr_info, ecounter);
737 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from)
745 fprint_apos(fp, &(currCost->p), last, bbcc->cxt->fn[0]->file);
748 get_debug_pos(bbcc, bb_addr(bb)+instr_info->instr_offset, &(currCost->p));
749 fprint_apos(fp, &(currCost->p), last, bbcc->cxt->fn[0]->file);
751 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from) {
762 ecounter -= bbcc->jmp[jmp].ecounter;
769 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from) {
776 if ( (bbcc->skipped &&
777 !CLG_(is_zero_cost)(CLG_(sets).full, bbcc->skipped)) ||
782 fprint_apos(fp, &(currCost->p), last, bbcc->cxt->fn[0]->file);
786 get_debug_pos(bbcc, bb_jmpaddr(bb), &(currCost->p));
787 fprint_apos(fp, &(currCost->p), last, bbcc->cxt->fn[0]->file);
791 if (bbcc->skipped && !CLG_(is_zero_cost)( CLG_(sets).full,
792 bbcc->skipped )) {
794 currCost->cost, bbcc->skipped );
802 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from) {
815 fprint_apos(fp, &(currCost->p), last, bbcc->cxt->fn[0]->file);
821 * as this function is only called when there's cost in a BBCC
826 bbcc->ecounter_sum = 0;
827 for(i=0; i<=bbcc->bb->cjmp_count; i++)
828 bbcc->jmp[i].ecounter = 0;
829 bbcc->ret_counter = 0;
842 static int my_cmp(BBCC** pbbcc1, BBCC** pbbcc2)
847 BBCC *bbcc1 = *pbbcc1;
848 BBCC *bbcc2 = *pbbcc2;
893 void swap(BBCC** a, BBCC** b)
895 BBCC* t;
902 BBCC** med3(BBCC **a, BBCC **b, BBCC **c, int (*cmp)(BBCC**,BBCC**))
908 static BBCC** qsort_start = 0;
910 static void CLG_(qsort)(BBCC **a, int n, int (*cmp)(BBCC**,BBCC**))
912 BBCC **pa, **pb, **pc, **pd, **pl, **pm, **pn, **pv;
914 BBCC* v;
1016 static BBCC** prepare_ptr;
1019 static void hash_addCount(BBCC* bbcc)
1021 if ((bbcc->ecounter_sum > 0) || (bbcc->ret_counter>0))
1025 static void hash_addPtr(BBCC* bbcc)
1027 if ((bbcc->ecounter_sum == 0) &&
1028 (bbcc->ret_counter == 0)) return;
1030 *prepare_ptr = bbcc;
1038 BBCC* bbcc;
1050 bbcc = e->jcc->from;
1053 i,CLG_(current_tid),bbcc->cxt->fn[0]->name);
1055 if (bbcc->ecounter_sum>0 || bbcc->ret_counter>0) {
1066 BBCC* bbcc;
1076 bbcc = e->jcc->from;
1078 if (bbcc->ecounter_sum>0 || bbcc->ret_counter>0) {
1083 *prepare_ptr = bbcc;
1095 BBCC** prepare_dump(void)
1097 BBCC **array;
1114 /* allocate bbcc array, insert BBCCs and sort */
1116 (BBCC**) CLG_MALLOC("cl.dump.pd.1",
1117 (prepare_count+1) * sizeof(BBCC*));
1371 BBCC **p, **array;
1458 /* All BBCC/JCC costs is stored for thread 1 */