From nobody Fri Sep 12 06:33:44 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4632DC636D4 for ; Mon, 13 Feb 2023 19:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbjBMTIU (ORCPT ); Mon, 13 Feb 2023 14:08:20 -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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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(struc= t perf_event *event) { unsigned long flags =3D x86_pmu.large_pebs_flags; =20 - if (event->attr.use_clockid) + if (event->attr.use_clockid && + !((x86_pmu.intel_cap.pebs_format >=3D 3) && perf_event_hw_time(event)= )) flags &=3D ~PERF_SAMPLE_TIME; if (!event->attr.exclude_kernel) flags &=3D ~PERF_SAMPLE_REGS_USER; --=20 2.35.1