Skip to content

Commit 3e3cf98

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 <[email protected]>
1 parent db06d80 commit 3e3cf98

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

945-
trace2_region_enter("exp", "report_tracking", the_repository);
945+
trace2_region_enter("tracking", "report_tracking", the_repository);
946946
nr_unpack_entry_at_start = get_nr_unpack_entry();
947947
report_tracking(new_branch_info);
948-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
948+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
949949
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
950-
trace2_region_leave("exp", "report_tracking", the_repository);
950+
trace2_region_leave("tracking", "report_tracking", the_repository);
951951
}
952952
}
953953

remote.c

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

2099+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
20992100
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2101+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2102+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2103+
if (abf == AHEAD_BEHIND_FULL) {
2104+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2105+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2106+
}
2107+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2108+
21002109
if (sti < 0) {
21012110
if (!full_base)
21022111
return 0;

0 commit comments

Comments
 (0)