Skip to content

Commit 05eba7b

Browse files
jeffhostetlerderrickstolee
authored andcommitted
Trace2:gvfs:experiment: capture more 'tracking' details
Update tracing around report_tracking() to use 'tracking' category rather than 'exp' category. Add ahead/behind results from stat_tracking_info(). Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
1 parent 9474f66 commit 05eba7b

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

builtin/checkout.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,12 +982,12 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
982982
(new_branch_info->path || (!opts->force_detach && !strcmp(new_branch_info->name, "HEAD")))) {
983983
unsigned long nr_unpack_entry_at_start;
984984

985-
trace2_region_enter("exp", "report_tracking", the_repository);
985+
trace2_region_enter("tracking", "report_tracking", the_repository);
986986
nr_unpack_entry_at_start = get_nr_unpack_entry();
987987
report_tracking(new_branch_info);
988-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
988+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
989989
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
990-
trace2_region_leave("exp", "report_tracking", the_repository);
990+
trace2_region_leave("tracking", "report_tracking", the_repository);
991991
}
992992
}
993993

remote.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,16 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
22742274
char *base;
22752275
int upstream_is_gone = 0;
22762276

2277+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
22772278
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2279+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2280+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2281+
if (sti >= 0 && abf == AHEAD_BEHIND_FULL) {
2282+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2283+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2284+
}
2285+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2286+
22782287
if (sti < 0) {
22792288
if (!full_base)
22802289
return 0;

0 commit comments

Comments
 (0)