[PATCH 4/4] trace2: emit cmd_ancestry data for Windows
- From
Matthew John Cheetham via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Feb 5, 2026, 16:05 UTC
- Message-ID
- <a06344dc753698ece37f8d066b0a51931b7fa16f.1770307510.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2040.git.1770307510.gitgitgadget@gmail.com>
From: Matthew John Cheetham <mjcheetham@outlook.com>
Since 2f732bf1 (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> --- compat/win32/trace2_win32_process_info.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/compat/win32/trace2_win32_process_info.c b/compat/win32/trace2_win32_process_info.c index aceea05430..6a6a396078 100644 --- a/compat/win32/trace2_win32_process_info.c +++ b/compat/win32/trace2_win32_process_info.c @@ -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);
-- gitgitgadget