mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
trace2: refactor setting process starting time
Create trace2_initialize_clock() and call from main() to capture process start time in isolation and before other sub-systems are ready. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1703751f21
commit
a089724958
7
trace2.c
7
trace2.c
@@ -142,6 +142,11 @@ static void tr2main_signal_handler(int signo)
|
||||
raise(signo);
|
||||
}
|
||||
|
||||
void trace2_initialize_clock(void)
|
||||
{
|
||||
tr2tls_start_process_clock();
|
||||
}
|
||||
|
||||
void trace2_initialize_fl(const char *file, int line)
|
||||
{
|
||||
struct tr2_tgt *tgt_j;
|
||||
@@ -428,7 +433,7 @@ void trace2_thread_start_fl(const char *file, int line, const char *thread_name)
|
||||
us_now = getnanotime() / 1000;
|
||||
us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
|
||||
|
||||
tr2tls_create_self(thread_name);
|
||||
tr2tls_create_self(thread_name, us_now);
|
||||
|
||||
for_each_wanted_builtin (j, tgt_j)
|
||||
if (tgt_j->pfn_thread_start_fl)
|
||||
|
||||
Reference in New Issue
Block a user