Skip to content

Commit a02e9d9

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 7def48c commit a02e9d9

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
@@ -1065,12 +1065,12 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
10651065
(new_branch_info->path || !strcmp(new_branch_info->name, "HEAD"))) {
10661066
unsigned long nr_unpack_entry_at_start;
10671067

1068-
trace2_region_enter("exp", "report_tracking", the_repository);
1068+
trace2_region_enter("tracking", "report_tracking", the_repository);
10691069
nr_unpack_entry_at_start = get_nr_unpack_entry();
10701070
report_tracking(new_branch_info);
1071-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
1071+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
10721072
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
1073-
trace2_region_leave("exp", "report_tracking", the_repository);
1073+
trace2_region_leave("tracking", "report_tracking", the_repository);
10741074
}
10751075
}
10761076

remote.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "setup.h"
2222
#include "string-list.h"
2323
#include "strvec.h"
24+
#include "trace2.h"
2425
#include "commit-reach.h"
2526
#include "advice.h"
2627
#include "connect.h"
@@ -2246,7 +2247,16 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
22462247
char *base;
22472248
int upstream_is_gone = 0;
22482249

2250+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
22492251
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2252+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2253+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2254+
if (sti >= 0 && abf == AHEAD_BEHIND_FULL) {
2255+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2256+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2257+
}
2258+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2259+
22502260
if (sti < 0) {
22512261
if (!full_base)
22522262
return 0;

0 commit comments

Comments
 (0)