Skip to content

Commit 7336c10

Browse files
committed
trace2:data: add vfs stats
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
1 parent 68d0a78 commit 7336c10

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

virtualfilesystem.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ void apply_virtualfilesystem(struct index_state *istate)
250250
{
251251
char *buf, *entry;
252252
int i;
253+
int nr_tracked = 0;
253254

254255
if (!git_config_get_virtualfilesystem())
255256
return;
@@ -278,6 +279,7 @@ void apply_virtualfilesystem(struct index_state *istate)
278279
pos = -pos - 1;
279280
while (pos < istate->cache_nr && !fspathncmp(istate->cache[pos]->name, entry, len)) {
280281
istate->cache[pos]->ce_flags &= ~CE_SKIP_WORKTREE;
282+
nr_tracked++;
281283
pos++;
282284
}
283285
}
@@ -288,14 +290,19 @@ void apply_virtualfilesystem(struct index_state *istate)
288290
ce->ce_flags &= ~CE_SKIP_WORKTREE;
289291
} else {
290292
int pos = index_name_pos(istate, entry, len);
291-
if (pos >= 0)
293+
if (pos >= 0) {
294+
nr_tracked++;
292295
istate->cache[pos]->ce_flags &= ~CE_SKIP_WORKTREE;
296+
}
293297
}
294298
}
295299

296300
entry += len + 1;
297301
}
298302
}
303+
304+
if (nr_tracked > 0)
305+
trace2_data_intmax("vfs", the_repository, "apply/tracked", nr_tracked);
299306
}
300307

301308
/*

0 commit comments

Comments
 (0)