Lines Matching refs:Stk
574 struct callstack *Stk; in report_htable_stats() local
613 for (Stk = callstack; Stk != NULL; Stk = Stk->next) { in report_htable_stats()
616 (ulong_t)Stk->stkbase, in report_htable_stats()
617 (ulong_t)Stk->stkend, in report_htable_stats()
618 (ulong_t)(Stk->stkend - Stk->stkbase)); in report_htable_stats()
635 struct callstack *Stk; in make_lwp_stack() local
645 for (Stk = callstack; Stk != NULL; Stk = Stk->next) in make_lwp_stack()
646 if (sp >= Stk->stkbase && sp < Stk->stkend) in make_lwp_stack()
649 Stk = my_malloc(sizeof (struct callstack), NULL); in make_lwp_stack()
650 Stk->next = callstack; in make_lwp_stack()
651 callstack = Stk; in make_lwp_stack()
653 Stk->tref = 0; in make_lwp_stack()
654 Stk->tid = 0; in make_lwp_stack()
655 Stk->nthr_create = 0; in make_lwp_stack()
656 Stk->ncall = 0; in make_lwp_stack()
657 Stk->maxcall = DEF_MAXCALL; in make_lwp_stack()
658 Stk->stack = my_malloc(DEF_MAXCALL * sizeof (*Stk->stack), NULL); in make_lwp_stack()
662 Stk->stkbase = Psp->pr_stkbase; in make_lwp_stack()
663 Stk->stkend = Stk->stkbase + Psp->pr_stksize; in make_lwp_stack()
672 Stk->stkbase = (uintptr_t)Lsp->pr_altstack.ss_sp; in make_lwp_stack()
673 Stk->stkend = Stk->stkbase + Lsp->pr_altstack.ss_size; in make_lwp_stack()
684 Stk->stkend = (uintptr_t)thrinfo.ti_stkbase; in make_lwp_stack()
685 Stk->stkbase = Stk->stkend - thrinfo.ti_stksize; in make_lwp_stack()
693 Stk->stkbase = Pmap->pr_vaddr; in make_lwp_stack()
694 Stk->stkend = Pmap->pr_vaddr + Pmap->pr_size; in make_lwp_stack()
699 callstack = Stk->next; in make_lwp_stack()
701 free(Stk->stack); in make_lwp_stack()
702 free(Stk); in make_lwp_stack()
711 struct callstack *Stk; in make_thr_stack() local
719 for (Stk = callstack; Stk != NULL; Stk = Stk->next) in make_thr_stack()
720 if (sp >= Stk->stkbase && sp < Stk->stkend) in make_thr_stack()
723 Stk = my_malloc(sizeof (struct callstack), NULL); in make_thr_stack()
724 Stk->next = callstack; in make_thr_stack()
725 callstack = Stk; in make_thr_stack()
727 Stk->tref = 0; in make_thr_stack()
728 Stk->tid = 0; in make_thr_stack()
729 Stk->nthr_create = 0; in make_thr_stack()
730 Stk->ncall = 0; in make_thr_stack()
731 Stk->maxcall = DEF_MAXCALL; in make_thr_stack()
732 Stk->stack = my_malloc(DEF_MAXCALL * sizeof (*Stk->stack), NULL); in make_thr_stack()
736 Stk->stkbase = Psp->pr_stkbase; in make_thr_stack()
737 Stk->stkend = Stk->stkbase + Psp->pr_stksize; in make_thr_stack()
745 Stk->stkend = (uintptr_t)thrinfo.ti_stkbase; in make_thr_stack()
746 Stk->stkbase = Stk->stkend - thrinfo.ti_stksize; in make_thr_stack()
750 callstack = Stk->next; in make_thr_stack()
752 free(Stk->stack); in make_thr_stack()
753 free(Stk); in make_thr_stack()
766 struct callstack *Stk = NULL; in find_lwp_stack() local
789 Stk = my_malloc(sizeof (struct callstack), NULL); in find_lwp_stack()
790 Stk->next = callstack; in find_lwp_stack()
791 callstack = Stk; in find_lwp_stack()
793 Stk->stkbase = pmap->pr_vaddr; in find_lwp_stack()
794 Stk->stkend = pmap->pr_vaddr + pmap->pr_size; in find_lwp_stack()
795 Stk->tref = 0; in find_lwp_stack()
796 Stk->tid = 0; in find_lwp_stack()
797 Stk->nthr_create = 0; in find_lwp_stack()
798 Stk->ncall = 0; in find_lwp_stack()
799 Stk->maxcall = DEF_MAXCALL; in find_lwp_stack()
800 Stk->stack = my_malloc( in find_lwp_stack()
801 DEF_MAXCALL * sizeof (*Stk->stack), NULL); in find_lwp_stack()
807 return (Stk); in find_lwp_stack()
824 struct callstack *Stk = NULL; in find_stack() local
831 Stk = my_malloc(sizeof (struct callstack), NULL); in find_stack()
832 Stk->next = callstack; in find_stack()
833 callstack = Stk; in find_stack()
835 Stk->stkbase = Psp->pr_stkbase; in find_stack()
836 Stk->stkend = Stk->stkbase + Psp->pr_stksize; in find_stack()
837 Stk->tref = 0; in find_stack()
838 Stk->tid = 0; in find_stack()
839 Stk->nthr_create = 0; in find_stack()
840 Stk->ncall = 0; in find_stack()
841 Stk->maxcall = DEF_MAXCALL; in find_stack()
842 Stk->stack = my_malloc(DEF_MAXCALL * sizeof (*Stk->stack), in find_stack()
844 return (Stk); in find_stack()
852 Stk = my_malloc(sizeof (struct callstack), NULL); in find_stack()
853 Stk->next = callstack; in find_stack()
854 callstack = Stk; in find_stack()
856 Stk->stkbase = (uintptr_t)Lsp->pr_altstack.ss_sp; in find_stack()
857 Stk->stkend = Stk->stkbase + Lsp->pr_altstack.ss_size; in find_stack()
858 Stk->tref = 0; in find_stack()
859 Stk->tid = 0; in find_stack()
860 Stk->nthr_create = 0; in find_stack()
861 Stk->ncall = 0; in find_stack()
862 Stk->maxcall = DEF_MAXCALL; in find_stack()
863 Stk->stack = my_malloc(DEF_MAXCALL * sizeof (*Stk->stack), in find_stack()
865 return (Stk); in find_stack()
892 Stk = my_malloc(sizeof (struct callstack), NULL); in find_stack()
893 Stk->next = callstack; in find_stack()
894 callstack = Stk; in find_stack()
897 Stk->stkend = (uintptr_t)thrinfo.ti_stkbase; in find_stack()
898 Stk->stkbase = Stk->stkend - thrinfo.ti_stksize; in find_stack()
899 Stk->tref = tref; in find_stack()
900 Stk->tid = thrinfo.ti_tid; in find_stack()
901 Stk->nthr_create = nthr_create; in find_stack()
902 Stk->ncall = 0; in find_stack()
903 Stk->maxcall = DEF_MAXCALL; in find_stack()
904 Stk->stack = my_malloc(DEF_MAXCALL * sizeof (*Stk->stack), in find_stack()
906 return (Stk); in find_stack()
924 get_tid(struct callstack *Stk) in get_tid() argument
942 Stk->tref = 0; in get_tid()
943 Stk->tid = 0; in get_tid()
944 Stk->nthr_create = 0; in get_tid()
955 if (tref == Stk->tref && Stk->nthr_create == nthr_create) in get_tid()
964 Stk->tref = 0; in get_tid()
965 Stk->tid = 0; in get_tid()
966 Stk->nthr_create = 0; in get_tid()
973 Stk->tref = 0; in get_tid()
974 Stk->tid = 0; in get_tid()
975 Stk->nthr_create = 0; in get_tid()
977 Stk->tref = tref; in get_tid()
978 Stk->tid = thrinfo.ti_tid; in get_tid()
979 Stk->nthr_create = nthr_create; in get_tid()
986 struct callstack *Stk; in callstack_info() local
993 for (Stk = callstack; Stk != NULL; Stk = Stk->next) in callstack_info()
994 if (sp >= Stk->stkbase && sp < Stk->stkend) in callstack_info()
1000 if (Stk == NULL) { in callstack_info()
1024 while (Stk == NULL && fp != 0 && fp >= sp) { in callstack_info()
1026 for (Stk = callstack; Stk != NULL; Stk = Stk->next) in callstack_info()
1027 if ((fp >= Stk->stkbase && fp < Stk->stkend) || in callstack_info()
1028 (stkend > Stk->stkbase && in callstack_info()
1029 stkend <= Stk->stkend)) in callstack_info()
1031 if (Stk == NULL) in callstack_info()
1035 if (Stk != NULL) /* the stack grew */ in callstack_info()
1036 Stk->stkbase = stkbase; in callstack_info()
1039 if (Stk == NULL && makeid) /* new stack */ in callstack_info()
1040 Stk = find_stack(sp); in callstack_info()
1042 if (Stk == NULL) in callstack_info()
1048 if (Stk->ncall == Stk->maxcall) { in callstack_info()
1049 Stk->maxcall *= 2; in callstack_info()
1050 Stk->stack = my_realloc(Stk->stack, in callstack_info()
1051 Stk->maxcall * sizeof (*Stk->stack), NULL); in callstack_info()
1055 get_tid(Stk); in callstack_info()
1057 return (Stk); in callstack_info()
1068 struct callstack *Stk; in reset_breakpoints() local
1096 while ((Stk = callstack) != NULL) { in reset_breakpoints()
1097 callstack = Stk->next; in reset_breakpoints()
1098 free(Stk->stack); in reset_breakpoints()
1099 free(Stk); in reset_breakpoints()
1178 struct callstack *Stk, struct dynlib *Dp, struct bkpt *Bp) in show_function_call() argument
1185 make_pname(pri, (Stk != NULL)? Stk->tid : 0); in show_function_call()
1188 if (Stk != NULL) { in show_function_call()
1189 for (i = 1; i < Stk->ncall; i++) { in show_function_call()
1209 struct callstack *Stk, struct dynlib *Dp, struct bkpt *Bp) in show_function_return() argument
1213 make_pname(pri, Stk->tid); in show_function_return()
1216 for (i = 0; i < Stk->ncall; i++) { in show_function_return()
1253 struct callstack *Stk; in function_trace() local
1369 if ((Stk = callstack_info(sp, fp, 1)) == NULL) { in function_trace()
1382 function_entry(pri, Bp, Stk); in function_trace()
1386 function_return(pri, Stk); in function_trace()
1443 function_entry(private_t *pri, struct bkpt *Bp, struct callstack *Stk) in function_entry() argument
1464 if (!(sp >= Stk->stkbase && sp < Stk->stkend) || in function_entry()
1469 for (i = 0; i < Stk->ncall; i++) { in function_entry()
1470 if (sp >= Stk->stack[i].sp) { in function_entry()
1471 Stk->ncall = i; in function_entry()
1472 if (sp == Stk->stack[i].sp) in function_entry()
1486 Stk->stack[Stk->ncall].sp = sp; /* record it anyeay */ in function_entry()
1487 Stk->stack[Stk->ncall].pc = rpc; in function_entry()
1488 Stk->stack[Stk->ncall].fcn = Bp; in function_entry()
1490 Stk->ncall++; in function_entry()
1495 show_function_call(pri, Stk, Dp, Bp); in function_entry()
1505 function_return(private_t *pri, struct callstack *Stk) in function_return() argument
1522 for (i = Stk->ncall - 1; i >= 0; i--) { in function_return()
1523 if (sp <= Stk->stack[i].sp && fp > Stk->stack[i].sp) { in function_return()
1524 Stk->ncall = i; in function_return()
1535 for (i = Stk->ncall - 1; i >= 0; i--) { in function_return()
1536 if (sp <= Stk->stack[i].sp && in function_return()
1537 fp > Stk->stack[i].sp) { in function_return()
1538 Stk->ncall = i; in function_return()
1548 Stk, Stk->stack[i].fcn->dyn, Stk->stack[i].fcn); in function_return()
1565 struct callstack *Stk; in trap_one_stack() local
1619 if ((Stk = callstack_info(sp, fp, 0)) == NULL) in trap_one_stack()
1623 Stk->stack[Stk->ncall].sp = sp; in trap_one_stack()
1624 Stk->stack[Stk->ncall].pc = rpc; in trap_one_stack()
1625 Stk->stack[Stk->ncall].fcn = Bp; in trap_one_stack()
1626 Stk->ncall++; in trap_one_stack()