Skip to content

Commit 00bac7b

Browse files
jeffhostetlerdscho
authored andcommitted
trace2: add trace2 tracing of major regions in wt-status
Add trace2_region_enter() and trace2_region_leave() calls around the various phases of a status scan. This gives elapsed time for each phase in the GIT_TR2_PERF and GIT_TR2_EVENT trace target. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent 1354d73 commit 00bac7b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

wt-status.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,16 +749,29 @@ static int has_unmerged(struct wt_status *s)
749749

750750
void wt_status_collect(struct wt_status *s)
751751
{
752+
trace2_region_enter("status", "worktrees", the_repository);
752753
wt_status_collect_changes_worktree(s);
753-
if (s->is_initial)
754+
trace2_region_leave("status", "worktrees", the_repository);
755+
756+
if (s->is_initial) {
757+
trace2_region_enter("status", "initial", the_repository);
754758
wt_status_collect_changes_initial(s);
755-
else
759+
trace2_region_leave("status", "initial", the_repository);
760+
} else {
761+
trace2_region_enter("status", "index", the_repository);
756762
wt_status_collect_changes_index(s);
763+
trace2_region_leave("status", "index", the_repository);
764+
}
765+
766+
trace2_region_enter("status", "untracked", the_repository);
757767
wt_status_collect_untracked(s);
768+
trace2_region_leave("status", "untracked", the_repository);
758769

770+
trace2_region_enter("status", "committable", the_repository);
759771
wt_status_get_state(&s->state, s->branch && !strcmp(s->branch, "HEAD"));
760772
if (s->state.merge_in_progress && !has_unmerged(s))
761773
s->committable = 1;
774+
trace2_region_leave("status", "committable", the_repository);
762775
}
763776

764777
void wt_status_collect_free_buffers(struct wt_status *s)

0 commit comments

Comments
 (0)