Lines Matching full:ct

271 pmcpl_ct_instr_add(struct pmcpl_ct_node *ct, int pmcin,  in pmcpl_ct_instr_add()  argument
277 for (i = 0; i<ct->pct_ninstr; i++) { in pmcpl_ct_instr_add()
278 if (ct->pct_instr[i].pctf_func == pc) { in pmcpl_ct_instr_add()
279 in = &ct->pct_instr[i]; in pmcpl_ct_instr_add()
286 pmcpl_ct_instr_grow(ct->pct_ninstr, &ct->pct_instr_c, &ct->pct_instr); in pmcpl_ct_instr_add()
287 in = &ct->pct_instr[ct->pct_ninstr]; in pmcpl_ct_instr_add()
292 ct->pct_ninstr++; in pmcpl_ct_instr_add()
302 struct pmcpl_ct_node *ct; in pmcpl_ct_node_allocate() local
304 if ((ct = malloc(sizeof(*ct))) == NULL) in pmcpl_ct_node_allocate()
307 pmcpl_ct_samples_init(&ct->pct_samples); in pmcpl_ct_node_allocate()
309 ct->pct_sym = NULL; in pmcpl_ct_node_allocate()
310 ct->pct_image = NULL; in pmcpl_ct_node_allocate()
311 ct->pct_func = 0; in pmcpl_ct_node_allocate()
313 ct->pct_narc = 0; in pmcpl_ct_node_allocate()
314 ct->pct_arc_c = 0; in pmcpl_ct_node_allocate()
315 ct->pct_arc = NULL; in pmcpl_ct_node_allocate()
317 ct->pct_ninstr = 0; in pmcpl_ct_node_allocate()
318 ct->pct_instr_c = 0; in pmcpl_ct_node_allocate()
319 ct->pct_instr = NULL; in pmcpl_ct_node_allocate()
321 ct->pct_color = PMCPL_PCT_WHITE; in pmcpl_ct_node_allocate()
323 return (ct); in pmcpl_ct_node_allocate()
331 pmcpl_ct_node_free(struct pmcpl_ct_node *ct) in pmcpl_ct_node_free() argument
335 for (i = 0; i < ct->pct_narc; i++) { in pmcpl_ct_node_free()
336 pmcpl_ct_samples_free(&ct->pct_arc[i].pcta_samples); in pmcpl_ct_node_free()
337 pmcpl_ct_samples_free(&ct->pct_arc[i].pcta_callid); in pmcpl_ct_node_free()
340 pmcpl_ct_samples_free(&ct->pct_samples); in pmcpl_ct_node_free()
341 free(ct->pct_arc); in pmcpl_ct_node_free()
342 free(ct->pct_instr); in pmcpl_ct_node_free()
343 free(ct); in pmcpl_ct_node_free()
367 pmcpl_ct_node_dumptop(int pmcin, struct pmcpl_ct_node *ct, in pmcpl_ct_node_dumptop() argument
373 if (ct->pct_color == PMCPL_PCT_GREY) in pmcpl_ct_node_dumptop()
380 pmcpl_ct_topscreen[x][*y] = ct; in pmcpl_ct_node_dumptop()
388 for (i = 0; i < ct->pct_narc; i++) { in pmcpl_ct_node_dumptop()
389 arc = &ct->pct_arc[i]; in pmcpl_ct_node_dumptop()
400 if (ct->pct_narc == 0 || terminal) { in pmcpl_ct_node_dumptop()
411 ct->pct_color = PMCPL_PCT_GREY; in pmcpl_ct_node_dumptop()
412 for (i = 0; i < ct->pct_narc; i++) { in pmcpl_ct_node_dumptop()
414 &ct->pct_arc[i].pcta_samples) == 0) in pmcpl_ct_node_dumptop()
417 &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) { in pmcpl_ct_node_dumptop()
419 ct->pct_arc[i].pcta_child, in pmcpl_ct_node_dumptop()
421 ct->pct_color = PMCPL_PCT_BLACK; in pmcpl_ct_node_dumptop()
426 ct->pct_color = PMCPL_PCT_BLACK; in pmcpl_ct_node_dumptop()
465 struct pmcpl_ct_node *ct; in pmcpl_ct_node_printtop() local
472 ct = TS(1, y); in pmcpl_ct_node_printtop()
473 if (ct == NULL) in pmcpl_ct_node_printtop()
488 ct = TSI(1, y); in pmcpl_ct_node_printtop()
489 if (ct == NULL) in pmcpl_ct_node_printtop()
506 for (x = 1; (ct = TSI(x, y)) != NULL; x++) { in pmcpl_ct_node_printtop()
512 v = PMCPL_CT_SAMPLEP(pmcin, &ct->pct_samples); in pmcpl_ct_node_printtop()
522 if (ct->pct_sym != NULL) { in pmcpl_ct_node_printtop()
524 pmcstat_string_unintern(ct->pct_sym->ps_name)); in pmcpl_ct_node_printtop()
527 (void *)ct->pct_func); in pmcpl_ct_node_printtop()
531 TSI(x-1, y)->pct_image != ct->pct_image) in pmcpl_ct_node_printtop()
533 pmcstat_string_unintern(ct->pct_image->pi_name)); in pmcpl_ct_node_printtop()
667 struct pmcpl_ct_node *ct; in pmcpl_ct_node_hash_lookup() local
685 ct = h->pch_ctnode; in pmcpl_ct_node_hash_lookup()
687 assert(ct != NULL); in pmcpl_ct_node_hash_lookup()
689 if (ct->pct_image == image && ct->pct_func == pc) { in pmcpl_ct_node_hash_lookup()
691 return (ct); in pmcpl_ct_node_hash_lookup()
692 if (ct->pct_type == PMCPL_PCT_NAME && in pmcpl_ct_node_hash_lookup()
693 ct->pct_ifl == ifl && ct->pct_ifn == ifn) in pmcpl_ct_node_hash_lookup()
694 return (ct); in pmcpl_ct_node_hash_lookup()
702 ct = pmcpl_ct_node_allocate(); in pmcpl_ct_node_hash_lookup()
707 ct->pct_type = PMCPL_PCT_NAME; in pmcpl_ct_node_hash_lookup()
708 ct->pct_ifl = ifl; in pmcpl_ct_node_hash_lookup()
709 ct->pct_ifn = ifn; in pmcpl_ct_node_hash_lookup()
711 ct->pct_type = PMCPL_PCT_ADDR; in pmcpl_ct_node_hash_lookup()
712 ct->pct_image = image; in pmcpl_ct_node_hash_lookup()
713 ct->pct_func = pc; in pmcpl_ct_node_hash_lookup()
714 ct->pct_sym = sym; in pmcpl_ct_node_hash_lookup()
716 h->pch_ctnode = ct; in pmcpl_ct_node_hash_lookup()
718 return (ct); in pmcpl_ct_node_hash_lookup()
735 struct pmcpl_ct_node *ct; in pmcpl_ct_process() local
793 ct = pmcpl_ct_node_hash_lookup(image, pc, sym, NULL, NULL); in pmcpl_ct_process()
794 if (ct == NULL) { in pmcpl_ct_process()
798 ctl[i++] = ct; in pmcpl_ct_process()
805 ct = ctl[0]; in pmcpl_ct_process()
827 pmcpl_ct_node_printchild(struct pmcpl_ct_node *ct, uintfptr_t paddr, in pmcpl_ct_node_printchild() argument
841 for (i=0 ; i<ct->pct_narc; i++) { in pmcpl_ct_node_printchild()
842 child = ct->pct_arc[i].pcta_child; in pmcpl_ct_node_printchild()
872 ct->pct_arc[i].pcta_call, (void *)addr, line); in pmcpl_ct_node_printchild()
881 PMCPL_CT_SAMPLE(j, &ct->pct_arc[i].pcta_samples)); in pmcpl_ct_node_printchild()
891 pmcpl_ct_node_printself(struct pmcpl_ct_node *ct) in pmcpl_ct_node_printself() argument
902 pmcstat_string_unintern(ct->pct_image->pi_fullpath)); in pmcpl_ct_node_printself()
907 faddr = ct->pct_image->pi_vaddr + ct->pct_func; in pmcpl_ct_node_printself()
909 if (ct->pct_type == PMCPL_PCT_NAME) { in pmcpl_ct_node_printself()
911 pmcstat_string_unintern(ct->pct_ifl), in pmcpl_ct_node_printself()
912 pmcstat_string_unintern(ct->pct_ifn)); in pmcpl_ct_node_printself()
913 } else if (pmcstat_image_addr2line(ct->pct_image, faddr, in pmcpl_ct_node_printself()
919 if (ct->pct_sym != NULL) in pmcpl_ct_node_printself()
921 pmcstat_string_unintern(ct->pct_sym->ps_name)); in pmcpl_ct_node_printself()
924 (void *)(ct->pct_image->pi_vaddr + ct->pct_func)); in pmcpl_ct_node_printself()
930 if (ct->pct_ninstr > 0) { in pmcpl_ct_node_printself()
934 for (i = 0; i < ct->pct_ninstr; i++) { in pmcpl_ct_node_printself()
935 addr = ct->pct_image->pi_vaddr + in pmcpl_ct_node_printself()
936 ct->pct_instr[i].pctf_func; in pmcpl_ct_node_printself()
938 pmcstat_image_addr2line(ct->pct_image, addr, in pmcpl_ct_node_printself()
946 &ct->pct_instr[i].pctf_samples)); in pmcpl_ct_node_printself()
954 PMCPL_CT_SAMPLE(i, &ct->pct_samples)); in pmcpl_ct_node_printself()
958 pmcpl_ct_node_printchild(ct, faddr, fline); in pmcpl_ct_node_printself()
962 pmcpl_ct_printnode(struct pmcpl_ct_node *ct) in pmcpl_ct_printnode() argument
966 if (ct == pmcpl_ct_root) { in pmcpl_ct_printnode()
972 pmcpl_ct_node_printchild(ct, 0, 0); in pmcpl_ct_printnode()
974 pmcpl_ct_node_printself(ct); in pmcpl_ct_printnode()
982 pmcpl_ct_bfs(struct pmcpl_ct_node *ct) in pmcpl_ct_bfs() argument
992 pch->pch_ctnode = ct; in pmcpl_ct_bfs()
994 ct->pct_color = PMCPL_PCT_BLACK; in pmcpl_ct_bfs()
1020 _pmcpl_ct_expand_inline(struct pmcpl_ct_node *ct) in _pmcpl_ct_expand_inline() argument
1033 faddr = ct->pct_image->pi_vaddr + ct->pct_func; in _pmcpl_ct_expand_inline()
1035 if (!pmcstat_image_addr2line(ct->pct_image, faddr, in _pmcpl_ct_expand_inline()
1040 for (i = 0; i < ct->pct_ninstr; i++) { in _pmcpl_ct_expand_inline()
1041 addr = ct->pct_image->pi_vaddr + in _pmcpl_ct_expand_inline()
1042 ct->pct_instr[i].pctf_func; in _pmcpl_ct_expand_inline()
1044 if (!pmcstat_image_addr2line(ct->pct_image, addr, in _pmcpl_ct_expand_inline()
1065 child = pmcpl_ct_node_hash_lookup(ct->pct_image, in _pmcpl_ct_expand_inline()
1066 ct->pct_func, ct->pct_sym, sourcefile, buffer); in _pmcpl_ct_expand_inline()
1068 pc = ct->pct_instr[i].pctf_func; in _pmcpl_ct_expand_inline()
1071 &ct->pct_instr[i].pctf_samples); in _pmcpl_ct_expand_inline()
1075 pmcpl_ct_node_update(ct, child, j, v, 0); in _pmcpl_ct_expand_inline()
1076 if (j < ct->pct_samples.npmcs) in _pmcpl_ct_expand_inline()
1077 ct->pct_samples.sb[j] -= in _pmcpl_ct_expand_inline()
1078 ct->pct_instr[i].pctf_samples.sb[j]; in _pmcpl_ct_expand_inline()
1079 ct->pct_instr[i].pctf_samples.sb[j] = 0; in _pmcpl_ct_expand_inline()