Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp391301rdb; Thu, 19 Oct 2023 07:29:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWz0SfDmi+UB38OEGNFOckqGPGWdZJrfF7VgVgZC9SGuTlFNRqsMKWCNU1OzVxf8P506BQ X-Received: by 2002:a62:790a:0:b0:690:cae9:714d with SMTP id u10-20020a62790a000000b00690cae9714dmr2081161pfc.13.1697725754456; Thu, 19 Oct 2023 07:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697725754; cv=none; d=google.com; s=arc-20160816; b=DQrdmIBeAKBvUKZxkKNduucweSf43cwXPSD4JB93dgKM33zD7eSDo+Sr2JL9Z6CVk4 VCeatH3sgj/o4laA7v+vB3elW968zzPD0aKWgpn15/2Tl6XxvBtC6Pyk7tbAgVXrgRW0 sM+X3qHcxAkPGbWM28Jm/B+DwWmyTDN2JW3mcPtz/ZAnfBkRiFM14snUPGL4kDyCvFtO 4ha4JgGyr+0wzT0lr6tLePYP3YuZJb40LlIk0sqxyuVG1DNSKy0CCHIT65S/wvUl1fxA +BoOGcMbWVvwfNhqisTJa3VxjrGTHIDjMvhpov5PiCzfRGNGr0ZGxEKvMQM3d9KIZP8s twaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JjMptLNdMNnXdLV8eL9K4S77uAwZxn4PJ2uTfxcrQOk=; fh=mbFen4gcXgQoXUMPVioG/Ydi4T8KDEMkq+xsa97cIIg=; b=eeXCV1Wf70AHPsa9BfL3jXj4QbA6VZB1GbLL3ihJ0I4sBbgU2umxWVHmKtoIuvuTO7 XNwTpYCQmTEhE0933E5ZIGP5hdqoIEcOs8b++WU2ZRMCyMxXGPpez7VchbzcSps5GG6G aOExzdckOL4onhRFMBhSRECpsb6D/w7ndaVOv9RS0m5PFDv8RsDr1PZqlueIYOdQAcby gan2VpZlVKHLtqBFcAp26IL2pUUm9rBaCWsV4FSjQxviPLT3HKdD2NpFoKc2E1wDBsp9 kSxJXu0hxFRhmbrSj6BQMKQZkoVYATeYDIbFjG8aH+Ti/NQzLnOi7RlvqYSVi7vdQ2vB qXKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lhHWFPnb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id p12-20020a056a000b4c00b006b5860b226asi6652261pfo.312.2023.10.19.07.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 07:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lhHWFPnb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 73B11826E3A6; Thu, 19 Oct 2023 07:29:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346089AbjJSO3C (ORCPT + 99 others); Thu, 19 Oct 2023 10:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346139AbjJSO27 (ORCPT ); Thu, 19 Oct 2023 10:28:59 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C1DB134 for ; Thu, 19 Oct 2023 07:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697725738; x=1729261738; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=V/kslxMcngujt96Vh/coI6ImjBlQYF9tepCmAIzXbNc=; b=lhHWFPnbX6fi804PUsnpW7VdGRJCb+sRPyvpijH8JVcXq6pqT+PBldoG ZG9VmBCk3JxTZ1cGvquF82SehaQ9WB2v2zAPcgT1ZbeOndqOvS8l92oKg EMlTsGKqrFPClug6u3v2WcnbqtsHSdS1f1xYIbIw9bPzuMAEcrBCTW5yK AKCweYv1yhxcYQn6ko+TlP/Stg+4RI4B2qEbqoWHqzzjDWB36ZT9cEMrA sV2Wuph+817aDL9Ea3SXWAi4xANcwWIt1L6JIQE/Xh9pBDHV/CUcyo3VF g74q92BUvI2pTjHwF5pi7U1zxtAKQWeEGYNlH/zMLi3qMezVP6jFZgVLX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10868"; a="417381381" X-IronPort-AV: E=Sophos;i="6.03,237,1694761200"; d="scan'208";a="417381381" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2023 07:28:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10868"; a="900767998" X-IronPort-AV: E=Sophos;i="6.03,237,1694761200"; d="scan'208";a="900767998" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2023 07:26:49 -0700 Received: from [10.212.5.13] (kliang2-mobl1.ccr.corp.intel.com [10.212.5.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id EA539580BE3; Thu, 19 Oct 2023 07:28:53 -0700 (PDT) Message-ID: <6850dc71-e709-42ce-9113-9cb5a7a590f7@linux.intel.com> Date: Thu, 19 Oct 2023 10:28:52 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V4 4/7] perf/x86/intel: Support LBR event logging Content-Language: en-US To: Peter Zijlstra 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 References: <20231004184044.3062788-1-kan.liang@linux.intel.com> <20231004184044.3062788-4-kan.liang@linux.intel.com> <20231019110056.GH36211@noisy.programming.kicks-ass.net> From: "Liang, Kan" In-Reply-To: <20231019110056.GH36211@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 07:29:12 -0700 (PDT) On 2023-10-19 7:00 a.m., Peter Zijlstra wrote: > On Wed, Oct 04, 2023 at 11:40:41AM -0700, kan.liang@linux.intel.com wrote: > >> +static ssize_t branch_counter_width_show(struct device *cdev, >> + struct device_attribute *attr, >> + char *buf) >> +{ >> + return snprintf(buf, PAGE_SIZE, "2\n"); >> +} > >> +#define ARCH_LBR_EVENT_LOG_WIDTH 2 > > I'm assuming this is the same '2' ? And having it hard-coded in two > locations is awesome.. > >> +#define ARCH_LBR_EVENT_LOG_MASK 0x3 > > Should probably be ((1<<2)-1) > > As per that other email, the naming is confusing, should this not be: > > ARCH_LBR_EVENT_COUNTER_BITS > > or, since it's all local to lbr.c something shorter still, like: > > LBR_COUNTER_BITS > > hmm? Sure, I will use the name LBR_COUNTER_BITS. Thanks, Kan