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