Skip to content

Commit e6152e3

Browse files
jeffhostetlergitster
authored andcommitted
trace2: add region in clear_ce_flags
When Git updates the working directory with the sparse-checkout feature enabled, the unpack_trees() method calls clear_ce_flags() to update the skip-wortree bits on the cache entries. This check can be expensive, depending on the patterns used. Add trace2 regions around the method, including some flag information, so we can get granular performance data during experiments. This data will be used to measure improvements to the pattern-matching algorithms for sparse-checkout. Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 72918c1 commit e6152e3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

unpack-trees.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,15 +1407,23 @@ static int clear_ce_flags(struct index_state *istate,
14071407
struct pattern_list *pl)
14081408
{
14091409
static struct strbuf prefix = STRBUF_INIT;
1410+
char label[100];
1411+
int rval;
14101412

14111413
strbuf_reset(&prefix);
14121414

1413-
return clear_ce_flags_1(istate,
1415+
xsnprintf(label, sizeof(label), "clear_ce_flags(0x%08lx,0x%08lx)",
1416+
(unsigned long)select_mask, (unsigned long)clear_mask);
1417+
trace2_region_enter("unpack_trees", label, the_repository);
1418+
rval = clear_ce_flags_1(istate,
14141419
istate->cache,
14151420
istate->cache_nr,
14161421
&prefix,
14171422
select_mask, clear_mask,
14181423
pl, 0);
1424+
trace2_region_leave("unpack_trees", label, the_repository);
1425+
1426+
return rval;
14191427
}
14201428

14211429
/*

0 commit comments

Comments
 (0)