Skip to content

Commit b2ef8b1

Browse files
mjcheethamgitster
authored andcommitted
trace2: emit cmd_ancestry data for Windows
Since 2f732bf (tr2: log parent process name) it is 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>
1 parent aa59353 commit b2ef8b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compat/win32/trace2_win32_process_info.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ void trace2_collect_process_info(enum trace2_process_info_reason reason)
172172
get_is_being_debugged();
173173
get_ancestry(&names);
174174
if (names.nr) {
175+
/*
176+
Emit the ancestry data as a data_json event to
177+
maintain compatibility for consumers of the older
178+
"windows/ancestry" event.
179+
*/
175180
struct json_writer jw = JSON_WRITER_INIT;
176181
jw_array_begin(&jw, 0);
177182
for (size_t i = 0; i < names.nr; i++)
@@ -180,6 +185,9 @@ void trace2_collect_process_info(enum trace2_process_info_reason reason)
180185
trace2_data_json("process", the_repository,
181186
"windows/ancestry", &jw);
182187
jw_release(&jw);
188+
189+
/* Emit the ancestry data with the new event. */
190+
trace2_cmd_ancestry(names.v);
183191
}
184192

185193
strvec_clear(&names);

0 commit comments

Comments
 (0)