Skip to content

Commit 2232b6a

Browse files
committed
logger: Describe runtime logger trace filtration usage
Each mechanism in logger tool chould be described in sof-dox. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
1 parent 8d3ff90 commit 2232b6a

File tree

1 file changed

+65
-0
lines changed
  • developer_guides/debugability/logger

1 file changed

+65
-0
lines changed

developer_guides/debugability/logger/index.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Usage sof-logger <option(s)> <file(s)>
3636
-v ver_file Enable checking the firmware version with the ver_file file instead of the default: "/sys/kernel/debug/sof/fw_version"
3737
-s Take a snapshot of state
3838
-r Less formatted output for chained log processors
39+
-F options Update trace filtering
3940
-d Dump ldc information
4041

4142
Examples:
@@ -120,3 +121,67 @@ Examples:
120121
.. code-block:: bash
121122
122123
sof-logger -l ldc_file -d
124+
125+
126+
Trace filtering
127+
***************
128+
129+
It's possible to change current logs level for any instance of component in
130+
runtime. To do so, use `-F` option, where `options` have
131+
following format:
132+
133+
<log_level>=<component1>[, <component2>]
134+
135+
Where *<log_level>* is one of:
136+
137+
- ``c`` / ``critical``
138+
- ``e`` / ``error``
139+
- ``w`` / ``warning``
140+
- ``i`` / ``info``
141+
- ``d`` / ``debug``
142+
- ``v`` / ``verbose``
143+
144+
After **=** character, there is a list of component, separated with comma.
145+
Each components starts with *name* description followed by optional part with
146+
*instance* description.
147+
148+
List of possible components names comes from UUID declaration,
149+
see :ref:`uuid-api` for more detailed information.
150+
Try use ``-d`` flag in logger to list each component names.
151+
There is also a special name - ``*`` - used to apply given trace
152+
level to each component.
153+
154+
Instance description may have one of following form:
155+
156+
- ``*`` - each component instance with given *name*
157+
- ``X`` - only for *name* equal *pipe*, then apply to pipe component
158+
- ``X.*`` - update each component on selected pipeline *X*
159+
- ``X.Y`` - component with id *Y* on pipeline *X*
160+
161+
Trace levels changes works in same order as options given in command line,
162+
and new set overwrites old value. It allows to easily enable verbose logs only
163+
for selected components and keeping lowest possible log level (critical) for
164+
others, example:
165+
166+
sof-logger -l ldc_file -t -Fcritical=* -Fverbose="dai*, volume1.1"
167+
168+
Similar example may be prepared for components on particular pipeline:
169+
170+
sof-loggerr -l ldc_file -t -Fcritical=* 1.* -Fverbose=dai1.1
171+
172+
173+
Detailed description
174+
--------------------
175+
176+
Filtration mechanism is realized on firmware side, so after change the log level
177+
to verbose for each component, then DSP may be overhelmed by tracing.
178+
179+
Communication between firmware and logger is realized through driver debug file
180+
systems.
181+
Logger writes to ``sys/kernel/debug/sof/filter`` new trace settings,
182+
which will be used to create *IPC* message.
183+
Simple text data format is used:
184+
185+
``uuid1_id pipe1_id comp1_id log1_level [; uuid2_id pipe2_id comp2_id log2_level]\n``
186+
187+
Any unimportant field, except for ``log_level``, can be set to ``-1``.

0 commit comments

Comments
 (0)