Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp269260rdb; Thu, 19 Oct 2023 04:12:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXv25N38CzOdPkq/HNC7ONv7ScQ1/4xi1EoyeNURFvDO6be1pmSWs4CkbzJYFrzGlS+M8c X-Received: by 2002:a05:6358:5d91:b0:135:4003:7851 with SMTP id s17-20020a0563585d9100b0013540037851mr1817241rwm.19.1697713944437; Thu, 19 Oct 2023 04:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697713944; cv=none; d=google.com; s=arc-20160816; b=C2kwnE/L8Kgs3EOw3rhYgQr+bsuJYCjVa8F2ysjVAkfEoYBqJ2m4q/p/TLojBAXkIH GgC7PHBThvSPxj26kGBfIeJarwkDlGGORIBkiLEjGoC537QAjZAIFsazfJZ2CAzHWaqT JBs39iqkRa4Aj7RtY1r+jDMXdhHf6Iha4vIoMynO0ajMDjrmpwT5B5rslXcTggaVIeVA HU2Jpy6O3eO5bKpVW7FY7wk9V4rld4k31p73vVCHuIYvMAnfyqx1xlXEyTk7unKrlwhR OuI2OXSosE65nOSM3xKcUgKeQymj6oL+Gv0iFN79SjZjE3IPmWYJvbcWHMSrdv0mX6NK UJoQ== 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:dkim-signature; bh=Nw5Gk35NEIfC2Li/28jQ70AKaQXVN3S7LVGM18nIWg8=; fh=3kTKsv2cAw/HzpZ5MwS0/6eqzVbNIR0k/WjaGE2kPn8=; b=T9+gpCGJ3Pt0aSp/HebW2LyRB2ghPp/6B5G3jcOAkqjedyvmS2SyZ3XZICyoM56MMj Noc56x3nwW0Ce3J6xnsa5zAIIOa06cmjFwpDcQWtDnflwkGfkckNZ42hGB3Yx38fZXtI CAwqDDpgMfh5bfU9FT4ES5xTCBozGUtIqCXTzt4zRer7I90LoPO7suXHhqTVqeBOshlG sBDhprUSidxHUZgVfPLmEnBeyvsGNPlXpjC2MqLOlooPa/xOk35Qdq4PRDUTpCMUMkNG phGshZZs7Q0aYGkg7OWhD5eKT62W8MAs6T/RIGenYcBFd7Hu6YxZVUVcrbM2A3Us0sVN t0wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Li95tS5s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v190-20020a6389c7000000b005b7160263f2si4191078pgd.154.2023.10.19.04.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Li95tS5s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6E74980DEA46; Thu, 19 Oct 2023 04:12:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345318AbjJSLMU (ORCPT + 99 others); Thu, 19 Oct 2023 07:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345037AbjJSLMT (ORCPT ); Thu, 19 Oct 2023 07:12:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6291313A for ; Thu, 19 Oct 2023 04:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Nw5Gk35NEIfC2Li/28jQ70AKaQXVN3S7LVGM18nIWg8=; b=Li95tS5sxjc2hJYoR16kuiR1YD yIRBnYzPiUxPJbOK+A/qCZ6CoLCDeMy7mqtkQiQHHGuqe72qvBeyHtnYt3woMfI96dngo2HZjGIrN aDVHL1xIAjpcBnxdPDiFQk1nBl8IZdykCHCHxLM1gh2l6w5mGYo/6zwnawShPMAVbHcpKMwUypBrm F6AM95+VWfsmH7b+sGMALa8OikjYQDaVvYDID1OmyXKtS+rs9tZJAlpCFSRyVHubp+hWEEJF22rPg vBYmzspiEYPIjRGMNAKFFjrZrpKIWGpNrlVKaBheckjkf7O3f/rLY3qI4TfaIZ90wiJr/ZyNth0C0 KwH+jFtA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qtQwd-006hTP-Bt; Thu, 19 Oct 2023 11:12:03 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 0B2C7300392; Thu, 19 Oct 2023 13:12:03 +0200 (CEST) Date: Thu, 19 Oct 2023 13:12:02 +0200 From: Peter Zijlstra To: kan.liang@linux.intel.com Cc: mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, ak@linux.intel.com, eranian@google.com, alexey.v.bayduraev@linux.intel.com, tinghao.zhang@intel.com Subject: Re: [PATCH V4 4/7] perf/x86/intel: Support LBR event logging Message-ID: <20231019111202.GJ36211@noisy.programming.kicks-ass.net> References: <20231004184044.3062788-1-kan.liang@linux.intel.com> <20231004184044.3062788-4-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004184044.3062788-4-kan.liang@linux.intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 19 Oct 2023 04:12:23 -0700 (PDT) On Wed, Oct 04, 2023 at 11:40:41AM -0700, kan.liang@linux.intel.com wrote: > +static __always_inline void get_lbr_events(struct cpu_hw_events *cpuc, > + int i, u64 info) > +{ > + /* > + * The later code will decide what content can be disclosed > + * to the perf tool. It's no harmful to unconditionally update > + * the cpuc->lbr_events. > + * Pleae see intel_pmu_lbr_event_reorder() > + */ > + cpuc->lbr_events[i] = info & LBR_INFO_EVENTS; > +} You could be forcing an extra cachemiss here. A long time ago I had hacks to profile perf with perf, but perhaps PT can be abused for that now?