Skip to content

Commit 396bba5

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 0d03322 commit 396bba5

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

1025-
trace2_region_enter("exp", "report_tracking", the_repository);
1025+
trace2_region_enter("tracking", "report_tracking", the_repository);
10261026
nr_unpack_entry_at_start = get_nr_unpack_entry();
10271027
report_tracking(new_branch_info);
1028-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
1028+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
10291029
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
1030-
trace2_region_leave("exp", "report_tracking", the_repository);
1030+
trace2_region_leave("tracking", "report_tracking", the_repository);
10311031
}
10321032
}
10331033

remote.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "setup.h"
2020
#include "string-list.h"
2121
#include "strvec.h"
22+
#include "trace2.h"
2223
#include "commit-reach.h"
2324
#include "advice.h"
2425
#include "connect.h"
@@ -2267,7 +2268,16 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
22672268
char *base;
22682269
int upstream_is_gone = 0;
22692270

2271+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
22702272
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2273+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2274+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2275+
if (sti >= 0 && abf == AHEAD_BEHIND_FULL) {
2276+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2277+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2278+
}
2279+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2280+
22712281
if (sti < 0) {
22722282
if (!full_base)
22732283
return 0;

0 commit comments

Comments
 (0)