Skip to content

Commit de0c755

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 85ef186 commit de0c755

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

builtin/checkout.c

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

1050-
trace2_region_enter("exp", "report_tracking", the_repository);
1050+
trace2_region_enter("tracking", "report_tracking", the_repository);
10511051
nr_unpack_entry_at_start = get_nr_unpack_entry();
10521052
report_tracking(new_branch_info);
1053-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
1053+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
10541054
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
1055-
trace2_region_leave("exp", "report_tracking", the_repository);
1055+
trace2_region_leave("tracking", "report_tracking", the_repository);
10561056
}
10571057
}
10581058

remote.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "setup.h"
2121
#include "string-list.h"
2222
#include "strvec.h"
23+
#include "trace2.h"
2324
#include "commit-reach.h"
2425
#include "advice.h"
2526
#include "connect.h"
@@ -2288,7 +2289,16 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
22882289
char *base;
22892290
int upstream_is_gone = 0;
22902291

2292+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
22912293
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2294+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2295+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2296+
if (sti >= 0 && abf == AHEAD_BEHIND_FULL) {
2297+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2298+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2299+
}
2300+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2301+
22922302
if (sti < 0) {
22932303
if (!full_base)
22942304
return 0;

0 commit comments

Comments
 (0)