Skip to content

Commit c57513a

Browse files
jeffhostetlervdye
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 2949dd2 commit c57513a

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

1022-
trace2_region_enter("exp", "report_tracking", the_repository);
1022+
trace2_region_enter("tracking", "report_tracking", the_repository);
10231023
nr_unpack_entry_at_start = get_nr_unpack_entry();
10241024
report_tracking(new_branch_info);
1025-
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
1025+
trace2_data_intmax("tracking", NULL, "report_tracking/nr_unpack_entries",
10261026
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
1027-
trace2_region_leave("exp", "report_tracking", the_repository);
1027+
trace2_region_leave("tracking", "report_tracking", the_repository);
10281028
}
10291029
}
10301030

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"
@@ -2264,7 +2265,16 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
22642265
char *base;
22652266
int upstream_is_gone = 0;
22662267

2268+
trace2_region_enter("tracking", "stat_tracking_info", NULL);
22672269
sti = stat_tracking_info(branch, &ours, &theirs, &full_base, 0, abf);
2270+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_flags", abf);
2271+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_result", sti);
2272+
if (sti >= 0 && abf == AHEAD_BEHIND_FULL) {
2273+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_ahead", ours);
2274+
trace2_data_intmax("tracking", NULL, "stat_tracking_info/ab_behind", theirs);
2275+
}
2276+
trace2_region_leave("tracking", "stat_tracking_info", NULL);
2277+
22682278
if (sti < 0) {
22692279
if (!full_base)
22702280
return 0;

0 commit comments

Comments
 (0)