From patchwork Mon Feb 13 19:07:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liang, Kan" X-Patchwork-Id: 56483 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2524895wrn; Mon, 13 Feb 2023 11:15:46 -0800 (PST) X-Google-Smtp-Source: AK7set91OMoe1vqLSm/dI/gSVIJjd6lw4uPw0O+Jb1jZ8YEFreJhthQaSbLKoiKnm6xhDCUvnLoB X-Received: by 2002:adf:ce01:0:b0:2c4:840:c86d with SMTP id p1-20020adfce01000000b002c40840c86dmr14620151wrn.44.1676315746255; Mon, 13 Feb 2023 11:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676315746; cv=none; d=google.com; s=arc-20160816; b=CaHZ3/aqEVkP/nJOmyxUBRe2UVt4XxumgLQHanXMHFHxplEJJjAykN495fk9qYWezO 3357ujzcP/36JkrdWCkLRWXI3hrX5Q8+qvQ0E6rWcvSsUOLVgVqyEld2je8LtW9pKd0T GR1PQqnrSRCW1ML1jkRS1w3XwqnI+rEssoePIuyjrJMu+Ia7JmRjIBYG+CRcRCuSQJoC gPkJLn77Z4PiWxMAC6PFAp3i6ZO+ILFTl1vG77DEQc+iDCra3+rhJFESYBqs0Dh11RDI 4sX77W8Ly/W4C215qs/9MlcP559uJjaeAAq5ZdR/wkhQcelS8VZRYVgbHFGkBErDh+Z5 OaeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oz5Mrairh3yNBAhONHw4gDOsj8eYXXkRDnEtROaaWb4=; b=FnrhngAuWhOPTmBmgwiQQVcIF360zJfmNHvEj6rawPhL445Vg4k/N9bz8k1pQutBZg Qw8z1HxJSd5LeobbgiAoSlsZF0KFp1pM9U2iiZ8nDPcx1c3hMXAeKQUHMbnDDsmz7e+9 AIcYtS0FykXJgbwkcDDVrBQ8Y3nM/bvuatLWiDD8dTCuewEF+/jQ75u3YH9f92cinad1 PHTpFtI2/0/ANUz7cs6VL6dKdiX2DHhzc+kUQIufQ6qDy9cAj8rOt61Q8CgT+khjhQxl PAiwjdu2GE6pzNxwF6p15UxwtLsnBT5U8FOxaf+XJ6nwc0GNmu1cDK8Z3ADvj3vYvE3l 2n8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aKK74wCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i17-20020a5d5231000000b002be1d4675fdsi12590249wra.124.2023.02.13.11.15.14; Mon, 13 Feb 2023 11:15:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aKK74wCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230480AbjBMTIS (ORCPT + 99 others); Mon, 13 Feb 2023 14:08:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbjBMTIL (ORCPT ); Mon, 13 Feb 2023 14:08:11 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E39B76E80 for ; Mon, 13 Feb 2023 11:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676315286; x=1707851286; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X9aN6C+r13kwLYq+5iI5APWDkP47jg3B6kqADSWKNhM=; b=aKK74wCEIiSvFaYQeCUtkXBYhpexCr3jy2ES9NUgOznOWSeZEM7dAIQK 6An1x/xqeBVAVNv6QDXvC8A/L80kIpdCyd1jWNJ2Iu/ixsK415AkdwK1q d48BoRfQ5lnBnXGsGw4yhO8SY58O0S86zQt2/H8isprCnOjbkn6HtEQ+H AVLGYvPcwkHE0B8mitvNKxbK0frWC7B+Z4E/ihTm9r12oOT5ifxvrwjdr TNjcAa5DrLnBVKry+612yl39bdMcx3cIwgjDv53HBhCXZ3WQNnNx1ln/v Wi2Gp54cKHOuq+pcrongR2C5OBeo56mi3fuDD2yF34O3SBLaY5s9vDjKN w==; X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="333108757" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="333108757" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2023 11:08:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10620"; a="668901950" X-IronPort-AV: E=Sophos;i="5.97,294,1669104000"; d="scan'208";a="668901950" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by orsmga002.jf.intel.com with ESMTP; 13 Feb 2023 11:08:06 -0800 From: kan.liang@linux.intel.com To: tglx@linutronix.de, jstultz@google.com, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: sboyd@kernel.org, eranian@google.com, namhyung@kernel.org, ak@linux.intel.com, adrian.hunter@intel.com, Kan Liang Subject: [RFC PATCH V2 5/9] perf/x86/intel: Enable large PEBS for monotonic raw Date: Mon, 13 Feb 2023 11:07:50 -0800 Message-Id: <20230213190754.1836051-6-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230213190754.1836051-1-kan.liang@linux.intel.com> References: <20230213190754.1836051-1-kan.liang@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757744459605424720?= X-GMAIL-MSGID: =?utf-8?q?1757744459605424720?= From: Kan Liang The monotonic raw clock is not affected by NTP/PTP correction. The monotonic raw clock can be calculated from the TSC of each PEBS record by the same conversion information. Signed-off-by: Kan Liang --- arch/x86/events/intel/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index d9be5701e60a..eac389e1f44c 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3776,7 +3776,8 @@ static unsigned long intel_pmu_large_pebs_flags(struct perf_event *event) { unsigned long flags = x86_pmu.large_pebs_flags; - if (event->attr.use_clockid) + if (event->attr.use_clockid && + !((x86_pmu.intel_cap.pebs_format >= 3) && perf_event_hw_time(event))) flags &= ~PERF_SAMPLE_TIME; if (!event->attr.exclude_kernel) flags &= ~PERF_SAMPLE_REGS_USER;