WIP: Events can be defined with no fields yielding no " { } " field text
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 12 Aug 2022 19:19:52 +0000 (15:19 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 19 Aug 2022 16:11:10 +0000 (12:11 -0400)
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 <jonathan.rajotte-julien@efficios.com>
Change-Id: I42a38d15a2968b278d6ab6625799e5fdcb2d7e53

tests/utils/parse-callstack.py

index 3bfddd9eff36631b5d179f6495c672d7e28c9965..1bb876141cc40a900127b0c0a0e80eabf14cfe7f 100755 (executable)
@@ -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():
     """
This page took 0.029518 seconds and 5 git commands to generate.