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
48 CORESIGHT_DEV_SUBTYPE_SINK_NONE,48 CORESIGHT_DEV_SUBTYPE_SINK_NONE,
49 CORESIGHT_DEV_SUBTYPE_SINK_PORT,49 CORESIGHT_DEV_SUBTYPE_SINK_PORT,
50 CORESIGHT_DEV_SUBTYPE_SINK_BUFFER,50 CORESIGHT_DEV_SUBTYPE_SINK_BUFFER,
51 CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM,
51};52};
52 53
53enum coresight_dev_subtype_link {54enum coresight_dev_subtype_link {
@@ -182,6 +183,7 @@ struct coresight_sysfs_link { · 128 unmodified lines
182 * happens when a source has been selected and a path is enabled183 * happens when a source has been selected and a path is enabled
183 * from source to that sink.184 * from source to that sink.
184 * @ea: Device attribute for sink representation under PMU directory.185 * @ea: Device attribute for sink representation under PMU directory.
186 * @def_sink: cached reference to default sink found for this device.
185 * @ect_dev: Associated cross trigger device. Not part of the trace data187 * @ect_dev: Associated cross trigger device. Not part of the trace data
186 * path or connections.188 * path or connections.
187 * @nr_links: number of sysfs links created to other components from this189 * @nr_links: number of sysfs links created to other components from this
@@ -200,6 +202,7 @@ struct coresight_device { · 12 unmodified lines
200 /* sink specific fields */202 /* sink specific fields */
201 bool activated; /* true only if a sink is part of a path */203 bool activated; /* true only if a sink is part of a path */
202 struct dev_ext_attribute *ea;204 struct dev_ext_attribute *ea;
205 struct coresight_device *def_sink;
203 /* cross trigger handling */206 /* cross trigger handling */
204 struct coresight_device *ect_dev;207 struct coresight_device *ect_dev;
205 /* sysfs links between components */208 /* sysfs links between components */