2018-06-06 21:18:05

by Hoan Tran

[permalink] [raw]
Subject: [PATCH] perf: xgene: Fix IOB SLOW PMU parser error

This patch fixes the below parser error of the IOB SLOW PMU.

# perf stat -a -e iob-slow0/cycle-count/ sleep 1
evenf syntax error: 'iob-slow0/cycle-count/'
\___ parser error

It replaces the "-" character by "_" character inside the PMU name.

Signed-off-by: Hoan Tran <[email protected]>
---
drivers/perf/xgene_pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c
index 6bdb1da..0e31f13 100644
--- a/drivers/perf/xgene_pmu.c
+++ b/drivers/perf/xgene_pmu.c
@@ -1463,7 +1463,7 @@ static char *xgene_pmu_dev_name(struct device *dev, u32 type, int id)
case PMU_TYPE_IOB:
return devm_kasprintf(dev, GFP_KERNEL, "iob%d", id);
case PMU_TYPE_IOB_SLOW:
- return devm_kasprintf(dev, GFP_KERNEL, "iob-slow%d", id);
+ return devm_kasprintf(dev, GFP_KERNEL, "iob_slow%d", id);
case PMU_TYPE_MCB:
return devm_kasprintf(dev, GFP_KERNEL, "mcb%d", id);
case PMU_TYPE_MC:
--
2.7.4



2018-06-07 16:03:29

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] perf: xgene: Fix IOB SLOW PMU parser error

On Wed, Jun 06, 2018 at 02:06:54PM -0700, Hoan Tran wrote:
> This patch fixes the below parser error of the IOB SLOW PMU.
>
> # perf stat -a -e iob-slow0/cycle-count/ sleep 1
> evenf syntax error: 'iob-slow0/cycle-count/'
> \___ parser error
>
> It replaces the "-" character by "_" character inside the PMU name.
>
> Signed-off-by: Hoan Tran <[email protected]>

Hmm, why did you only notice this now? :(

Anyway, whilst this could in theory break something, we did this for the CPU
PMUs in the past without issues so I'll pick this up.

Cheers,

Will