Merge branch 'nd/trace-index-ops'

* nd/trace-index-ops:
  trace: measure where the time is spent in the index-heavy operations
This commit is contained in:
Junio C Hamano
2018-02-15 14:55:44 -08:00
5 changed files with 18 additions and 0 deletions

2
dir.c
View File

@ -2245,6 +2245,7 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
const char *path, int len, const struct pathspec *pathspec)
{
struct untracked_cache_dir *untracked;
uint64_t start = getnanotime();
if (has_symlink_leading_path(path, len))
return dir->nr;
@ -2283,6 +2284,7 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
dir->nr = i;
}
trace_performance_since(start, "read directory %.*s", len, path);
if (dir->untracked) {
static struct trace_key trace_untracked_stats = TRACE_KEY_INIT(UNTRACKED_STATS);
trace_printf_key(&trace_untracked_stats,