mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-23 11:11:44 -05:00
trace2: emit cmd_ancestry data for Windows
Since 2f732bf15e (tr2: log parent process name, 2021-07-21) it is now
now possible to emit a specific process ancestry event in TRACE2. We
should emit the Windows process ancestry data with the correct event
type.
To not break existing consumers of the data_json "windows/ancestry"
event, we continue to emit the ancestry data as a JSON event.
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
c2a473b2b1
commit
d7301487a3
@@ -172,6 +172,11 @@ void trace2_collect_process_info(enum trace2_process_info_reason reason)
|
||||
get_is_being_debugged();
|
||||
get_ancestry(&names);
|
||||
if (names.nr) {
|
||||
/*
|
||||
Emit the ancestry data as a data_json event to
|
||||
maintain compatibility for consumers of the older
|
||||
"windows/ancestry" event.
|
||||
*/
|
||||
struct json_writer jw = JSON_WRITER_INIT;
|
||||
jw_array_begin(&jw, 0);
|
||||
for (size_t i = 0; i < names.nr; i++)
|
||||
@@ -180,6 +185,9 @@ void trace2_collect_process_info(enum trace2_process_info_reason reason)
|
||||
trace2_data_json("process", the_repository,
|
||||
"windows/ancestry", &jw);
|
||||
jw_release(&jw);
|
||||
|
||||
/* Emit the ancestry data with the new event. */
|
||||
trace2_cmd_ancestry(names.v);
|
||||
}
|
||||
|
||||
strvec_clear(&names);
|
||||
|
||||
Reference in New Issue
Block a user