Skip to content

Commit cac036a

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 <[email protected]>
1 parent 5e1692c commit cac036a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

builtin/checkout.c

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

938-
trace2_region_enter("exp", "report_tracking", the_repository);
938+
trace2_region_enter("tracking", "report_tracking", the_repository);
939939
nr_unpack_entry_at_start = get_nr_unpack_entry();
940940
report_tracking(new_branch_info);
941-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
941+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
942942
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
943-
trace2_region_leave("exp", "report_tracking", the_repository);
943+
trace2_region_leave("tracking", "report_tracking", the_repository);
944944
}
945945
}
946946

remote.c

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

1992+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
19921993
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
1994+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
1995+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
1996+
if (abf == AHEAD_BEHIND_FULL) {
1997+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
1998+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
1999+
}
2000+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2001+
19932002
if (sti < 0) {
19942003
if (!full_base)
19952004
return 0;

0 commit comments

Comments
 (0)