From patchwork Wed Jul 3 03:27:37 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: 168383 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp264152ilk; Tue, 2 Jul 2019 20:28:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqybV8GtIfNpn7Xp02voYO6LTZjUxso1qzWijVMlp+sitTYoaKbjXSJMro18jec05k2cyUzQ X-Received: by 2002:a17:90a:7d09:: with SMTP id g9mr9468005pjl.38.1562124514785; Tue, 02 Jul 2019 20:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562124514; cv=none; d=google.com; s=arc-20160816; b=yoekSs+3EvV+Zcsl13RIEatGispsE4p0wp1w4xmLttolFmkH27tDiT9tR+Qb6NgspA sXvyyQq04s43fHOT9qLGC5nYNATbKMSwCsyWtktv8DKJBnmxc+7/7DzBVNMcSUFMW5W6 jsKUDdGAjJPpsPJyUzsOze/ag+xTVPQZQDW8YkvZonDpapBdVtnz9TlBw2NDp+ku0V4b iI5g6CKEB8PsCUdsdPLYvfqK9bSNPxhufeeWzYEYnU0mTvZQgvkDCMPvAbsfWo3N4+vv BjiqX+SnI0p60Qi01VImt3GaqHZTfouf+O6f25k7MJmLg5KrV1KcLTh0NP4P0GqtCD6X Q0nA== 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=1sFfCto5ppMxlOEWQ6XrV9eJ6bq104fTCAcugQQB2XY=; b=iGrKoM0NJZ7EK0fn0liiqn78hR4gfhYIIsHrzRrY/0BmsnGMwdUQrjpOABxASastGj SuUVSbD+o4u3xO+PS+ze7dbSktUUPSnNRkSWL3HZHzCVXRy64gzRdQkxcWWd9uNyZrKQ QKOULT01qgPRvIVzaQkGJCpFiEAaKMw6Pn7HYrsIqMeUD+MC9iHHW2f6qwWmVAt6BSPR 8L0pnlJEBKYdgud7B7xk2ypN3XHyGX/onQ9Uo7p0+AEqlhBbaAF+gUmHR7XnPpLIQ704 +PyrKQ8qgRaESkzII3ChlTKG3rmxicBUxLpSVkAOxk43Eo78vby9749bCnRtpZRb9mWU YpPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WoJa7Iru; 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 66si862407pld.6.2019.07.02.20.28.34; Tue, 02 Jul 2019 20:28:34 -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=WoJa7Iru; 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 S1727465AbfGCD2d (ORCPT + 30 others); Tue, 2 Jul 2019 23:28:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:56540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727373AbfGCD2b (ORCPT ); Tue, 2 Jul 2019 23:28:31 -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 0BD4621850; Wed, 3 Jul 2019 03:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562124511; bh=E5HWvXZgTeSKHxIKhqZ/E3l3wGCI1IPSGpHB2y/QAV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WoJa7Iru2ljQE3R5Dx237lQe4g8tSPMFcFlQpuAmUygJ1ue3RnuBbQc4o5HoVJX+L SOihDqDB/DX22YgJFZO3OjPBav1B6kphrS6Tmaf5InsVmiyXN+CbnMtAKqhlKFeGvs KvG8grMKIJlw59KW4m6NXwhHJKdboRhAq9d3j3Y8= 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 09/18] perf pmu: Support more complex PMU event aliasing Date: Wed, 3 Jul 2019 00:27:37 -0300 Message-Id: <20190703032746.21692-10-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 The jevent "Unit" field is used for uncore PMU alias definition. The form uncore_pmu_example_X is supported, where "X" is a wildcard, to support multiple instances of the same PMU in a system. Unfortunately this format not suitable for all uncore PMUs; take the Hisi DDRC uncore PMU for example, where the name is in the form hisi_scclX_ddrcY. For for current jevent parsing, we would be required to hardcode an uncore alias translation for each possible value of X. This is not scalable. Instead, add support for "Unit" field in the form "hisi_sccl,ddrc", where we can match by hisi_scclX and ddrcY. Tokens in Unit field are delimited by ','. 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-2-git-send-email-john.garry@huawei.com [ Shut up older gcc complianing about the last arg to strtok_r() being uninitialized, set that tmp to NULL ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/pmu.c | 46 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 8139a1f3ed39..55f4de6442e3 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -701,6 +701,46 @@ struct pmu_events_map *perf_pmu__find_map(struct perf_pmu *pmu) return map; } +static bool pmu_uncore_alias_match(const char *pmu_name, const char *name) +{ + char *tmp = NULL, *tok, *str; + bool res; + + str = strdup(pmu_name); + if (!str) + return false; + + /* + * uncore alias may be from different PMU with common prefix + */ + tok = strtok_r(str, ",", &tmp); + if (strncmp(pmu_name, tok, strlen(tok))) { + res = false; + goto out; + } + + /* + * Match more complex aliases where the alias name is a comma-delimited + * list of tokens, orderly contained in the matching PMU name. + * + * Example: For alias "socket,pmuname" and PMU "socketX_pmunameY", we + * match "socket" in "socketX_pmunameY" and then "pmuname" in + * "pmunameY". + */ + for (; tok; name += strlen(tok), tok = strtok_r(NULL, ",", &tmp)) { + name = strstr(name, tok); + if (!name) { + res = false; + goto out; + } + } + + res = true; +out: + free(str); + return res; +} + /* * From the pmu_events_map, find the table of PMU events that corresponds * to the current running CPU. Then, add all PMU events from that table @@ -731,12 +771,8 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu) break; } - /* - * uncore alias may be from different PMU - * with common prefix - */ if (pmu_is_uncore(name) && - !strncmp(pname, name, strlen(pname))) + pmu_uncore_alias_match(pname, name)) goto new_alias; if (strcmp(pname, name)) 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" }, {} }; From patchwork Wed Jul 3 03:27:39 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: 168385 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp264323ilk; Tue, 2 Jul 2019 20:28:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC++LKs1HmurAWiByzq2mE4ys1U52u26pRpysQfcX1MAvjT9qVfFj2NXKRvJKXgyAGz43k X-Received: by 2002:a17:902:124:: with SMTP id 33mr40271614plb.145.1562124527231; Tue, 02 Jul 2019 20:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562124527; cv=none; d=google.com; s=arc-20160816; b=S9kBZsGsAOs5M40RJ2RWD/SUMK7GFU/9VO0qBYBIhBAuhRigsEw7zPeV+f2a1rmpoo unLd4f9Y+PSZ5Xpytn4/jDawLAIeloeTD+FGQGAL8dU6K69fLXQ7DYFfdvHDqZ+ngjtN pGdCULtQa7ukiESYQ0aHfQRmdITfx3VJZcV6+k09XtBa7Ks+unmCTUUOJAPvvnPTub4v LgFSykOnDrdret4aFHQ6R50cNb2wKlD6mfl//44QpbIiCrN6jiEIpj7pAT8wH7T7KMpY W531x7Nz7LdAviJQSZEIBqqIAsvB/Hate35ivhPYS3iHIM/eoSx8PtAai3rHdfYCepyB SFQg== 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=C1sjge0NiqjBYc3uOByNW1FO57V593jq0SvertOKBlg=; b=FeplHY6CsIQJQM4eGGnCqjRaQoGsbqEl7Rd4lvLF7BntsI44KvZTJkp+YWrMFdESIb kh9qHgiM6U9MrhyQj45rTgMa1bMgJraFZnRw5Ddmnyc+BLEKgMhAOPOYT9jRc7neFh/y yoC7XCm3VrizlG9ZKZ9+7XNR/Jbf+tUQ23VjuX3C7g00o5X+EwnxMpCanQFahLjuksg9 AxcTD9PXxF4kpiFpv87ItD3B5Cimtf0xDlJbUoJrTQVzQDrafcF/V633Up1jimyMnxSO jRzaVDn6HvrYHUn4SN3Y4B7RDucncIYTG4SFa22J07a9s0rODc47LU2xt7Zsd/2p//66 EoNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hTsdmzk5; 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 z5si827089pgj.213.2019.07.02.20.28.46; Tue, 02 Jul 2019 20:28:47 -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=hTsdmzk5; 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 S1727491AbfGCD2p (ORCPT + 30 others); Tue, 2 Jul 2019 23:28:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbfGCD2n (ORCPT ); Tue, 2 Jul 2019 23:28:43 -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 3CDA721871; Wed, 3 Jul 2019 03:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562124522; bh=tZLkWUbJxdjBzLDOtb7oGoyrSTWXiNWz3O80bNiycRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hTsdmzk5NspOexFltziqEamAPWDZDN2LAfDqpWbGFBKPrU2+kB79VjiYejv4NFSJD YOoIr+WqsBrFjbj0kAQc9omDgu+xAgRmGnFx0JxeqtMSS+YU3tbQA5KRlznr9c6azE SVW4p/9km/6M7F6dZHkwHLhOvtkZ7FJaztul/TV4= 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 11/18] perf jevents: Add support for Hisi hip08 HHA PMU aliasing Date: Wed, 3 Jul 2019 00:27:39 -0300 Message-Id: <20190703032746.21692-12-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 HHA PMU aliasing. The kernel driver is in drivers/perf/hisilicon/hisi_uncore_hha_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-4-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- .../arm64/hisilicon/hip08/uncore-hha.json | 51 +++++++++++++++++++ tools/perf/pmu-events/jevents.c | 1 + 2 files changed, 52 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json -- 2.20.1 diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json new file mode 100644 index 000000000000..447d3064de90 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json @@ -0,0 +1,51 @@ +[ + { + "EventCode": "0x00", + "EventName": "uncore_hisi_hha.rx_ops_num", + "BriefDescription": "The number of all operations received by the HHA", + "PublicDescription": "The number of all operations received by the HHA", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x01", + "EventName": "uncore_hisi_hha.rx_outer", + "BriefDescription": "The number of all operations received by the HHA from another socket", + "PublicDescription": "The number of all operations received by the HHA from another socket", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x02", + "EventName": "uncore_hisi_hha.rx_sccl", + "BriefDescription": "The number of all operations received by the HHA from another SCCL in this socket", + "PublicDescription": "The number of all operations received by the HHA from another SCCL in this socket", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1c", + "EventName": "uncore_hisi_hha.rd_ddr_64b", + "BriefDescription": "The number of read operations sent by HHA to DDRC which size is 64 bytes", + "PublicDescription": "The number of read operations sent by HHA to DDRC which size is 64bytes", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1d", + "EventName": "uncore_hisi_hha.wr_dr_64b", + "BriefDescription": "The number of write operations sent by HHA to DDRC which size is 64 bytes", + "PublicDescription": "The number of write operations sent by HHA to DDRC which size is 64 bytes", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1e", + "EventName": "uncore_hisi_hha.rd_ddr_128b", + "BriefDescription": "The number of read operations sent by HHA to DDRC which size is 128 bytes", + "PublicDescription": "The number of read operations sent by HHA to DDRC which size is 128 bytes", + "Unit": "hisi_sccl,hha", + }, + { + "EventCode": "0x1f", + "EventName": "uncore_hisi_hha.wr_ddr_128b", + "BriefDescription": "The number of write operations sent by HHA to DDRC which size is 128 bytes", + "PublicDescription": "The number of write operations sent by HHA to DDRC which size is 128 bytes", + "Unit": "hisi_sccl,hha", + }, +] diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index d5997741f1d8..3c95affd85a4 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -237,6 +237,7 @@ static struct map { { "CPU-M-SF", "cpum_sf" }, { "UPI LL", "uncore_upi" }, { "hisi_sccl,ddrc", "hisi_sccl,ddrc" }, + { "hisi_sccl,hha", "hisi_sccl,hha" }, {} }; From patchwork Wed Jul 3 03:27:40 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: 168386 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp264394ilk; Tue, 2 Jul 2019 20:28:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqysT9jW5lt/xJVYCxexDcuYIN3pchaxpO2OlKFQ+0tB4OIJ0ngLU3eyu6eT7FOCxZwQ0Q22 X-Received: by 2002:a17:90a:db08:: with SMTP id g8mr9301587pjv.39.1562124532435; Tue, 02 Jul 2019 20:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562124532; cv=none; d=google.com; s=arc-20160816; b=BUQrcm4lJn7cin91HjxX83/fuZ54cJJnlKyJt/xBVScfZj1QZ+MPYl02KywZZUFa+1 nB25MC7+VUojN2/sRuujoow7ewkIl/Io6kl/Syvt/uNbEWjU6IphBi0pt33Ki2o4JN8S 4HsKi3BPljalYwxxpXAOhL56E2ViNGk0KEQ+D7sPbxwveLZRWwBNlTdkTita6pdyBNM7 qTFNRgL0gqu5HnnB56lfknkgso+lzFDtoI8yAgn3SBhISFEfQFs+uSSkJKjE5EG+vpdm Ayep502ZZqdrXjW77ZomqXMMsKwEJ3JYpfMZaNG4hZhHP8GESc+fbFuM5NENN505t/YS qTwQ== 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=FFNPTOIA3yPtydA+JgqJyYev3JRM1lrnf71OiogWmNs=; b=VC2aidMJ+65j80SeL1gbN4kCeqcAZ8ZE76Pg0mOx7fpACX4jJpc72pbGlaWJo4AUas 2kxYS9j+8Zu55UK+GJKz35BXnYNRIjSJDXEfjUNDLzKzHP0qRpSBTT0PLwFKKdgg0Y5M k/3sO0jqN4WFkv+MItfHc+B1ckY5H3v2KR6Xqr7uBr8qSQMch6m6tSYAapXxrVFcFJ8D pUozIcPrM6l0LRpBGgwpRpPy95jziAwSqRr8oTAKE7grSdNgWda0/lvMCPlTNOphify4 FA0OX488rKG9PNhAFz4XknhR/DLDDzPccPx9AlHvGKp44EUlfOs5+RC5RONiEBySGlFZ 7/Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yhVU4TLv; 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 j3si767703pfh.178.2019.07.02.20.28.52; Tue, 02 Jul 2019 20:28:52 -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=yhVU4TLv; 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 S1727505AbfGCD2u (ORCPT + 30 others); Tue, 2 Jul 2019 23:28:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:56936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbfGCD2t (ORCPT ); Tue, 2 Jul 2019 23:28:49 -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 E0E8A2054F; Wed, 3 Jul 2019 03:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562124528; bh=nthMXQ3xh+asFOhNhIIr70OPlb+T7ky2twljPY3/cu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yhVU4TLvyiYE7snWZ9UV7SShlP8iqMHzcmS9xC+VLj3Y9qL1TiAZ5Z4D8LY3rrFI/ HeqY4jtRH7bVz/TWJrynDKQp/te98uoHWq4WvefyA+Xmlg+DXR3bklDR9l/vJ/G/tL ODznBju2AHrZaoDGgrCdkgLTzurr2JI/NOQQM/y8= 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 12/18] perf jevents: Add support for Hisi hip08 L3C PMU aliasing Date: Wed, 3 Jul 2019 00:27:40 -0300 Message-Id: <20190703032746.21692-13-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 L3C PMU aliasing. The kernel driver is in drivers/perf/hisilicon/hisi_uncore_l3c_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-5-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- .../arm64/hisilicon/hip08/uncore-l3c.json | 37 +++++++++++++++++++ tools/perf/pmu-events/jevents.c | 1 + 2 files changed, 38 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json -- 2.20.1 diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json new file mode 100644 index 000000000000..ca48747642e1 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json @@ -0,0 +1,37 @@ +[ + { + "EventCode": "0x00", + "EventName": "uncore_hisi_l3c.rd_cpipe", + "BriefDescription": "Total read accesses", + "PublicDescription": "Total read accesses", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x01", + "EventName": "uncore_hisi_l3c.wr_cpipe", + "BriefDescription": "Total write accesses", + "PublicDescription": "Total write accesses", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x02", + "EventName": "uncore_hisi_l3c.rd_hit_cpipe", + "BriefDescription": "Total read hits", + "PublicDescription": "Total read hits", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x03", + "EventName": "uncore_hisi_l3c.wr_hit_cpipe", + "BriefDescription": "Total write hits", + "PublicDescription": "Total write hits", + "Unit": "hisi_sccl,l3c", + }, + { + "EventCode": "0x04", + "EventName": "uncore_hisi_l3c.victim_num", + "BriefDescription": "l3c precharge commands", + "PublicDescription": "l3c precharge commands", + "Unit": "hisi_sccl,l3c", + }, +] diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index 3c95affd85a4..287a6f10ca48 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -238,6 +238,7 @@ static struct map { { "UPI LL", "uncore_upi" }, { "hisi_sccl,ddrc", "hisi_sccl,ddrc" }, { "hisi_sccl,hha", "hisi_sccl,hha" }, + { "hisi_sccl,l3c", "hisi_sccl,l3c" }, {} };