History

coresight: Add default sink selection to CoreSight base

Adds a method to select a suitable sink connected to a given source. In cases where no sink is defined, the coresight_find_default_sink routine can search from a given source, through the child connections until a suitable sink is found. The suitability is defined in by the sink coresight_dev_subtype on the CoreSight device, and the distance from the source by counting connections. Higher value subtype is preferred - where these are equal, shorter distance from source is used as a tie-break. This allows for default sink to be discovered were none is specified (e.g. perf command line)

Mike Leach committed 6 years ago

Commit 0336bdf1 parent d021f5c3 files · +171 −0Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/coresight.h+3−0
@@ -48,6 +48,7 @@ enum coresight_dev_subtype_sink { · 47 unmodified lines
4848 CORESIGHT_DEV_SUBTYPE_SINK_NONE,
4949 CORESIGHT_DEV_SUBTYPE_SINK_PORT,
5050 CORESIGHT_DEV_SUBTYPE_SINK_BUFFER,
51+ CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM,
5152 };
5253
5354 enum coresight_dev_subtype_link {
@@ -182,6 +183,7 @@ struct coresight_sysfs_link { · 128 unmodified lines
182183 * happens when a source has been selected and a path is enabled
183184 * from source to that sink.
184185 * @ea: Device attribute for sink representation under PMU directory.
186+ * @def_sink: cached reference to default sink found for this device.
185187 * @ect_dev: Associated cross trigger device. Not part of the trace data
186188 * path or connections.
187189 * @nr_links: number of sysfs links created to other components from this
@@ -200,6 +202,7 @@ struct coresight_device { · 12 unmodified lines
200202 /* sink specific fields */
201203 bool activated; /* true only if a sink is part of a path */
202204 struct dev_ext_attribute *ea;
205+ struct coresight_device *def_sink;
203206 /* cross trigger handling */
204207 struct coresight_device *ect_dev;
205208 /* sysfs links between components */