summaryrefslogtreecommitdiff
path: root/trace2.c
diff options
context:
space:
mode:
authorLibravatar Jeff Hostetler <jeffhost@microsoft.com>2019-04-15 13:39:44 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-04-16 13:37:06 +0900
commit39f43177442d44d8a945c3ff6a8c08f481539763 (patch)
tree3c25f514d6ce57a45fe0d80312da49e12ed5c3f6 /trace2.c
parenttrace2: refactor setting process starting time (diff)
downloadtgif-39f43177442d44d8a945c3ff6a8c08f481539763.tar.xz
trace2: add absolute elapsed time to start event
Add elapsed process time to "start" event to measure the performance of early process startup. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2.c')
-rw-r--r--trace2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/trace2.c b/trace2.c
index 6dd51e6aa5..1c180062dd 100644
--- a/trace2.c
+++ b/trace2.c
@@ -182,13 +182,19 @@ void trace2_cmd_start_fl(const char *file, int line, const char **argv)
{
struct tr2_tgt *tgt_j;
int j;
+ uint64_t us_now;
+ uint64_t us_elapsed_absolute;
if (!trace2_enabled)
return;
+ us_now = getnanotime() / 1000;
+ us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
+
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_start_fl)
- tgt_j->pfn_start_fl(file, line, argv);
+ tgt_j->pfn_start_fl(file, line, us_elapsed_absolute,
+ argv);
}
int trace2_cmd_exit_fl(const char *file, int line, int code)