Skip to content

Commit aa5a3c5

Browse files
committed
Documentation: coresight: Update coresight configuration docs
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2055405 commit f9809d5 Author: Mike Leach <mike.leach@linaro.org> Date: Wed Nov 24 20:00:38 2021 +0000 Documentation: coresight: Update coresight configuration docs Update the CoreSight System Configuration document to cover the use of loadable modules to add configurations and features to the system. Signed-off-by: Mike Leach <mike.leach@linaro.org> Link: https://lore.kernel.org/r/20211124200038.28662-7-mike.leach@linaro.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Jeremy Linton <jlinton@redhat.com>
1 parent b37dda1 commit aa5a3c5

File tree

1 file changed

+59
-3
lines changed

1 file changed

+59
-3
lines changed

Documentation/trace/coresight/coresight-config.rst

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,24 @@ follows::
155155
autofdo
156156
$ cd autofdo/
157157
$ ls
158-
description preset1 preset3 preset5 preset7 preset9
159-
feature_refs preset2 preset4 preset6 preset8
158+
description feature_refs preset1 preset3 preset5 preset7 preset9
159+
enable preset preset2 preset4 preset6 preset8
160160
$ cat description
161161
Setup ETMs with strobing for autofdo
162162
$ cat feature_refs
163163
strobing
164164

165-
Each preset declared has a preset<n> subdirectory declared. The values for
165+
Each preset declared has a 'preset<n>' subdirectory declared. The values for
166166
the preset can be examined::
167167

168168
$ cat preset1/values
169169
strobing.window = 0x1388 strobing.period = 0x2
170170
$ cat preset2/values
171171
strobing.window = 0x1388 strobing.period = 0x4
172172

173+
The 'enable' and 'preset' files allow the control of a configuration when
174+
using CoreSight with sysfs.
175+
173176
The features referenced by the configuration can be examined in the features
174177
directory::
175178

@@ -236,3 +239,56 @@ A preset to override the current parameter values can also be selected::
236239

237240
When configurations are selected in this way, then the trace sink used is
238241
automatically selected.
242+
243+
Using Configurations in sysfs
244+
=============================
245+
246+
Coresight can be controlled using sysfs. When this is in use then a configuration
247+
can be made active for the devices that are used in the sysfs session.
248+
249+
In a configuration there are 'enable' and 'preset' files.
250+
251+
To enable a configuration for use with sysfs::
252+
253+
$ cd configurations/autofdo
254+
$ echo 1 > enable
255+
256+
This will then use any default parameter values in the features - which can be
257+
adjusted as described above.
258+
259+
To use a preset<n> set of parameter values::
260+
261+
$ echo 3 > preset
262+
263+
This will select preset3 for the configuration.
264+
The valid values for preset are 0 - to deselect presets, and any value of
265+
<n> where a preset<n> sub-directory is present.
266+
267+
Note that the active sysfs configuration is a global parameter, therefore
268+
only a single configuration can be active for sysfs at any one time.
269+
Attempting to enable a second configuration will result in an error.
270+
Additionally, attempting to disable the configuration while in use will
271+
also result in an error.
272+
273+
The use of the active configuration by sysfs is independent of the configuration
274+
used in perf.
275+
276+
277+
Creating and Loading Custom Configurations
278+
==========================================
279+
280+
Custom configurations and / or features can be dynamically loaded into the
281+
system by using a loadable module.
282+
283+
An example of a custom configuration is found in ./samples/coresight.
284+
285+
This creates a new configuration that uses the existing built in
286+
strobing feature, but provides a different set of presets.
287+
288+
When the module is loaded, then the configuration appears in the configfs
289+
file system and is selectable in the same way as the built in configuration
290+
described above.
291+
292+
Configurations can use previously loaded features. The system will ensure
293+
that it is not possible to unload a feature that is currently in use, by
294+
enforcing the unload order as the strict reverse of the load order.

0 commit comments

Comments
 (0)