Thread (24 messages) 24 messages, 3 authors, 2021-02-03

Re: [PATCH 5/8] drivers/perf: hisi: Update DDRC PMU for programable counter

From: John Garry <hidden>
Date: 2021-01-26 12:36:15

On 31/12/2020 06:19, Shaokun Zhang wrote:
DDRC PMU's events are useful for performance profiling, but the events
are limited and counter is fixed. On HiSilicon Hip09 platform, PMU
counters are the programable and more events are supported. Let's
programmable
add the DDRC PMU v2 driver.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: John Garry <redacted>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Co-developed-by: Qi Liu <redacted>
Signed-off-by: Qi Liu <redacted>
Signed-off-by: Shaokun Zhang <redacted>
---
  drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 208 ++++++++++++++++++++++++--
  drivers/perf/hisilicon/hisi_uncore_pmu.h      |   2 +
  2 files changed, 197 insertions(+), 13 deletions(-)
generally looks ok, but ...
quoted hunk ↗ jump to hunk
  }
@@ -332,8 +506,16 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev)
  		return ret;
  	}
  
-	name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_ddrc%u",
-			      ddrc_pmu->sccl_id, ddrc_pmu->index_id);
+	if (ddrc_pmu->identifier >= HISI_PMU_V2)
+		name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+				      "hisi_sccl%u_ddrc%u_%u",
+				      ddrc_pmu->sccl_id, ddrc_pmu->index_id,
+				      ddrc_pmu->sub_id);
I don't think perf can support event aliasing in this format 
(hisi_scclX_Y_Z), but I need to double-check.
quoted hunk ↗ jump to hunk
+	else
+		name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+				      "hisi_sccl%u_ddrc%u", ddrc_pmu->sccl_id,
+				      ddrc_pmu->index_id);
+
  	ddrc_pmu->pmu = (struct pmu) {
  		.name		= name,
  		.module		= THIS_MODULE,
@@ -346,7 +528,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev)
  		.start		= hisi_uncore_pmu_start,
  		.stop		= hisi_uncore_pmu_stop,
  		.read		= hisi_uncore_pmu_read,
-		.attr_groups	= hisi_ddrc_pmu_v1_attr_groups,
+		.attr_groups	= ddrc_pmu->pmu_events.attr_groups,
  		.capabilities	= PERF_PMU_CAP_NO_EXCLUDE,
  	};
  
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help