From patchwork Wed Jul 3 03:27:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 168384 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp264256ilk; Tue, 2 Jul 2019 20:28:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFRiCpeyQ0fRA7Y7b72FsZSaVW9uW69Am9HIPsuRxJlHSbEQy/lkQraCq7vZu7g0F5DULL X-Received: by 2002:a17:902:d695:: with SMTP id v21mr36716024ply.342.1562124521778; Tue, 02 Jul 2019 20:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562124521; cv=none; d=google.com; s=arc-20160816; b=U8UFd8OzZ/cUTz1/H20n/0E0I4jVQKFPX/E4wJnLJMr/3yyAYqPkjdWivAkBDfuvqv HlY0ldWCVS/ygYaJwxd0z0NUp6jBblTRPPn3tnBDwjFkwv8FDHK80zdd92oYeBx9IQs3 m/5Pb2MrXAeKRAsfrTmj+tAKPiB8OX6YGArphkMLVvjkBXTq61g44uU6Qpk1izhvS4yS GaFJY39IkqB9yc7DjoSpwLQBGeqtteRxduZJzazuJn4+nrUSSfzHYiYXvoGts+ggoofN Y4LDdC1++kRVcE0RWmllMft42uiAC2z0DMtmH5AGEiIdFFTVr3/LLrheDhpTqsFBBFS6 ZBQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4ZwuxmyaiGxkPCQ5tOjOR6GGhVPj49jKzkInedL5S7o=; b=ogEAa/qF52iYmBahndv19qiuPvCtY3yeg0nS61HxqRFdoDOwJf9JbBEAmzTIdX8l9C 3Fn4OpqfzHUJAjHAoq1NGrJ3b+H/5vYyVZlh3U6BFL2GDF83NmmpsnNsVOgCNbE5SyFz XawUS9jAtFCG+Z55XaMIR3U0EGnILQxe+d6/Gz82aghto0HvZ/mPgTt3Ct9+QxwbxqoS rSIlgg9Gkh3sEgmT/KSn9GET+9zeIOOCxm7QtrZvw0+n+5LAsFWhVKmL9OYpRvFF52gm dmG3CDilCsk7Do7wGb4hmI3SpzTIXyZlqh2m0v62Y0wKMhY3ZQPTBxuYPgucRkFJOY3S gnPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bkDsVs7C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w198si873823pfd.106.2019.07.02.20.28.41; Tue, 02 Jul 2019 20:28:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bkDsVs7C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727478AbfGCD2j (ORCPT + 30 others); Tue, 2 Jul 2019 23:28:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:56672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbfGCD2i (ORCPT ); Tue, 2 Jul 2019 23:28:38 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.35.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9332B2189F; Wed, 3 Jul 2019 03:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562124516; bh=kh1htbmle8QuNO8L1oukcK+e54dA3anpyPlbs9vBagc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bkDsVs7CLtHxFfDemD59Sy0dhp9T1MQ93UXpPypJNEvqbhu36B4fpCp1/Xx3MYApm KTyq7lqvvqilYS8BNCp/rVox0+JKA3ltmhkfHQR0Yac3xsL9aA6uBhj4ZrZkri2FZO RI7/km5S2b4Wn9/Dov9J/AV/WPbPgTJBdQDud23E= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, John Garry , Alexander Shishkin , Andi Kleen , Ben Hutchings , Hendrik Brueckner , Kan Liang , Mark Rutland , Mathieu Poirier , Peter Zijlstra , Shaokun Zhang , Thomas Richter , Will Deacon , linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com, Arnaldo Carvalho de Melo Subject: [PATCH 10/18] perf jevents: Add support for Hisi hip08 DDRC PMU aliasing Date: Wed, 3 Jul 2019 00:27:38 -0300 Message-Id: <20190703032746.21692-11-acme@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190703032746.21692-1-acme@kernel.org> References: <20190703032746.21692-1-acme@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Garry Add support for Hisi hip08 DDRC PMU aliasing. We can now do something like this: $perf list [snip] uncore ddrc: uncore_hisi_ddrc.act_cmd [DDRC active commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.flux_rcmd [DDRC read commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.flux_wcmd [DDRC write commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.flux_wr [DDRC precharge commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.rnk_chg [DDRC rank commands. Unit: hisi_sccl,ddrc] uncore_hisi_ddrc.rw_chg [DDRC read and write changes. Unit: hisi_sccl,ddrc] Performance counter stats for 'system wide': 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc0] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc3] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc0] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc3] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc3] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc0] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl5_ddrc1] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl7_ddrc0] 20,421 uncore_hisi_ddrc.flux_rcmd [hisi_sccl1_ddrc2] 0 uncore_hisi_ddrc.flux_rcmd [hisi_sccl3_ddrc3] 1.001559011 seconds time elapsed The kernel driver is in drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c Signed-off-by: John Garry Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ben Hutchings Cc: Hendrik Brueckner Cc: Kan Liang Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Shaokun Zhang Cc: Thomas Richter Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linuxarm@huawei.com Link: http://lkml.kernel.org/r/1561732552-143038-3-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- .../arm64/hisilicon/hip08/uncore-ddrc.json | 44 +++++++++++++++++++ tools/perf/pmu-events/jevents.c | 1 + 2 files changed, 45 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json -- 2.20.1 diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json new file mode 100644 index 000000000000..0d1556fcdffe --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json @@ -0,0 +1,44 @@ +[ + { + "EventCode": "0x02", + "EventName": "uncore_hisi_ddrc.flux_wcmd", + "BriefDescription": "DDRC write commands", + "PublicDescription": "DDRC write commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x03", + "EventName": "uncore_hisi_ddrc.flux_rcmd", + "BriefDescription": "DDRC read commands", + "PublicDescription": "DDRC read commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x04", + "EventName": "uncore_hisi_ddrc.flux_wr", + "BriefDescription": "DDRC precharge commands", + "PublicDescription": "DDRC precharge commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x05", + "EventName": "uncore_hisi_ddrc.act_cmd", + "BriefDescription": "DDRC active commands", + "PublicDescription": "DDRC active commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x06", + "EventName": "uncore_hisi_ddrc.rnk_chg", + "BriefDescription": "DDRC rank commands", + "PublicDescription": "DDRC rank commands", + "Unit": "hisi_sccl,ddrc", + }, + { + "EventCode": "0x07", + "EventName": "uncore_hisi_ddrc.rw_chg", + "BriefDescription": "DDRC read and write changes", + "PublicDescription": "DDRC read and write changes", + "Unit": "hisi_sccl,ddrc", + }, +] diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index a1184ea64cc6..d5997741f1d8 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -236,6 +236,7 @@ static struct map { { "CPU-M-CF", "cpum_cf" }, { "CPU-M-SF", "cpum_sf" }, { "UPI LL", "uncore_upi" }, + { "hisi_sccl,ddrc", "hisi_sccl,ddrc" }, {} };