From patchwork Mon Nov 30 16:24:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 11940979 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=-18.2 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,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 A1BBFC64E7B for ; Mon, 30 Nov 2020 16:26:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 D085E206E3 for ; Mon, 30 Nov 2020 16:26:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3ldjpPB4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D085E206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=rpkur+Pm85quP3ucptkDPr3G6jSGxib99Q8As/jrzSU=; b=3ldjpPB41PfNYIYIGMwHSvCiUk gpzBN3FtQdubt7TfeQUJoInrBYuAcWloSuBkulyn7GxdkdWQc9vadG4hZGLMl5oUalLJfvRYQYiC8 QJo/yFnmJFDJAsp42VMx5RiaG9O84SCFmPkLPZMW54tKtKdQpqScU3tXhhm4uvvrlU0bQ3HMK3X/N JpiC2gm1ZIfkVEnKVDyiIpjSMwcrHEf5XtsrTQEOIJaHI61Vevs6dCM9ia3OL1eA/eIC/c8l7upz7 akPNF9E99FuZQ5hTv1jmrfUPiPbdxKYqEPcKTLN3/SI7jNrosa6WbGovHc4ZyeKX+IcbbVtWvDKSM UviewHGw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjlzK-0001Sy-FD; Mon, 30 Nov 2020 16:25:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjlzH-0001SY-Rh for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2020 16:25:16 +0000 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 9E02C1042; Mon, 30 Nov 2020 08:25:10 -0800 (PST) Received: from e121896.arm.com (unknown [10.57.27.168]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 01FC33F718; Mon, 30 Nov 2020 08:25:08 -0800 (PST) From: James Clark To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH] drivers/perf: Enable PID_IN_CONTEXTIDR with SPE Date: Mon, 30 Nov 2020 18:24:54 +0200 Message-Id: <20201130162454.28255-1-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201130_112515_984007_18FAEB0F X-CRM114-Status: GOOD ( 13.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Al Grant , Suzuki K Poulose , John Garry , James Clark , Leo Yan , Will Deacon Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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 help Enable perf support for the ARMv8.2 Statistical Profiling Extension, which provides periodic sampling of operations in