@@ -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
4142Examples:
@@ -120,3 +121,70 @@ 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 with following argument format:
131+
132+ <log_level>="<component1>[, <component2>]"
133+
134+ Where *<log_level> * is one of:
135+
136+ - ``c `` / ``critical ``
137+ - ``e `` / ``error ``
138+ - ``w `` / ``warning ``
139+ - ``i `` / ``info ``
140+ - ``d `` / ``debug ``
141+ - ``v `` / ``verbose ``
142+
143+ After **= ** character, there is a list of component, separated with comma.
144+ Each components starts with *name * followed by optional part with *instance *
145+ description.
146+
147+ List of possible components names comes from UUID declaration,
148+ see :ref: `uuid-api ` for more detailed information.
149+ Try use ``-d `` flag in logger to list component names from `ldc ` file content.
150+ There is also a special name - ``* `` - used to apply given trace
151+ level to each component.
152+
153+ Instance description may have one of following form:
154+
155+ - ``* `` - each component instance
156+ - ``X.* `` - each component on selected pipeline *X *
157+ - ``X.Y `` - component on pipeline *X * with id *Y *
158+
159+ Trace levels changes works in same order as options given in command line,
160+ and new set overwrites old value. It allows to easily enable verbose logs only
161+ for selected components and keeping lowest possible log level (critical) for
162+ others, example:
163+
164+ sof-logger -l ldc_file -t -Fcritical=* -Fverbose="dai*, volume1.1"
165+
166+ Similar example may be prepared for components on particular pipeline:
167+
168+ sof-loggerr -l ldc_file -t -Fc=* -Fv=*1.*
169+
170+
171+ Detailed description
172+ --------------------
173+
174+ Filtration mechanism is realized on firmware side, so after change the log level
175+ to verbose for each component, then DSP may be overhelmed by tracing.
176+
177+ Core functionality is provided by DSP, so filtration does not work in offline
178+ mode - during conversion previously saved input file.
179+
180+ Communication between firmware and logger is realized through driver debug file
181+ systems.
182+ Logger writes to ``sys/kernel/debug/sof/filter `` new trace settings,
183+ which will be used to create *IPC * message with new trace levels.
184+ Simple text data format is used:
185+
186+ ``log1_level uuid1_id pipe1_id comp1_id; [log2_level uuid2_id pipe2_id comp2_id;]\n ``
187+
188+ Unused uuid_id should be set here to 0, other unused fields should be set to -1.
189+ ``log_level `` always must be set to valid value - represents ``LOG_LEVEL_* ``
190+ defines values.
0 commit comments