Skip to content

Commit ed48c16

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 1489a11 commit ed48c16

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

1056-
trace2_region_enter("exp", "report_tracking", the_repository);
1056+
trace2_region_enter("tracking", "report_tracking", the_repository);
10571057
nr_unpack_entry_at_start = get_nr_unpack_entry();
10581058
report_tracking(new_branch_info);
1059-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
1059+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
10601060
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
1061-
trace2_region_leave("exp", "report_tracking", the_repository);
1061+
trace2_region_leave("tracking", "report_tracking", the_repository);
10621062
}
10631063
}
10641064

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"
@@ -2374,7 +2375,16 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
23742375
char *base;
23752376
int upstream_is_gone = 0;
23762377

2378+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
23772379
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2380+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2381+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2382+
if (sti >= 0 && abf == AHEAD_BEHIND_FULL) {
2383+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2384+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2385+
}
2386+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2387+
23782388
if (sti < 0) {
23792389
if (!full_base)
23802390
return 0;

0 commit comments

Comments
 (0)