summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-03-08 17:12:38 +0700
committerJunio C Hamano <gitster@pobox.com>2015-03-12 13:45:17 -0700
commitc9ccb5d327bd9259ca6cceb9d87df9eb2cba2e9d (patch)
tree98ab27dad48d4651e25940fae4321ff16b1a2503 /dir.c
parented4efab1b17e883b761b4482c40c04a4529be8f9 (diff)
downloadgit-c9ccb5d327bd9259ca6cceb9d87df9eb2cba2e9d.tar.gz
untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATS
This could be used to verify correct behavior in tests Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 741484aa97..1cf1e3002e 100644
--- a/dir.c
+++ b/dir.c
@@ -1923,6 +1923,18 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const stru
free_simplify(simplify);
qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name);
qsort(dir->ignored, dir->ignored_nr, sizeof(struct dir_entry *), cmp_name);
+ if (dir->untracked) {
+ static struct trace_key trace_untracked_stats = TRACE_KEY_INIT(UNTRACKED_STATS);
+ trace_printf_key(&trace_untracked_stats,
+ "node creation: %u\n"
+ "gitignore invalidation: %u\n"
+ "directory invalidation: %u\n"
+ "opendir: %u\n",
+ dir->untracked->dir_created,
+ dir->untracked->gitignore_invalidated,
+ dir->untracked->dir_invalidated,
+ dir->untracked->dir_opened);
+ }
return dir->nr;
}