Skip to content

Commit

Permalink
trace2: add trace2 tracing of major regions in wt-status
Browse files Browse the repository at this point in the history
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 <jeffhost@microsoft.com>
  • Loading branch information
jeffhostetler authored and dscho committed Dec 15, 2018
1 parent 1354d73 commit 00bac7b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions wt-status.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,16 +749,29 @@ static int has_unmerged(struct wt_status *s)

void wt_status_collect(struct wt_status *s)
{
trace2_region_enter("status", "worktrees", the_repository);
wt_status_collect_changes_worktree(s);
if (s->is_initial)
trace2_region_leave("status", "worktrees", the_repository);

if (s->is_initial) {
trace2_region_enter("status", "initial", the_repository);
wt_status_collect_changes_initial(s);
else
trace2_region_leave("status", "initial", the_repository);
} else {
trace2_region_enter("status", "index", the_repository);
wt_status_collect_changes_index(s);
trace2_region_leave("status", "index", the_repository);
}

trace2_region_enter("status", "untracked", the_repository);
wt_status_collect_untracked(s);
trace2_region_leave("status", "untracked", the_repository);

trace2_region_enter("status", "committable", the_repository);
wt_status_get_state(&s->state, s->branch && !strcmp(s->branch, "HEAD"));
if (s->state.merge_in_progress && !has_unmerged(s))
s->committable = 1;
trace2_region_leave("status", "committable", the_repository);
}

void wt_status_collect_free_buffers(struct wt_status *s)
Expand Down

0 comments on commit 00bac7b

Please sign in to comment.