Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp718310pxu; Wed, 6 Jan 2021 02:27:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJySq+CbaHgmAylP5SE7nL8g7TTitppqVFZxn38B4/65dkYAb2xTb+n9UN3snlPxD4nPfwy1 X-Received: by 2002:a17:906:941a:: with SMTP id q26mr2407918ejx.227.1609928871029; Wed, 06 Jan 2021 02:27:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609928871; cv=none; d=google.com; s=arc-20160816; b=aGEFUF0W+zujqx+8TGceTrCRIZUReHkZ/Pbq6Y0AO51PtIFLaHsctscAYKiPfyTnW1 yvii8DgkssDEME/Bo+lZ5ahOsKNJhYOm7eR2QS+pYeykEprlliKdKh8qHdjAwqM7qtfT 18duXvacygpn/JmVFECjHO9Y8vqnMhimWEq9dC0C3zd6OZBZsLY1v058dur8pUO+3VZp lPnzPe3CtdSBnuGcd46w2MIPlIHFmCNGciqOm4ajoQbEjltW7WRmwc6bfY7Ye528i3WL 99ZZK9rJJkQPCQSk/uaLg9xEDAroW4vYKMjaRqoOfuC9IzUoAnEDrkl1PlhBhRV2ToEw 0kOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=cvoPnKrffJYQeiSFPlKOQbghxJZAY2ALi8HLQPsg4Do=; b=fBp2ltsxZlomo0+opHsjYoM2hDJ3UR9ODyBRvyinG12+61/4Xa47Xtk4VpYaHdcyaH zeqD8RdbpmNztjIk3h79Kz8GUxODuIM7e7u9rq+YVQXJ1ualTIExm0zMLm3ceqbeCdbq xFFINq+rM/QEhyNtvYbXMifL51eWgrHE75HbvM81LTij/AqkmbRypeXm2Kr+ycxk/Hj2 6mVfer56xdr2OcXBOdcccNnz4GA38i7aGxYZVOD0+9GppBpJH9NqbPkMC7rJTNvwPYSj 52yIQyJZbolPK2DQ0r2pDhyY5Vfchk3zTcwIFTJgB2VtZepcrPpM01XU6JHXrYIWFCqn yYeg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di28si832435edb.383.2021.01.06.02.27.25; Wed, 06 Jan 2021 02:27:51 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726298AbhAFKZG (ORCPT + 99 others); Wed, 6 Jan 2021 05:25:06 -0500 Received: from foss.arm.com ([217.140.110.172]:38538 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726063AbhAFKZG (ORCPT ); Wed, 6 Jan 2021 05:25:06 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C6021FB; Wed, 6 Jan 2021 02:24:20 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.36.216]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A4A273F719; Wed, 6 Jan 2021 02:24:17 -0800 (PST) Date: Wed, 6 Jan 2021 10:24:10 +0000 From: Mark Rutland To: James Clark Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, will@kernel.org, leo.yan@linaro.org, Al Grant , John Garry , Suzuki K Poulose , Mathieu Poirier , Catalin Marinas Subject: Re: [PATCH v2] drivers/perf: Enable PID_IN_CONTEXTIDR with SPE Message-ID: <20210106102327.GA26994@C02TD0UTHF1T.local> References: <20201214084502.19954-1-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201214084502.19954-1-james.clark@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 10:45:02AM +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. > > 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 > Cc: Mathieu Poirier > Cc: Catalin Marinas > Signed-off-by: James Clark > --- > arch/arm64/Kconfig.debug | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug > index 265c4461031f..b030bb21a0bb 100644 > --- a/arch/arm64/Kconfig.debug > +++ b/arch/arm64/Kconfig.debug > @@ -2,6 +2,7 @@ > > config PID_IN_CONTEXTIDR > bool "Write the current PID to the CONTEXTIDR register" > + default y if ARM_SPE_PMU > help > Enabling this option causes the kernel to write the current PID to > the CONTEXTIDR register, at the expense of some additional Given that PID_IN_CONTEXTIDR doesn't take PID namespacing into account, IIUC it's kinda broken today (and arguably removing that support would be better). Can we not track the (namespaced) PID in thte main ringbuffer regardless of PID_IN_CONTEXTIDR, and leave PID_IN_CONTEXTIDR as an external debug aid only? Making this default y is ARM_SPE_PMU implies it'll be on in all distro kernels, and I think we need to think harder before doing that. Thanks, Mark.