OSDN Git Service

coresight: Add default sink selection to CoreSight base
authorMike Leach <mike.leach@linaro.org>
Thu, 16 Jul 2020 17:57:43 +0000 (11:57 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jul 2020 13:48:40 +0000 (15:48 +0200)
commit0336bdfd7354edfa3db0e01675b5df224516e3e9
treee21b96c1572654eebe592e0c80fd1f7ba594d7d0
parentd021f5c5ff679432c5e9faee0fd7350db2efb97c
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)

Signed-off-by: Mike Leach <mike.leach@linaro.org>
Suggested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200716175746.3338735-15-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-priv.h
drivers/hwtracing/coresight/coresight.c
include/linux/coresight.h