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
17
trace2.h
17
trace2.h
@@ -19,6 +19,23 @@ struct json_writer;
|
||||
* [] trace2_printf* -- legacy trace[1] messages.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialize the TRACE2 clock and do nothing else, in particular
|
||||
* no mallocs, no system inspection, and no environment inspection.
|
||||
*
|
||||
* This should be called at the very top of main() to capture the
|
||||
* process start time. This is intended to reduce chicken-n-egg
|
||||
* bootstrap pressure.
|
||||
*
|
||||
* It is safe to call this more than once. This allows capturing
|
||||
* absolute startup costs on Windows which uses a little trickery
|
||||
* to do setup work before common-main.c:main() is called.
|
||||
*
|
||||
* The main trace2_initialize_fl() may be called a little later
|
||||
* after more infrastructure is established.
|
||||
*/
|
||||
void trace2_initialize_clock(void);
|
||||
|
||||
/*
|
||||
* Initialize TRACE2 tracing facility if any of the builtin TRACE2
|
||||
* targets are enabled in the environment. Emits a 'version' event.
|
||||
|
||||
Reference in New Issue
Block a user