Skip to content

Commit d8ce3ea

Browse files
jeffhostetlerdscho
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 442eb58 commit d8ce3ea

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
@@ -929,12 +929,12 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
929929
(new_branch_info->path || (!opts->force_detach && !strcmp(new_branch_info->name, "HEAD")))) {
930930
unsigned long nr_unpack_entry_at_start;
931931

932-
trace2_region_enter("exp", "report_tracking", the_repository);
932+
trace2_region_enter("tracking", "report_tracking", the_repository);
933933
nr_unpack_entry_at_start = get_nr_unpack_entry();
934934
report_tracking(new_branch_info);
935-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
935+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
936936
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
937-
trace2_region_leave("exp", "report_tracking", the_repository);
937+
trace2_region_leave("tracking", "report_tracking", the_repository);
938938
}
939939
}
940940

remote.c

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

2088+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
20882089
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2090+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2091+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2092+
if (abf == AHEAD_BEHIND_FULL) {
2093+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2094+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2095+
}
2096+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2097+
20892098
if (sti < 0) {
20902099
if (!full_base)
20912100
return 0;

0 commit comments

Comments
 (0)