diff --git a/lisa/trace.py b/lisa/trace.py index 1a6fed9f22..6d271120b9 100644 --- a/lisa/trace.py +++ b/lisa/trace.py @@ -4010,23 +4010,31 @@ def df_event(self, event, raw=None, window=None, signals=None, signals_init=True In addition to actual events, the following formats for meta events are supported: - * ``trace_printk@``: the event will be assumed to be embedded in - textual form inside the field of another event as a string, - typically emitted using the ``trace_printk()`` kernel function: + * ``trace_printk@``: The event format is described by the + ``bprint`` event format string, and the field values are decoded + from the variable arguments buffer. Note that: + + * The field values *must* be in the buffer, i.e. the format + string is only used as the event format, no "literal value" + will be extracted from it. + + * The event *must* have fields. If not, ``trace_printk()`` + will emit a bputs event that will be ignored at the moment. + We need to get a bprint event. .. code-block:: C - // trace.df_event('trace_printk@event') + // trace.df_event('trace_printk@myevent') void foo(void) { - trace_printk("event: field1=foo field2=42"); + trace_printk("myevent: field1=%s field2=%i", "foo", 42); } * ``userspace@``: the event is generated by userspace: .. code-block:: shell - # trace.df_event('userspace@event') - echo "event: field1=foo field2=42" > /sys/kernel/debug/tracing/trace_marker + # trace.df_event('userspace@myevent') + echo "myevent: field1=foo field2=42" > /sys/kernel/debug/tracing/trace_marker .. note:: All meta event names are expected to be valid C language identifiers. Usage of other characters will prevent correct