* [PATCH v2] perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX
@ 2018-09-04 10:58 Jin Yao
2018-09-04 7:13 ` Peter Zijlstra
0 siblings, 1 reply; 4+ messages in thread
From: Jin Yao @ 2018-09-04 10:58 UTC (permalink / raw)
To: acme, peterz, mingo, eranian, kan.liang, jolsa
Cc: Linux-kernel, ak, yao.jin, Jin Yao
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_iio
uncore_iio_0
uncore_iio_1
uncore_iio_2
uncore_iio_3
uncore_iio_4
uncore_iio_5
uncore_iio_free_running_0
uncore_iio_free_running_1
uncore_iio_free_running_2
uncore_iio_free_running_3
uncore_iio_free_running_4
uncore_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 elapsed
While 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_iio
uncore_iio_0
uncore_iio_1
uncore_iio_2
uncore_iio_3
uncore_iio_4
uncore_iio_5
uncore_iio_cbdma
uncore_iio_mcp0
uncore_iio_mcp1
uncore_iio_pcie0
uncore_iio_pcie1
uncore_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
v2:
---
Previously, it used braces around initialized string. For example,
{ "iio_cbdma" }.
The braces around scalar initializer would cause the build warning.
In v2, it removes the braces.
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
---
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(-)
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 27a4614..6c6615f 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -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);
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index e17ab88..db9fd9a 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -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;
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 51d7c11..75f14a3 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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 *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,
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX
2018-09-04 10:58 [PATCH v2] perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX Jin Yao
@ 2018-09-04 7:13 ` Peter Zijlstra
2018-09-04 7:45 ` Jin, Yao
0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2018-09-04 7:13 UTC (permalink / raw)
To: Jin Yao; +Cc: acme, mingo, eranian, kan.liang, jolsa, Linux-kernel, ak, yao.jin
On Tue, Sep 04, 2018 at 06:58:17PM +0800, Jin Yao wrote:
> root@skx /sys/devices# ls | grep uncore_iio
> uncore_iio_0
> uncore_iio_1
> uncore_iio_2
> uncore_iio_3
> uncore_iio_4
> uncore_iio_5
> uncore_iio_free_running_0
> uncore_iio_free_running_1
> uncore_iio_free_running_2
> uncore_iio_free_running_3
> uncore_iio_free_running_4
> uncore_iio_free_running_5
> root@skx /sys/devices# ls | grep uncore_iio
> uncore_iio_0
> uncore_iio_1
> uncore_iio_2
> uncore_iio_3
> uncore_iio_4
> uncore_iio_5
> uncore_iio_cbdma
> uncore_iio_mcp0
> uncore_iio_mcp1
> uncore_iio_pcie0
> uncore_iio_pcie1
> uncore_iio_pcie2
I think I'm ok with that, except of course for people that have
"free_running_#" in their scripts now and will to wtf when they upgrade
their kernel.
Do we care about them?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX
2018-09-04 7:13 ` Peter Zijlstra
@ 2018-09-04 7:45 ` Jin, Yao
2018-09-10 6:08 ` Jin, Yao
0 siblings, 1 reply; 4+ messages in thread
From: Jin, Yao @ 2018-09-04 7:45 UTC (permalink / raw)
To: Peter Zijlstra
Cc: acme, mingo, eranian, kan.liang, jolsa, Linux-kernel, ak, yao.jin
On 9/4/2018 3:13 PM, Peter Zijlstra wrote:
> On Tue, Sep 04, 2018 at 06:58:17PM +0800, Jin Yao wrote:
>> root@skx /sys/devices# ls | grep uncore_iio
>> uncore_iio_0
>> uncore_iio_1
>> uncore_iio_2
>> uncore_iio_3
>> uncore_iio_4
>> uncore_iio_5
>> uncore_iio_free_running_0
>> uncore_iio_free_running_1
>> uncore_iio_free_running_2
>> uncore_iio_free_running_3
>> uncore_iio_free_running_4
>> uncore_iio_free_running_5
>
>> root@skx /sys/devices# ls | grep uncore_iio
>> uncore_iio_0
>> uncore_iio_1
>> uncore_iio_2
>> uncore_iio_3
>> uncore_iio_4
>> uncore_iio_5
>> uncore_iio_cbdma
>> uncore_iio_mcp0
>> uncore_iio_mcp1
>> uncore_iio_pcie0
>> uncore_iio_pcie1
>> uncore_iio_pcie2
>
> I think I'm ok with that, except of course for people that have
> "free_running_#" in their scripts now and will to wtf when they upgrade
> their kernel.
>
> Do we care about them?
>
Yes, that may be a potential issue but maybe it's not since we really
don't know if some people have used uncore_iio_free_running_# in their
scripts or not.
I write this patch is because I always forget the meaning of
uncore_iio_free_running_# so I have to go back to check the document
"Intel Xeon Processor Scalable Memory Family Uncore Performance
Monitoring" again and again to find the box definition. I guess other
people may have similar trouble.
Maybe we wait some time to see more feedback from community?
Thanks
Jin Yao
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX
2018-09-04 7:45 ` Jin, Yao
@ 2018-09-10 6:08 ` Jin, Yao
0 siblings, 0 replies; 4+ messages in thread
From: Jin, Yao @ 2018-09-10 6:08 UTC (permalink / raw)
To: Peter Zijlstra
Cc: acme, mingo, eranian, kan.liang, jolsa, Linux-kernel, ak, yao.jin
One week nearly passed, I guess there is no any objections for this
patch from community. :)
Thanks
Jin Yao
On 9/4/2018 3:45 PM, Jin, Yao wrote:
>
>
> On 9/4/2018 3:13 PM, Peter Zijlstra wrote:
>> On Tue, Sep 04, 2018 at 06:58:17PM +0800, Jin Yao wrote:
>>> root@skx /sys/devices# ls | grep uncore_iio
>>> uncore_iio_0
>>> uncore_iio_1
>>> uncore_iio_2
>>> uncore_iio_3
>>> uncore_iio_4
>>> uncore_iio_5
>>> uncore_iio_free_running_0
>>> uncore_iio_free_running_1
>>> uncore_iio_free_running_2
>>> uncore_iio_free_running_3
>>> uncore_iio_free_running_4
>>> uncore_iio_free_running_5
>>
>>> root@skx /sys/devices# ls | grep uncore_iio
>>> uncore_iio_0
>>> uncore_iio_1
>>> uncore_iio_2
>>> uncore_iio_3
>>> uncore_iio_4
>>> uncore_iio_5
>>> uncore_iio_cbdma
>>> uncore_iio_mcp0
>>> uncore_iio_mcp1
>>> uncore_iio_pcie0
>>> uncore_iio_pcie1
>>> uncore_iio_pcie2
>>
>> I think I'm ok with that, except of course for people that have
>> "free_running_#" in their scripts now and will to wtf when they upgrade
>> their kernel.
>>
>> Do we care about them?
>>
>
> Yes, that may be a potential issue but maybe it's not since we really
> don't know if some people have used uncore_iio_free_running_# in their
> scripts or not.
>
> I write this patch is because I always forget the meaning of
> uncore_iio_free_running_# so I have to go back to check the document
> "Intel Xeon Processor Scalable Memory Family Uncore Performance
> Monitoring" again and again to find the box definition. I guess other
> people may have similar trouble.
>
> Maybe we wait some time to see more feedback from community?
>
> Thanks
> Jin Yao
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-10 6:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 10:58 [PATCH v2] perf/x86/intel/uncore: Provide alias for IIO free-running boxes on SKX Jin Yao
2018-09-04 7:13 ` Peter Zijlstra
2018-09-04 7:45 ` Jin, Yao
2018-09-10 6:08 ` Jin, Yao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome