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>

Matthew John Cheetham committed Feb 13, 2026 at 19:54 UTC d7301487a38766109589b02309dac1be6490fa95
1 file changed +8
compat/win32/trace2_win32_process_info.c
+8
@@ -172,6 +172,11 @@ void trace2_collect_process_info(enum trace2_process_info_reason reason)
172 get_is_being_debugged();
173 get_ancestry(&names);
174 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 + */
180 struct json_writer jw = JSON_WRITER_INIT;
181 jw_array_begin(&jw, 0);
182 for (size_t i = 0; i < names.nr; i++)
@@ -180,6 +185,9 @@ void trace2_collect_process_info(enum trace2_process_info_reason reason)
185 trace2_data_json("process", the_repository,
186 "windows/ancestry", &jw);
187 jw_release(&jw);
188 +
189 + /* Emit the ancestry data with the new event. */
190 + trace2_cmd_ancestry(names.v);
191 }
192
193 strvec_clear(&names);