Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2079791rdb; Tue, 3 Oct 2023 09:33:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGX+ND1xWBvhf2KFodXS6SSjgtS/FYpObKiZCBL5V5km09/k+a8EuMj3JKv4apIKolhppq0 X-Received: by 2002:a05:6a21:66c6:b0:15d:bfbb:ab with SMTP id ze6-20020a056a2166c600b0015dbfbb00abmr14233944pzb.58.1696350803561; Tue, 03 Oct 2023 09:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696350803; cv=none; d=google.com; s=arc-20160816; b=lXNG6u71k/2wcTJRTdbv9R5xz6KRQKRVGjwPJckTm9l33CnktZAu5cSHtilt0LbPdP NmJbnZUBYFpSFYNZg4uTLTRuDFRPIlc3zDY++PlxWqdX1iiQXbebhb4P725701H0eFXv bGGqx4O1NMtkCK8E2sh/z6uG/AJAf1fniQ30DM51BntsYnIqwdF6bxVEi/F/tdiUfcS6 vlUlQTkMfWxpJ4QkuxN0/dwmEzG2wM2Nz4ZJamH7//BURvKuBXIcbNrQLKyxrC5xVf7P dxldy9vH3cDIy9Nf3HnpLxpj2sxCMqLqP8QWxEfwi3Jg9k7HG2sdmW0wV44lX+A1POxk YqfQ== 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=R/ibdb86WTscNhAmgSNZfoPz8ITVLMRdEmg42XxgAA0=; fh=zORcpkfNBDPiUR+dvl6ORJjvEHkJuuxa3Iwy6o7cJfU=; b=PMdLTYDSOoyglw93EGgZYg2OBxIkPtiyX2VpT2HevepuTSEwDCGOgmtJgi1NGEpI3U 9kmkpwIN+8jiszeMQncRd3Ca9G07+0pUqNst+onBBtOCV+5Y0U+nyMZixZ5xU3Z3T0Er pavpcKSvqJSLPcxorFuTuj+D/Yn3W5ZbkX6aQiwcVas7QnGcywVeE4uWah1YjKpVkdhv OYjjYwOaMfwrRvE28ycoNMEN4e7nZPBhJGco3OpO5kTOYqIyJeGAjMjGf2R0C/qb7Q1c FVI59OtVVa6xQ3xtxDSzLr/w8MTAuLSA/zEOc1reNOE/ogWLFKnSsktpiR8JnbQgERa7 m2fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EQjBJXUf; 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 u190-20020a6385c7000000b00578d0d070f4si1746028pgd.844.2023.10.03.09.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:33:23 -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=casper.20170209 header.b=EQjBJXUf; 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 8AFB382DC602; Tue, 3 Oct 2023 09:33:21 -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 S240586AbjJCQdT (ORCPT + 99 others); Tue, 3 Oct 2023 12:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240421AbjJCQdS (ORCPT ); Tue, 3 Oct 2023 12:33:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E78CD3 for ; Tue, 3 Oct 2023 09:33:15 -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=R/ibdb86WTscNhAmgSNZfoPz8ITVLMRdEmg42XxgAA0=; b=EQjBJXUfZ8ykIbmaRrFMsm5r8i xd5t8J8YqhRxkBl7m1mp9kagYXoyjtB19yGUiZcdqKY5ARlN+/yKFYoLEqnCa8rx2GXEjF8GOTo5N COntVN6+0hUG5WA2pggVnda2SWj6PnhsPX3baD853w0XWAsPaW46mM9mu6ThQjZOzEfTP7o0wcO1l xJifW5eG8UfeLNoterHeoynMGS5jI0uUINl0kJP58wb5Y7oUHJduJANp7/tSnLCd0fY58D40ngbkd YV96S4fbaUceXKyYns4YyHg3bV1GXHZnuKpKVbdQgJr4LPXyoVziKFrIO5KoqJHixS/BcJ5C4hYaF yV9gBRFg==; 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 1qniKT-00G0yK-1v; Tue, 03 Oct 2023 16:33:01 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id B6C3E300348; Tue, 3 Oct 2023 18:33:00 +0200 (CEST) Date: Tue, 3 Oct 2023 18:33:00 +0200 From: Peter Zijlstra To: Andi Kleen Cc: "Liang, Kan" , 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, 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: <20231003163300.GF1539@noisy.programming.kicks-ass.net> References: <20230911154822.2559213-1-kan.liang@linux.intel.com> <20231002154535.GB35785@noisy.programming.kicks-ass.net> <20231002213752.GB1539@noisy.programming.kicks-ass.net> <20231003102733.GC1539@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 09:33:21 -0700 (PDT) On Tue, Oct 03, 2023 at 08:06:59AM -0700, Andi Kleen wrote: > > I'm thinking we should do something like expose branch_counter_nr and > > branch_counter_width in the sysfs node, and then rename this extra field > > to counters. > > > > Then userspace can do something like: > > > > for (i = 0; i < branch_counter_nr; i++) { > > counter[i] = counters & ((1 << branch_counter_width) - 1); > > counters >>= branch_counter_width; > > } > > > > to extract the actual counter values. > > perf script/report won't necessarily have access to the sysfs > values if they run on a different system > > It would need extra PT style metadata written by perf record to > perf.data and read by the user tools. > > Seems complicated. It would be better if it just parsed on its own. Well, you really don't want to repeat the 4,2 thing in every event, that seems daft (and a waste of space, because how large do we want those fields to be etc..). We don't really have a better place for these sorts of things. And yeah, the PT thing sets precedent here.