diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-22 10:59:19 -0700 |
commit | 9f2de9c121c60cba9e55db5263a7bceffcd8fe2d (patch) | |
tree | da422744914ae63ec7da372e6558c897e1792a04 /wt-status.c | |
parent | 9ab08822556c49a7856dadd0e9a42f9ec2aaf850 (diff) | |
parent | c7d3f8cb48d754371343c5a48cf392135bb4d77b (diff) | |
download | git-9f2de9c121c60cba9e55db5263a7bceffcd8fe2d.tar.gz |
Merge branch 'kb/perf-trace'
* kb/perf-trace:
api-trace.txt: add trace API documentation
progress: simplify performance measurement by using getnanotime()
wt-status: simplify performance measurement by using getnanotime()
git: add performance tracing for git's main() function to debug scripts
trace: add trace_performance facility to debug performance issues
trace: add high resolution timer function to debug performance issues
trace: add 'file:line' to all trace output
trace: move code around, in preparation to file:line output
trace: add current timestamp to all trace output
trace: disable additional trace output for unit tests
trace: add infrastructure to augment trace output with additional info
sha1_file: change GIT_TRACE_PACK_ACCESS logging to use trace API
Documentation/git.txt: improve documentation of 'GIT_TRACE*' variables
trace: improve trace performance
trace: remove redundant printf format attribute
trace: consistently name the format parameter
trace: move trace declarations from cache.h to new trace.h
Diffstat (limited to 'wt-status.c')
-rw-r--r-- | wt-status.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/wt-status.c b/wt-status.c index 882cfe9fb0..27da5296be 100644 --- a/wt-status.c +++ b/wt-status.c @@ -574,14 +574,11 @@ static void wt_status_collect_untracked(struct wt_status *s) { int i; struct dir_struct dir; - struct timeval t_begin; + uint64_t t_begin = getnanotime(); if (!s->show_untracked_files) return; - if (advice_status_u_option) - gettimeofday(&t_begin, NULL); - memset(&dir, 0, sizeof(dir)); if (s->show_untracked_files != SHOW_ALL_UNTRACKED_FILES) dir.flags |= @@ -612,13 +609,8 @@ static void wt_status_collect_untracked(struct wt_status *s) free(dir.ignored); clear_directory(&dir); - if (advice_status_u_option) { - struct timeval t_end; - gettimeofday(&t_end, NULL); - s->untracked_in_ms = - (uint64_t)t_end.tv_sec * 1000 + t_end.tv_usec / 1000 - - ((uint64_t)t_begin.tv_sec * 1000 + t_begin.tv_usec / 1000); - } + if (advice_status_u_option) + s->untracked_in_ms = (getnanotime() - t_begin) / 1000000; } void wt_status_collect(struct wt_status *s) |