]> git.ipfire.org Git - thirdparty/git.git/commit - trace2.h
trace2: add stopwatch timers
authorJeff Hostetler <jeffhost@microsoft.com>
Mon, 24 Oct 2022 13:41:06 +0000 (13:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Oct 2022 19:45:26 +0000 (12:45 -0700)
commit8ad575646c0b1e927a05650a1ec64125121ae591
tree17b2fb75a11ed67ca4490d59d10657c849efef38
parent24a4c45da9e1255df43a87bec1f646b1efa69209
trace2: add stopwatch timers

Add stopwatch timer mechanism to Trace2.

Timers are an alternative to Trace2 Regions.  Regions are useful for
measuring the time spent in various computation phases, such as the
time to read the index, time to scan for unstaged files, time to scan
for untracked files, and etc.

However, regions are not appropriate in all places.  For example,
during a checkout, it would be very inefficient to use regions to
measure the total time spent inflating objects from the ODB from
across the entire lifetime of the process; a per-unzip() region would
flood the output and significantly slow the command; and some form of
post-processing would be requried to compute the time spent in unzip().

Timers can be used to measure a series of timer intervals and emit
a single summary event (at thread and/or process exit).

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 files changed:
Documentation/technical/api-trace2.txt
Makefile
t/helper/test-trace2.c
t/t0211-trace2-perf.sh
t/t0211/scrub_perf.perl
trace2.c
trace2.h
trace2/tr2_tgt.h
trace2/tr2_tgt_event.c
trace2/tr2_tgt_normal.c
trace2/tr2_tgt_perf.c
trace2/tr2_tls.c
trace2/tr2_tls.h
trace2/tr2_tmr.c [new file with mode: 0644]
trace2/tr2_tmr.h [new file with mode: 0644]