Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp272120rdb; Wed, 17 Jan 2024 01:05:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjnGIrtjmudWHuTOCm69cUUKTQeH6dy7BIxt7lrbvBM2pNkXg7a2Bb33N1slxAe2bAttMU X-Received: by 2002:a17:902:a3cb:b0:1d6:f139:cc20 with SMTP id q11-20020a170902a3cb00b001d6f139cc20mr320169plb.32.1705482357174; Wed, 17 Jan 2024 01:05:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705482357; cv=pass; d=google.com; s=arc-20160816; b=w9cL65LZCXmeYb8gIm+rXrMZEAMdfvrkdN3knLNf2T5bIGqh7cdwRRvluI4wnVDAWw i/6sF5PmNWYDGd3mZAC5EzUK82Xrau4cJkQgzSdhmu1jqBz3JUMAHUSUv3/2udCFmv+S 1ALh0XA3jII4cHYH374ymCQXzQ2Z7P41JmpwQ8XSAj76pX/4/jo/9SYrrVGb0TcmBfrz +PeyjB8PyimtR1IAilaWpgDsQPXovyMgJNd8Rnoep3OAco0xxboKLRXzX4YDZNI4nq9N d2erlZFVfex8M7Pv+7ZMNoaa8V/0sx6fKL9747NSfpTIGr3KJYTUscCQDp72Hplvq85d v4/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=Na6ZLyqkS87VZqGjwgTBW1vWcihBAu02ZyqZd7seecA=; fh=4lcZ/fyLjgYf3993aBGLC2lHeeig36kp1yXsCnb4rxQ=; b=NEsvls9qhAHzJNrOR4kNFsjFhND1pEhGCsP38TghS1G30gmyXZ9smw+XMW+GbnN1yt 3RHBZdUtB1i3MinMLmw2hsflaYylJ0tkXIYG13ptnDgiF2KPH71IWT6uF/6C5VXq5R8q V2rf40kGI4HqbTT8NuNEUrHxANtfzjbH1L381u/9VSCeLZuwW5CzXd9zXm209giTgtWx OKNbubl24bPY8zTBK/G5SwsdDLUWK6j41tcWIV+k06yVlysOBKpX4LNBEH8HkWn8dmML 0KMTTe6oXPcnzdUBmv7Y471aja4BJWjb9PQYCuyKPqaitUptkeE9vm3z9PPB1Rqsg3W+ yrug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CCaJdEiz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-28689-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id kg12-20020a170903060c00b001d4401d476fsi12661564plb.3.2024.01.17.01.05.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 01:05:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28689-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CCaJdEiz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-28689-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6F4562813B6 for ; Wed, 17 Jan 2024 09:05:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A1CC134BC; Wed, 17 Jan 2024 09:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CCaJdEiz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0E4D13FEB; Wed, 17 Jan 2024 09:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705482329; cv=none; b=aBgvWQF8RdNFnIqLazCe8NRSK4b0r6EtLXHlaoWUTMRD3AydowMdR2X81ua59qcphXDzW5ZBNz3fMJAuGe9pDuup2x+Fd6XxKROUV4tk/TYU8ZU+7RR23BGmykvGFkNAqZeOssygdQ6Td4SO2n9ENLe1rW86zs09PFv0jbiwDOw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705482329; c=relaxed/simple; bh=QjVZzgsoUCIQOhRoRyHOoQyDEOaOpNj7mno8pFnCy3c=; h=Received:DKIM-Signature:Received:Date:Message-ID:From:To:Cc: Subject:In-Reply-To:References:User-Agent:MIME-Version: Content-Type:X-SA-Exim-Connect-IP:X-SA-Exim-Rcpt-To: X-SA-Exim-Mail-From:X-SA-Exim-Scanned; b=lkPvI43QeiddspAfAILUR6V6TGZSTjlHOoQ4fOh7eMtIjs04iL+d6n7Dec152/faGw8xQQkfVC0ozV51ZAAR6wjmf5dfF837TRLV4A9pyau327FfYazXzKgCoSRTjIedbhIlmnkb5hTgAKUXC9Qk90zdAkE/vd+bLFpulyKHOdw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CCaJdEiz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36C63C433C7; Wed, 17 Jan 2024 09:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705482329; bh=QjVZzgsoUCIQOhRoRyHOoQyDEOaOpNj7mno8pFnCy3c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CCaJdEiz9sEN3YsVzKpzPy+g/kw6UwNviLrMNVL62CeC6ug+Li0OtXwrJ6yWvTnTd I9r8+xPrgoSzhejU/0sIYT41ah6cKHSj4jUyF+hNnioBh3xskm1dwh39hs29j3f3pS wuM6uy/IEtsMX24fd4H2sKSMLwhjukwM8dYG7fn81elOCCDLUrvKvsAPdV/Oi8bkyH Jrjds7o46fAqGGviG/t8orQhB9xCCrm/GhPprbBTggJALtvj3zY5zzx6yUspz36Jmr Q3DFU3jnU5z54sWQFmQVQb5E2X8NKIZ+P/+/guqgzGoB+45gbfCYRwCCt8umkdc3a3 JHxfy4+rP35HA== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rQ1rS-00CNKU-LA; Wed, 17 Jan 2024 09:05:26 +0000 Date: Wed, 17 Jan 2024 09:05:25 +0000 Message-ID: <8734uwxrca.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: linux-kernel@vger.kernel.org, Hector Martin , Ian Rogers , acme@redhat.com, james.clark@arm.com, john.g.garry@oracle.com, leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, mike.leach@linaro.org, namhyung@kernel.org, suzuki.poulose@arm.com, tmricht@linux.ibm.com, will@kernel.org Subject: Re: [PATCH] perf print-events: make is_event_supported() more robust In-Reply-To: <20240116170348.463479-1-mark.rutland@arm.com> References: <20240116170348.463479-1-mark.rutland@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, linux-kernel@vger.kernel.org, marcan@marcan.st, irogers@google.com, acme@redhat.com, james.clark@arm.com, john.g.garry@oracle.com, leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, mike.leach@linaro.org, namhyung@kernel.org, suzuki.poulose@arm.com, tmricht@linux.ibm.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Hi Mark, On Tue, 16 Jan 2024 17:03:48 +0000, Mark Rutland wrote: > > Currently the perf tool doesn't deteect support for extneded event types > on Apple M1/M2 systems, and will not auto-expand plain PERF_EVENT_TYPE > hardware events into per-PMU events. This is due to the detection of > extended event types not handling mandatory filters required by the > M1/M2 PMU driver. Thanks for looking into this. I've given your patch a go on my M1 box, and it indeed makes things substantially better: $ sudo ./perf stat -e cycles ~/hackbench 100 process 1000 Running with 100*40 (== 4000) tasks. Time: 3.419 Performance counter stats for '/home/maz/hackbench 100 process 1000': 174,783,472,090 apple_firestorm_pmu/cycles/ (93.10%) 39,134,744,813 apple_icestorm_pmu/cycles/ (71.86%) 3.568145595 seconds time elapsed 12.203084000 seconds user 55.135271000 seconds sys However, I'm seeing some slightly odd behaviours: $ sudo ./perf stat -e cycles:k ~/hackbench 100 process 1000 Running with 100*40 (== 4000) tasks. Time: 3.313 Performance counter stats for '/home/maz/hackbench 100 process 1000': apple_firestorm_pmu/cycles:k/ apple_icestorm_pmu/cycles:k/ 3.467568841 seconds time elapsed 13.080111000 seconds user 53.162099000 seconds sys I would have expected it to count, but it didn't. For that to work, I have to add the 'H' modifier: $ sudo ./perf stat -e cycles:Hk ~/hackbench 100 process 1000 Running with 100*40 (== 4000) tasks. Time: 3.335 Performance counter stats for '/home/maz/hackbench 100 process 1000': 183,756,134,397 apple_firestorm_pmu/cycles:Hk/ (85.56%) 37,302,841,991 apple_icestorm_pmu/cycles:Hk/ (72.10%) 3.490138958 seconds time elapsed 13.376772000 seconds user 53.326289000 seconds sys But my perf-foo is as basic as it gets, so it is likely that I'm missing something. Thanks, M. -- Without deviation from the norm, progress is not possible.