Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1601842rdb; Mon, 2 Oct 2023 15:05:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWfZuq7asfx79UyG4Fbfcaxj2Q6EvGbzG3HJui5wKfzETxVHLJrf/utc+VZU7rvncQwF7g X-Received: by 2002:a17:90a:53a5:b0:276:757d:8c89 with SMTP id y34-20020a17090a53a500b00276757d8c89mr10324329pjh.44.1696284353884; Mon, 02 Oct 2023 15:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696284353; cv=none; d=google.com; s=arc-20160816; b=LnfgAZiTT9Udv28JiaiROWbiiZ+54wPf6INgBzP6nSSDi24iMjQvQzTKt0RRj9qasK u0a+UaGuf/JKtvbtsVu5N1SEmd0vEewiH2iHxzUmITNsfS/a0mzFhkm92hTRNCervvOr 6wV1jtAKJoxyZ+TOIEP5v0SP2KGA1MPmvU7ecD34oGiOJWtLv2pwKqvZDL0VLgv7FpFG Lcd+n8bNr1qJhYocpfGj1i45wAXqPHlN+CTzr6ekArGc6YA8HoAAjjrmR7HCobs4aVpG 0IYYnLH80jV696c+gK9dVVd7hfYw718ynf5eE3cfMp5rhQTYuR7jUZQYZ89q4bQocqNy DLjQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IOnyXCPE/X01FPFeE/AD8XCGbNcYV5U6wQzXkM72WrE=; fh=drxRf27tFlMHHReZo6yF3EarHrc8k8R6YQtCQ2ZPdWo=; b=SHkGiUXg9QYvuhE/Auvatav4kn1pBt0YK5zfFj4/36ZPC316VVvfqAFmTBFR/85Ltq K06FN3odNpljVrO+N7zzBZbkZzJZQGtqucHg01yp0MsTE9OyJY87bKQHf3bFDcF8E76c fp318S+nd53MNCWIPGJy057CrFFKAEDPwqcvs10dAWWePkCYboD+rDblwv59vdjNxPzA wPZV2rkfCNQQu8HUZAVT6GwaHsehX8aBCKLmyVtk/tFlaQXBp22ZUWeM5RZpdAkTCwA5 qi5TnJnQwQn0LZemcP1izJ5s6kNKMqgurkt6N5PN2eP5RJQ10cSXJgqFYUbcj/XcYYh8 kBGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=MlyNf6Kk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id lc13-20020a170902fa8d00b001c3fa95ca03si26102119plb.9.2023.10.02.15.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 15:05:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=MlyNf6Kk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 1D049801E134; Mon, 2 Oct 2023 14:38:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbjJBViW (ORCPT + 99 others); Mon, 2 Oct 2023 17:38:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbjJBViV (ORCPT ); Mon, 2 Oct 2023 17:38:21 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6A06AB for ; Mon, 2 Oct 2023 14:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=IOnyXCPE/X01FPFeE/AD8XCGbNcYV5U6wQzXkM72WrE=; b=MlyNf6KkNPAmEp9Xe+n4yUvYwY plegmkH98M4oOaoMU+Sw2IinQ9JZC6GPMcF8aSzobFgSDnPjwzZWeGxg1GGwoiZlKgDDBae/ZTxHP M5k7BGSpSRWpsc1lJxJEJE0IBo5WBxu42EiSRb41qwWiuBohSzci0MXOBNz6tM2aA4pXnep8A/vQt frlviKS5bU9yYNmjGlVZQTebFDtXV8V6TDrdWnxP7py6n2g8VPVhpD/RojGgkGJSDnZ10+AuKa2Xv 9bjSTlaiXJBncshvIDxnSzz4wg4jY3NNNGHI8x9E6yXYP+SmawSLqDtzsQkNVJQhA039yhLcn123E 3oPzBHzA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qnQbv-009JiK-1F; Mon, 02 Oct 2023 21:37:55 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 3585F300454; Mon, 2 Oct 2023 23:37:52 +0200 (CEST) Date: Mon, 2 Oct 2023 23:37:52 +0200 From: Peter Zijlstra To: "Liang, Kan" 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, Sandipan Das , Ravi Bangoria , Athira Rajeev Subject: Re: [RESEND PATCH V3 1/6] perf: Add branch stack extra Message-ID: <20231002213752.GB1539@noisy.programming.kicks-ass.net> References: <20230911154822.2559213-1-kan.liang@linux.intel.com> <20231002154535.GB35785@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 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 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 14:38:24 -0700 (PDT) On Mon, Oct 02, 2023 at 03:19:04PM -0400, Liang, Kan wrote: > >> Also, add a new branch sample type, PERF_SAMPLE_BRANCH_EVT_CNTRS, to > >> indicate whether include occurrences of events in branch info. The > >> information will be stored in the extra space. > > > > This... why do we need two flags? > > Users may only collect the occurrences of some events in a group. The > EVT_CNTRS flag is used to indicate those events. E.g., > perf record -e "{cpu/branch-instructions,branch_type=call/, > cpu/branch-misses,branch_type=event/}" > > Only the occurrences of the branch-misses event is collected in LBR and > finally dumped into the extra buffer. > > While the first flag, PERF_SAMPLE_BRANCH_EXTRA, only tells that the > extra space is required. Or have it implicit, I reallt don't see the point of having two bits here. > > Also, I can't find this in the SDM, how wide are these counter deltas? > > ISTR they're saturating, but not how wide they are. > > Now, it's documented in the Intel? Architecture Instruction Set > Extensions and Future Features, Chapter 8, 8.6 LBR ENHANCEMENTS. It > should be moved to SDM later. > https://cdrdv2.intel.com/v1/dl/getContent/671368 > > Only 2 bits for each counter. Saturating at a value of 3. Urgh, this ISE document is shite, that thing don't say how many IA32_LBR_INFO.PMCx_CNT fields there are, I think your later patch says 4, right? And is this for arch LBR or the other thing? (Also, what is IA32_LER_x_INFO ?) This is then a grant total of 8 bits. And we still have 31 spare bits in perf_branch_entry. Why again do we need the extra u64 ?!? More specifically, this interface is pretty crap -- suppose the next generation of things feels that 2 bits aint' enough and goes and gives us 4. Then what do we do? Did I already say that the ISE document raises more questions than it provides answers?