From 21da15e8dbbec869236caa3d7d8a6f8da3629a5e Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 12 Aug 2022 15:19:52 -0400 Subject: [PATCH] WIP: Events can be defined with no fields yielding no " { } " field text The current lttng-modules ctf2 implementation produce the following "no field" event record: { "type": "event-record-class", "id": 0, "name": "syscall_entry_gettid" "data-stream-class-id": 0, } Which is valid and simply result in an output without payload. In ctf1 the same "event record" is: event { name = "syscall_entry_gettid"; id = 0; stream_id = 0; fields := struct { }; }; Resulting in an empty but present payload -> " { } " The tests looked for the presence of a payload ("{.*}"), For now I decided to modify the regex since I have no feedback from eepp for the last 5 hours... And ultimately I'm not sure what we should prioritize in term of preventing "regression". A ctf2 event record yielding the same output would be: { "type": "event-record-class", "id": 0, "name": "syscall_entry_gettid" "data-stream-class-id": 0, "payload-field-class": { "type": "structure" } } Signed-off-by: Jonathan Rajotte Change-Id: I42a38d15a2968b278d6ab6625799e5fdcb2d7e53 --- tests/utils/parse-callstack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils/parse-callstack.py b/tests/utils/parse-callstack.py index 3bfddd9ef..1bb876141 100755 --- a/tests/utils/parse-callstack.py +++ b/tests/utils/parse-callstack.py @@ -89,8 +89,8 @@ def extract_kernel_func_names(raw_callstack): return recorded_callstack # Regex capturing the callstack_user and callstack_kernel context -user_cs_rexp='.*callstack_user\ \=\ \[(.*)\]\ .*\}, \{.*\}' -kernel_cs_rexp='.*callstack_kernel\ \=\ \[(.*)\]\ .*\}, \{.*\}' +user_cs_rexp='.*callstack_user\ \=\ \[(.*)\]\ .*\}' +kernel_cs_rexp='.*callstack_kernel\ \=\ \[(.*)\]\ .*\}' def main(): """ -- 2.34.1