Lines Matching refs:si
564 scriptitem_T *si; in script_prof_save() local
568 si = SCRIPT_ITEM(current_sctx.sc_sid); in script_prof_save()
569 if (si->sn_prof_on && si->sn_pr_nest++ == 0) in script_prof_save()
570 profile_start(&si->sn_pr_child); in script_prof_save()
801 script_do_profile(scriptitem_T *si) in script_do_profile() argument
803 si->sn_pr_count = 0; in script_do_profile()
804 profile_zero(&si->sn_pr_total); in script_do_profile()
805 profile_zero(&si->sn_pr_self); in script_do_profile()
807 ga_init2(&si->sn_prl_ga, sizeof(sn_prl_T), 100); in script_do_profile()
808 si->sn_prl_idx = -1; in script_do_profile()
809 si->sn_prof_on = TRUE; in script_do_profile()
810 si->sn_pr_nest = 0; in script_do_profile()
819 scriptitem_T *si; in script_prof_restore() local
823 si = SCRIPT_ITEM(current_sctx.sc_sid); in script_prof_restore()
824 if (si->sn_prof_on && --si->sn_pr_nest == 0) in script_prof_restore()
826 profile_end(&si->sn_pr_child); in script_prof_restore()
827 profile_sub_wait(tm, &si->sn_pr_child); // don't count wait time in script_prof_restore()
828 profile_add(&si->sn_pr_children, &si->sn_pr_child); in script_prof_restore()
829 profile_add(&si->sn_prl_children, &si->sn_pr_child); in script_prof_restore()
841 scriptitem_T *si; in script_dump_profile() local
848 si = SCRIPT_ITEM(id); in script_dump_profile()
849 if (si->sn_prof_on) in script_dump_profile()
851 fprintf(fd, "SCRIPT %s\n", si->sn_name); in script_dump_profile()
852 if (si->sn_pr_count == 1) in script_dump_profile()
855 fprintf(fd, "Sourced %d times\n", si->sn_pr_count); in script_dump_profile()
856 fprintf(fd, "Total time: %s\n", profile_msg(&si->sn_pr_total)); in script_dump_profile()
857 fprintf(fd, " Self time: %s\n", profile_msg(&si->sn_pr_self)); in script_dump_profile()
861 sfd = mch_fopen((char *)si->sn_name, "r"); in script_dump_profile()
891 if (i < si->sn_prl_ga.ga_len in script_dump_profile()
892 && (pp = &PRL_ITEM(si, i))->snp_count > 0) in script_dump_profile()
943 scriptitem_T *si; in script_line_start() local
948 si = SCRIPT_ITEM(current_sctx.sc_sid); in script_line_start()
949 if (si->sn_prof_on && SOURCING_LNUM >= 1) in script_line_start()
953 (void)ga_grow(&si->sn_prl_ga, in script_line_start()
954 (int)(SOURCING_LNUM - si->sn_prl_ga.ga_len)); in script_line_start()
955 si->sn_prl_idx = SOURCING_LNUM - 1; in script_line_start()
956 while (si->sn_prl_ga.ga_len <= si->sn_prl_idx in script_line_start()
957 && si->sn_prl_ga.ga_len < si->sn_prl_ga.ga_maxlen) in script_line_start()
960 pp = &PRL_ITEM(si, si->sn_prl_ga.ga_len); in script_line_start()
964 ++si->sn_prl_ga.ga_len; in script_line_start()
966 si->sn_prl_execed = FALSE; in script_line_start()
967 profile_start(&si->sn_prl_start); in script_line_start()
968 profile_zero(&si->sn_prl_children); in script_line_start()
969 profile_get_wait(&si->sn_prl_wait); in script_line_start()
979 scriptitem_T *si; in script_line_exec() local
983 si = SCRIPT_ITEM(current_sctx.sc_sid); in script_line_exec()
984 if (si->sn_prof_on && si->sn_prl_idx >= 0) in script_line_exec()
985 si->sn_prl_execed = TRUE; in script_line_exec()
994 scriptitem_T *si; in script_line_end() local
999 si = SCRIPT_ITEM(current_sctx.sc_sid); in script_line_end()
1000 if (si->sn_prof_on && si->sn_prl_idx >= 0 in script_line_end()
1001 && si->sn_prl_idx < si->sn_prl_ga.ga_len) in script_line_end()
1003 if (si->sn_prl_execed) in script_line_end()
1005 pp = &PRL_ITEM(si, si->sn_prl_idx); in script_line_end()
1007 profile_end(&si->sn_prl_start); in script_line_end()
1008 profile_sub_wait(&si->sn_prl_wait, &si->sn_prl_start); in script_line_end()
1009 profile_add(&pp->sn_prl_total, &si->sn_prl_start); in script_line_end()
1010 profile_self(&pp->sn_prl_self, &si->sn_prl_start, in script_line_end()
1011 &si->sn_prl_children); in script_line_end()
1013 si->sn_prl_idx = -1; in script_line_end()