perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX
Subsystems (2)
PATCH 1/1 perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX
For Skylake Server, Linux has supported a number of free running counters that collect counts of IO clocks/Bandwidth/Utilization.
For example, to collect the inbound bandwidth,
root@skx /sys/devices# ls | grep uncore_iiouncore_iio_0uncore_iio_1uncore_iio_2uncore_iio_3uncore_iio_4uncore_iio_5uncore_iio_free_running_0uncore_iio_free_running_1uncore_iio_free_running_2uncore_iio_free_running_3uncore_iio_free_running_4uncore_iio_free_running_5
root@skx /sys/devices# perf stat -a -e uncore_iio_free_running_2/bw_in_port0/ ^C
Performance counter stats for 'system wide':
153.19 MiB uncore_iio_free_running_2/bw_in_port0/
8.037701069 seconds time elapsedWhile it's hard for user to understanding what the box the uncore_iio_free_running_N means.
This patch provides aliases for the boxes. With this patch, for example,
root@skx /sys/devices# ls | grep uncore_iiouncore_iio_0uncore_iio_1uncore_iio_2uncore_iio_3uncore_iio_4uncore_iio_5uncore_iio_cbdmauncore_iio_mcp0uncore_iio_mcp1uncore_iio_pcie0uncore_iio_pcie1uncore_iio_pcie2
root@skx ~# perf stat -a -e uncore_iio_pcie1/bw_in_port0/ ^C
Performance counter stats for 'system wide':
153.12 MiB uncore_iio_pcie1/bw_in_port0/
8.469790720 seconds time elapsed--- arch/x86/events/intel/uncore.c | 9 +++++++-- arch/x86/events/intel/uncore.h | 1 + arch/x86/events/intel/uncore_snbep.c | 10 ++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-)
arch/x86/events/intel/uncore.c +7 -2
@@ -812,8 +812,13 @@ static int uncore_pmu_register(struct intel_uncore_pmu *pmu)else sprintf (pmu->name,"uncore" ); }else { -sprintf (pmu->name,"uncore_%s_%d" , pmu->type->name, - pmu->pmu_idx); +if (pmu->type->alias && pmu->pmu_idx < pmu->type->num_boxes) { +sprintf (pmu->name,"uncore_%s" , + pmu->type->alias[pmu->pmu_idx]); + }else { +sprintf (pmu->name,"uncore_%s_%d" , pmu->type->name, + pmu->pmu_idx); + } } ret =perf_pmu_register (&pmu->pmu, pmu->name,-1 );
arch/x86/events/intel/uncore.h +1 -0
@@ -44,6 +44,7 @@ struct freerunning_counters;struct intel_uncore_type {const char *name; +const char **alias;int num_counters;int num_boxes;int perf_ctr_bits;
arch/x86/events/intel/uncore_snbep.c +10 -0
@@ -3596,8 +3596,18 @@ static const struct attribute_group skx_uncore_iio_freerunning_format_group = { .attrs = skx_uncore_iio_freerunning_formats_attr, }; +static const char *const skx_uncore_iio_free_running_aliases[] = { + {"iio_cbdma" }, + {"iio_pcie0" }, + {"iio_pcie1" }, + {"iio_pcie2" }, + {"iio_mcp0" }, + {"iio_mcp1" }, +}; +static struct intel_uncore_type skx_uncore_iio_free_running = { .name ="iio_free_running" , + .alias = skx_uncore_iio_free_running_aliases, .num_counters =17 , .num_boxes =6 , .num_freerunning_types =SKX_IIO_FREERUNNING_TYPE_MAX ,
Signature · 1 line
2.7.4