Home | History | Annotate | Download | only in callgrind

Lines Matching defs:bbcc

331  * Print function position of the BBCC, but only print info differing to
335 static Bool print_fn_pos(int fd, FnPos* last, BBCC* bbcc)
339 CLG_ASSERT(bbcc && bbcc->cxt);
343 CLG_(print_cxt)(16, bbcc->cxt, bbcc->rec_index);
347 if (last->rec_index != bbcc->rec_index) {
348 VG_(sprintf)(outbuf, "rec=%d\n\n", bbcc->rec_index);
350 last->rec_index = bbcc->rec_index;
355 if (last->cxt != bbcc->cxt) {
358 fn_node* curr_from = (bbcc->cxt->size >1) ?
359 bbcc->cxt->fn[1] : 0;
372 last->cxt = bbcc->cxt;
376 if (last->obj != bbcc->cxt->fn[0]->file->obj) {
378 print_obj(outbuf+3, bbcc->cxt->fn[0]->file->obj);
380 last->obj = bbcc->cxt->fn[0]->file->obj;
384 if (last->file != bbcc->cxt->fn[0]->file) {
386 print_file(outbuf+3, bbcc->cxt->fn[0]->file);
388 last->file = bbcc->cxt->fn[0]->file;
393 if (last->fn != bbcc->cxt->fn[0]) {
394 print_fn(fd,outbuf, "fn", bbcc->cxt->fn[0]);
395 last->fn = bbcc->cxt->fn[0];
401 if ((last->rec_index != bbcc->rec_index) ||
402 (last->cxt != bbcc->cxt)) {
404 print_mangled_fn(fd, outbuf, "fn", bbcc->cxt, bbcc->rec_index);
405 last->fn = bbcc->cxt->fn[0];
406 last->rec_index = bbcc->rec_index;
411 last->cxt = bbcc->cxt;
418 /* the debug lookup cache is useful if BBCC for same BB are
441 Bool get_debug_pos(BBCC* bbcc, Addr addr, AddrPos* p)
471 p->file = CLG_(get_file_node)(bbcc->bb->obj, file);
479 /* Address offset from bbcc start address */
480 p->addr = addr - bbcc->bb->obj->offset;
481 p->bb_addr = bbcc->bb->offset;
484 addr, bb_addr(bbcc->bb), bbcc->cxt->fn[0]->name,
774 * Print all costs of a BBCC:
779 static Bool fprint_bbcc(Int fd, BBCC* bbcc, AddrPos* last)
787 BB* bb = bbcc->bb;
789 CLG_ASSERT(bbcc->cxt != 0);
792 CLG_(print_bbcc)(15, bbcc);
799 ecounter = bbcc->ecounter_sum;
807 if (!get_debug_pos(bbcc, bb_addr(bb) + instr_info->instr_offset,
810 newCost->p.file = bbcc->cxt->fn[0]->file;
820 fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
831 (*CLG_(cachesim).add_icost)(currCost->cost, bbcc, instr_info, ecounter);
836 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from)
844 fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
847 get_debug_pos(bbcc, bb_addr(bb)+instr_info->instr_offset, &(currCost->p));
848 fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
850 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from) {
861 ecounter -= bbcc->jmp[jmp].ecounter;
868 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from) {
875 if ( (bbcc->skipped &&
876 !CLG_(is_zero_cost)(CLG_(sets).full, bbcc->skipped)) ||
881 fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
885 get_debug_pos(bbcc, bb_jmpaddr(bb), &(currCost->p));
886 fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
890 if (bbcc->skipped && !CLG_(is_zero_cost)( CLG_(sets).full,
891 bbcc->skipped )) {
893 currCost->cost, bbcc->skipped );
902 for(jcc=bbcc->jmp[jmp].jcc_list; jcc; jcc=jcc->next_from) {
915 fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
921 * as this function is only called when there's cost in a BBCC
926 bbcc->ecounter_sum = 0;
927 for(i=0; i<=bbcc->bb->cjmp_count; i++)
928 bbcc->jmp[i].ecounter = 0;
929 bbcc->ret_counter = 0;
942 static int my_cmp(BBCC** pbbcc1, BBCC** pbbcc2)
947 BBCC *bbcc1 = *pbbcc1;
948 BBCC *bbcc2 = *pbbcc2;
993 void swapfunc(BBCC** a, BBCC** b, int n)
996 BBCC* t = *a; *a = *b; *b = t;
1003 void swap(BBCC** a, BBCC** b)
1005 BBCC* t;
1012 BBCC** med3(BBCC **a, BBCC **b, BBCC **c, int (*cmp)(BBCC**,BBCC**))
1018 static BBCC** qsort_start = 0;
1020 static void qsort(BBCC **a, int n, int (*cmp)(BBCC**,BBCC**))
1022 BBCC **pa, **pb, **pc, **pd, **pl, **pm, **pn, **pv;
1024 BBCC* v;
1126 static BBCC** prepare_ptr;
1129 static void hash_addCount(BBCC* bbcc)
1131 if ((bbcc->ecounter_sum > 0) || (bbcc->ret_counter>0))
1135 static void hash_addPtr(BBCC* bbcc)
1137 if ((bbcc->ecounter_sum == 0) &&
1138 (bbcc->ret_counter == 0)) return;
1140 *prepare_ptr = bbcc;
1148 BBCC* bbcc;
1160 bbcc = e->jcc->from;
1163 i,CLG_(current_tid),bbcc->cxt->fn[0]->name);
1165 if (bbcc->ecounter_sum>0 || bbcc->ret_counter>0) {
1176 BBCC* bbcc;
1186 bbcc = e->jcc->from;
1188 if (bbcc->ecounter_sum>0 || bbcc->ret_counter>0) {
1193 *prepare_ptr = bbcc;
1205 BBCC** prepare_dump(void)
1207 BBCC **array;
1224 /* allocate bbcc array, insert BBCCs and sort */
1226 (BBCC**) CLG_MALLOC("cl.dump.pd.1",
1227 (prepare_count+1) * sizeof(BBCC*));
1511 BBCC **p, **array;
1602 /* All BBCC/JCC costs is stored for thread 1 */