diff --git a/doc/kernel_tests.rst b/doc/kernel_tests.rst index 9174c350f0b6c7530b05df8c81697a675309120a..6007426c4cdc7ca170477355a1a3ca0609769dda 100644 --- a/doc/kernel_tests.rst +++ b/doc/kernel_tests.rst @@ -64,6 +64,10 @@ The shortest path to executing a test from a shell is: # To run a test matching a pattern lisa-test '*test_task_placement' + # For reStructuredText to have its bullet point closing blank line + printf "\n" + + More advanced workflows are described at :ref:`automated-testing-page`. From a python environment diff --git a/lisa/trace.py b/lisa/trace.py index b584a6c98b5271577008c8136db666030efe35b2..f3452527e22e92e15720c523c2c7ad8270b4227d 100644 --- a/lisa/trace.py +++ b/lisa/trace.py @@ -1178,11 +1178,10 @@ class TxtTraceParserBase(TraceParserBase): # For each event we don't already know, get the list of all fields available inferred = df.groupby('__event', observed=True, group_keys=False)['split_fields'].apply(infer_fields).to_frame() - inferred['positional_field'] = df.groupby('__event', observed=True, group_keys=False)['pos_fields'].any() def update_desc(desc): new = dict( - positional_field='__positional' if desc['positional_field'] else None, + positional_field=None, fields={ field.decode('ascii'): None for field in desc['split_fields'] @@ -3541,20 +3540,7 @@ class Trace(Loggable, TraceBase): def _select_trace_printk(self, source_event, meta_event, df): content_col = { 'bprint': 'buf', - 'bputs': 'str', }[source_event] - - # Select on foobar function name with "trace_printk@func@foobar" - func_prefix = 'func@' - if meta_event.startswith(func_prefix): - func_name = meta_event[len(func_prefix):] - df = self.ana.functions.df_resolve_ksym(df, addr_col='ip', name_col='func_name', exact=False) - df = df[df['func_name'] == func_name] - df = df.copy(deep=False) - # Prepend the meta event name so it will be matched - fake_event = meta_event.encode('ascii') + b': ' - df[content_col] = fake_event + df[content_col] - return (df, content_col) _META_EVENT_SOURCE = { @@ -3563,7 +3549,6 @@ class Trace(Loggable, TraceBase): }, 'trace_printk': { 'bprint': _select_trace_printk, - 'bputs': _select_trace_printk, }, } """ @@ -4023,33 +4008,31 @@ class Trace(Loggable, TraceBase): 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: - .. code-block:: C - - // trace.df_event('trace_printk@event') - void foo(void) { - trace_printk("event: optional_positional_field field1=foo field2=42"); - } + * 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. - * ``trace_printk@func@``: the event name will be the name of the - function calling trace_printk: + * 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@func@foo') + // trace.df_event('trace_printk@myevent') void foo(void) { - trace_printk("optional_positional_field 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: optional_positional_field 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