From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94388C433ED for ; Wed, 7 Apr 2021 06:06:01 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CF0261074 for ; Wed, 7 Apr 2021 06:06:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CF0261074 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3bgZZphEmjeXQMCkC6rFYhU9256N2KkjX2y/CHm4mvE=; b=eHGo07h81+Xs62NpJQKjXekoz 0PNBA0wKlpgTXkskV5GPRbzHlnOKt9d3iB33Am7dTrEak8TTTT4X8LI8TyscLiefKuYhrROW1tHX2 AgqpuKHWVdkD3HdpBTgjxPcxfgRTsCqr2JZEC1hoSE0Sr+vAqz3w1C+dVui34Ip1lfIKT2YhhfUiB XfVf24QLgtEUyYdwIgzAEa78NLBWZQUt2ZmmknUJfTuCFRGkCNjgmXFYyw9ZPq0rL6pfdqviZxk4r z50sLWVcXHB+A4793r0fyoBMxyq6FftXSV8sY4ZDMLuxjpCdNBnTv+HcMCHYDOSmSwL/IJ1xWkIw3 htVnW4JAg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lU1IK-004AbV-Qe; Wed, 07 Apr 2021 06:04:05 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lU1IA-004AZx-1o for linux-arm-kernel@lists.infradead.org; Wed, 07 Apr 2021 06:03:58 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13763Xc8136836; Wed, 7 Apr 2021 02:03:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=fgSM9VG2hQh2qvQnn86DImQ6ivuulGNLQgRNU6MUvjY=; b=VjU1HoBW+pKZJ1+QVJPi8sU+g9Vwf7vGuJArbnpfYHFWmjuVDWSqEHO42QqQF0GI55BT a8QNfEx8MMkgc4YsbwicBamLxh3vBUIdR04g7eJsOilIpPXJuSPdG7VnHFlUiUf6aRu0 5CIhu49H3TEDe6HI8O4NoBkGVGVb8TEiOU/CC7K3xajuxwxCzmqZwO5lr4TDWPaV9Jlg Iqq9L/mv3yUf/9FozlAUPx++469SYmCFF0byKP5WVWby1cyxBKDps25lE3FQE8k9+l9G zHmdldN5wWgcN4pUuwWeITGxZ+k8AK1m4wSNcB1ymay9YxmBV4DEDx/aJZv+CS/DBRpI nw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 37rvumdbku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Apr 2021 02:03:37 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 13763Z8v136951; Wed, 7 Apr 2021 02:03:35 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 37rvumdbha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Apr 2021 02:03:35 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1375wF6Q018093; Wed, 7 Apr 2021 06:03:28 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01wdc.us.ibm.com with ESMTP id 37rvgs3dv1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Apr 2021 06:03:28 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 13763Rx131981900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Apr 2021 06:03:27 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A8AE6A05D; Wed, 7 Apr 2021 06:03:27 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12DE86A05A; Wed, 7 Apr 2021 06:03:20 +0000 (GMT) Received: from localhost.localdomain (unknown [9.199.37.220]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 7 Apr 2021 06:03:20 +0000 (GMT) Subject: Re: [PATCH v2 0/6] perf arm64 metricgroup support To: John Garry , will@kernel.org, mathieu.poirier@linaro.org, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, irogers@google.com Cc: linuxarm@huawei.com, kan.liang@linux.intel.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, zhangshaokun@hisilicon.com, pc@us.ibm.com References: <1616668398-144648-1-git-send-email-john.garry@huawei.com> From: kajoljain Message-ID: <0c8379f9-c073-ebf8-5335-812f9b30c6cd@linux.ibm.com> Date: Wed, 7 Apr 2021 11:33:19 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: <1616668398-144648-1-git-send-email-john.garry@huawei.com> Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-GUID: pK0YpwXU1-M7yjhphJqdkgDQqQzdsny9 X-Proofpoint-ORIG-GUID: GegICzjJSQgsIyyxkijbjVD-t7HT2oZt X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-04-07_03:2021-04-06, 2021-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 lowpriorityscore=0 bulkscore=0 impostorscore=0 mlxscore=0 clxscore=1015 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104070044 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210407_070354_815179_32F91DA5 X-CRM114-Status: GOOD ( 26.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 3/25/21 4:03 PM, John Garry wrote: > This series contains support to get basic metricgroups working for > arm64 CPUs. > > Initial support is added for HiSilicon hip08 platform. > > Some sample usage on Huawei D06 board: > > $ ./perf list metric > > List of pre-defined events (to be used in -e): > > Metrics: > > bp_misp_flush > [BP misp flush L3 topdown metric] > branch_mispredicts > [Branch mispredicts L2 topdown metric] > core_bound > [Core bound L2 topdown metric] > divider > [Divider L3 topdown metric] > exe_ports_util > [EXE ports util L3 topdown metric] > fetch_bandwidth_bound > [Fetch bandwidth bound L2 topdown metric] > fetch_latency_bound > [Fetch latency bound L2 topdown metric] > fsu_stall > [FSU stall L3 topdown metric] > idle_by_icache_miss > > $ sudo ./perf stat -v -M core_bound sleep 1 > Using CPUID 0x00000000480fd010 > metric expr (exe_stall_cycle - (mem_stall_anyload + armv8_pmuv3_0@event\=0x7005@)) / cpu_cycles for core_bound > found event cpu_cycles > found event armv8_pmuv3_0/event=0x7005/ > found event exe_stall_cycle > found event mem_stall_anyload > adding {cpu_cycles -> armv8_pmuv3_0/event=0x7001/ > mem_stall_anyload -> armv8_pmuv3_0/event=0x7004/ > Control descriptor is not initialized > cpu_cycles: 989433 385050 385050 > armv8_pmuv3_0/event=0x7005/: 19207 385050 385050 > exe_stall_cycle: 900825 385050 385050 > mem_stall_anyload: 253516 385050 385050 > > Performance counter stats for 'sleep': > > 989,433 cpu_cycles # 0.63 core_bound > 19,207 armv8_pmuv3_0/event=0x7005/ > 900,825 exe_stall_cycle > 253,516 mem_stall_anyload > > 0.000805809 seconds time elapsed > > 0.000875000 seconds user > 0.000000000 seconds sys > > perf stat --topdown is not supported, as this requires the CPU PMU to > expose (alias) events for the TopDown L1 metrics from sysfs, which arm > does not do. To get that to work, we probably need to make perf use the > pmu-events cpumap to learn about those alias events. > > Metric reuse support is added for pmu-events parse metric testcase. > This had been broken on power9 recentlty: > https://lore.kernel.org/lkml/20210324015418.GC8931@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com/ Patch set looks good to me. Reviewed-By: Kajol Jain Thanks, Kajol jain > > Differences to v1: > - Add pmu_events_map__find() as arm64-specific function > - Fix metric reuse for pmu-events parse metric testcase > > John Garry (6): > perf metricgroup: Make find_metric() public with name change > perf test: Handle metric reuse in pmu-events parsing test > perf pmu: Add pmu_events_map__find() > perf vendor events arm64: Add Hisi hip08 L1 metrics > perf vendor events arm64: Add Hisi hip08 L2 metrics > perf vendor events arm64: Add Hisi hip08 L3 metrics > > tools/perf/arch/arm64/util/Build | 1 + > tools/perf/arch/arm64/util/pmu.c | 25 ++ > .../arch/arm64/hisilicon/hip08/metrics.json | 233 ++++++++++++++++++ > tools/perf/tests/pmu-events.c | 82 +++++- > tools/perf/util/metricgroup.c | 12 +- > tools/perf/util/metricgroup.h | 3 +- > tools/perf/util/pmu.c | 5 + > tools/perf/util/pmu.h | 1 + > tools/perf/util/s390-sample-raw.c | 4 +- > 9 files changed, 355 insertions(+), 11 deletions(-) > create mode 100644 tools/perf/arch/arm64/util/pmu.c > create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip08/metrics.json > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel