]> git.ipfire.org Git - thirdparty/git.git/commit
trace2: implement trace2_printf() for event target
authorJosh Steadmon <steadmon@google.com>
Thu, 22 Aug 2024 21:57:45 +0000 (14:57 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Aug 2024 22:02:31 +0000 (15:02 -0700)
commitcbe140754bc1eb4380ffe820de121e49357a9af8
tree850e955f9173a3165f27d0db183ed4fd9b94551a
parent3a7362eb9fad0c4838f5cfaa95ed3c51a4c18d93
trace2: implement trace2_printf() for event target

The trace2 event target does not have an implementation for
trace2_printf(). While the event target is for structured events, and
trace2_printf() is for unstructured, human-readable messages, it may
still be useful to wrap these unstructured messages in a structured JSON
object. Among other things, it may reduce confusion when manually
debugging using event trace data.

Add a simple implementation for the event target that wraps
trace2_printf() messages in a minimal JSON object. Document this in
Documentation/technical/api-trace2.txt, and bump the event format
version since we're adding a new event type.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/api-trace2.txt
trace2/tr2_tgt_event.c