Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3714743pxu; Mon, 30 Nov 2020 08:50:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwc570oezbm2o0ZcgwPu34AUA4ASzPVjlZzkCnxAkprv1qQ2pOVfz/bMXZzFiwxnz3QTnWj X-Received: by 2002:a17:906:71d3:: with SMTP id i19mr21735053ejk.187.1606755046720; Mon, 30 Nov 2020 08:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606755046; cv=none; d=google.com; s=arc-20160816; b=XC6dzOlrMF9MwL8qmlN2RHIv/mQinikDQfsfX+RRszOD382GLorpFGwfcB9mIOe4B7 S8rvLFUvck5+Vc6xjduLiSth3sPDz+qPM77COHxXKj/D3bAkX9ofPAsBLsfwIwoded2U xlm7pZ+z8X8YGdXn3nZzWlgs3IknihKO34XtRKexFf5TLFrMoeil0cV2KR2mhl9qFzBU v+wY8SClJ0YTxhrfNVvU7Ug/+3taWrkeVjSRKEMKZSeqxbKTXlPd9cXA+ZfPxBhLDD0D UGY9vyeW5nKNtcxzx4X/vXoJss5pcqmU0cGwak1Beh5afeCe+gdv13OHkAzOKUaNyrpk nnIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nSQayd+7g4oaalrues1gJ5A5Gcme+KkJAsbjSYLZyJA=; b=LxMFetHH4a/qH1czJNfTyDxolxXfGDiW3t4QUznKDBi7aZs//0NmOT+PgKPyYNvwhd NGKVD6o/X3pzaq6tK2ddpgGhXJgBgojaEdo/boP7I9dRRUG/Unf0Jctn7Nbqn9CMjGaZ QG5acX23w3hUMaVPXuMhDXR8YniAxPdh4fwi/xFcd9GZwikctxq2I6WO6pwm+ZOGNmjv ZIuqd/dw6lYuamNUmNG1N+zTT66nYs/Jr9NyWZM8Zp9lGGljyxmfRvUhuXjCML6im6kL HbiSHHOP4G2bMzrML63uNcDH7ZtR0/WXjAqb07ubL13EQaFjHOxhFMmpzpcHa3TtFYpX V0Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ikl7B+Dn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id gz14si1242039ejb.630.2020.11.30.08.50.22; Mon, 30 Nov 2020 08:50:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ikl7B+Dn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727939AbgK3Qri (ORCPT + 99 others); Mon, 30 Nov 2020 11:47:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:60490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725859AbgK3Qrh (ORCPT ); Mon, 30 Nov 2020 11:47:37 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 4696B2067C; Mon, 30 Nov 2020 16:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606754817; bh=PBQifm6DraFNejjKgt0IKbv0mnlfO+5mof3SFPnhpQU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ikl7B+DnVwstqClfpP0q/Fquj3ruBoS1ZKuF7gfnl/X1ekHtUWtafmtU9kSJjR3by 2Qc0owC0FKifGosDMbYAooeLvRoNLfOB44jmw4uWZws5jsfr99kCN+nBi18jrnWugW zo6aDJjYasN1Iim/fQAtoYN8SOxK+WOWyY15KfHc= Date: Mon, 30 Nov 2020 16:46:51 +0000 From: Will Deacon To: James Clark Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Mark Rutland , Al Grant , Leo Yan , John Garry , Suzuki K Poulose Subject: Re: [PATCH] drivers/perf: Enable PID_IN_CONTEXTIDR with SPE Message-ID: <20201130164650.GA25187@willie-the-truck> References: <20201130162454.28255-1-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201130162454.28255-1-james.clark@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 30, 2020 at 06:24:54PM +0200, James Clark wrote: > Enable PID_IN_CONTEXTIDR by default when Arm SPE is enabled. > This flag is required to get PID data in the SPE trace. Without > it the perf tool will report 0 for PID which isn't very useful, > especially when doing system wide profiling or profiling > applications that fork. Can perf not figure out the pid some other way? (e.g. by tracing context switches and correlating that with the SPE data?). Also, how does this work with pid namespaces? > There is a small performance overhead when enabling > PID_IN_CONTEXTIDR, but SPE itself is optional and not enabled by > default so the impact is minimised. > > Cc: Will Deacon > Cc: Mark Rutland > Cc: Al Grant > Cc: Leo Yan > Cc: John Garry > Cc: Suzuki K Poulose > Signed-off-by: James Clark > --- > drivers/perf/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig > index 130327ff0b0e..47ede46c3d57 100644 > --- a/drivers/perf/Kconfig > +++ b/drivers/perf/Kconfig > @@ -125,6 +125,7 @@ config XGENE_PMU > config ARM_SPE_PMU > tristate "Enable support for the ARMv8.2 Statistical Profiling Extension" > depends on ARM64 > + select PID_IN_CONTEXTIDR Probably better to make PID_IN_CONTEXTIDR 'default y' if SPE is enabled, rather than selecting it directly. That way, at least people can turn it off if they don't want it. Will