[PATCH 3/8] trace2: demonstrate trace2 regions in wt-status
- From
- Jeff Hostetler via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Aug 31, 2018, 16:49 UTC
- Message-ID
- <2db85146df849c2545e32ad32501c4fe5002bfa0.1535734192.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.29.git.gitgitgadget@gmail.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
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_PERFORMANCE trace target.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> --- wt-status.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/wt-status.c b/wt-status.c index 5ffab61015..9e37a73c73 100644 --- a/wt-status.c +++ b/wt-status.c @@ -726,13 +726,23 @@ static void wt_status_collect_untracked(struct wt_status *s) void wt_status_collect(struct wt_status *s) { + trace2_region_enter("status_worktrees"); wt_status_collect_changes_worktree(s); + trace2_region_leave("status_worktrees"); - if (s->is_initial) + if (s->is_initial) { + trace2_region_enter("status_initial"); wt_status_collect_changes_initial(s); - else + trace2_region_leave("status_initial"); + } else { + trace2_region_enter("status_index"); wt_status_collect_changes_index(s); + trace2_region_leave("status_index"); + } + + trace2_region_enter("status_untracked"); wt_status_collect_untracked(s); + trace2_region_leave("status_untracked"); } static void wt_longstatus_print_unmerged(struct wt_status *s)
-- gitgitgadget