perf pmu: Remove duplication around EVENT_SOURCE_DEVICE_PATH
authorJames Clark <james.clark@arm.com>
Fri, 20 Jan 2023 14:36:54 +0000 (14:36 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 22 Jan 2023 21:17:27 +0000 (18:17 -0300)
commitf8ad6018ce3c065a706b187cdc4520975969660e
tree0049a4248bc74e7c6009a435557836313d918d9f
parent4cbd5334ff1390444644e82b5aed1e3288798e50
perf pmu: Remove duplication around EVENT_SOURCE_DEVICE_PATH

The pattern for accessing EVENT_SOURCE_DEVICE_PATH is duplicated in a
few places, so add two utility functions to cover it. Also just use
perf_pmu__scan_file() instead of pmu_type() which already does the same
thing.

No functional changes.

Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: James Clark <james.clark@arm.com>
Acked-by: Suzuki Poulouse <suzuki.poulose@arm.com>
Tested-by: Tanmay Jagdale <tanmay@marvell.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Bharat Bhushan <bbhushan2@marvell.com>
Cc: George Cherian <gcherian@marvell.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Linu Cherian <lcherian@marvell.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Cc: Will Deacon <will@kernel.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230120143702.4035046-2-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/arm/util/auxtrace.c
tools/perf/arch/arm64/util/pmu.c
tools/perf/arch/x86/util/pmu.c
tools/perf/util/pmu.c
tools/perf/util/pmu.h