Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2025169rdb; Tue, 3 Oct 2023 08:09:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnemD3FvLNyKaudix6eyNSTlIghXHvy5u5Q2xqv55A5LG3qsvOTuR+wrfRysFRVGAGngP8 X-Received: by 2002:a17:90b:4d92:b0:273:f017:cac0 with SMTP id oj18-20020a17090b4d9200b00273f017cac0mr12189043pjb.39.1696345769870; Tue, 03 Oct 2023 08:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696345769; cv=none; d=google.com; s=arc-20160816; b=PemJQPnmVDIc7jbo9z07DYitsO8Qk1tl5vjGhcKfQFA3OpE0l+8k3DXEUJToBFoyWT t7GnsNnBMq0is0OaxI+XxAlhoQaYyhS6kK6OeAgqyN17fY3jhZUDkNKB8F/1zuAIjPSv BNBWz2up92slKT12PRWx/jXs/EUhpHI12XIIpdWzBi2AU82KOINS1DVVMhZ5V/w2d0BC MFqEZmdUmWj0OUyRVzcE5q4NCLrRqEAYOAi8DdR6MoTsJS4vkSbV8CqeGsC6xz/YTonD i4jnAuYns3MFQ3luJcoJEgWNaf1SxB0wfwZqr2XVgJgCepawoY24OTd7DX42lL/keEzG jHRw== 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=7hG2KpeZmxL2Z9D673lFgZKGK07Z+wgLfqWUDkCf+KI=; fh=WIH6z9/erDLXkiBE+WmJEE8nDM8d1663KKUSmeAL/q0=; b=Jl7IgmxzkHRMJlVMuZDS9qRCf8Gb3VerHKWO+DYDvkYToOC9H3E2memlrRM+UcPMsb HZEhwZpRZrFrpSyRQMa+9xv5ScRVolB9ex+mQwvv4a6USqiWUBb6d9vczMQv4D+iqpiP 8Qt4O5WyWqeyNlVaQ3RCHxCncMKZTmF3XPDhhJreu5X3Hhuadl1YHLkgBE2E/ahTcs6K EnSAtQzkDS24IvK8ehfo7hVGyKiBC0KYg+zlMjYsTpiSVGj1xaRgeDIzJwReQhHgXBM6 G//9lvpUuPOYIADUY0tLFpsY4sVw8LsygSEJZjQ/qtLIUHwVH3T+uFFOC9Dat8S9CMrN OdSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fW08nzPi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id pg12-20020a17090b1e0c00b00278f81e54cdsi11106946pjb.19.2023.10.03.08.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 08:09:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fW08nzPi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id B1B958132A7B; Tue, 3 Oct 2023 08:09:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240170AbjJCPJS (ORCPT + 99 others); Tue, 3 Oct 2023 11:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbjJCPJR (ORCPT ); Tue, 3 Oct 2023 11:09:17 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED3BEA1 for ; Tue, 3 Oct 2023 08:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696345754; x=1727881754; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=nZ87GGtYEc0gY0sa1LHAtlEDPbNdG2W6N+19W0P2918=; b=fW08nzPiyZ9yDA7hux0bWZNfVTapDLj0OZN8+pQTCNBKgB7MU2njbnX/ k9SYIZgk3c/ybkQKdNC+cRWfLWE/U8cMu/8uJ3bCgOq1SV1B7rGcLE9Np 4VtMx612zuFvgPS3VR9R5FAdyXo2cNqw5QheH493HBsx8z0xY8YVKV/p5 3UW1oARnEB3ObnuLKNAWvQrg6Ach1rhKVp2b53htyKnCU7zMwNYgW56xI VMxwOjyBsUKedOoSj/2RgTdEFkg4h+AHadjqI1AsSwVSWokwrzuCs5ewn cBPyB+pxCvBrKXhTYsWiUolp69i2szZs64krd/VdzzN4JhTcOJ2qiecC3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="381779999" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="381779999" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 08:07:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="998066313" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="998066313" Received: from tassilo.jf.intel.com (HELO tassilo) ([10.54.38.190]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 08:07:00 -0700 Date: Tue, 3 Oct 2023 08:06:59 -0700 From: Andi Kleen To: Peter Zijlstra 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: 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: <20231003102733.GC1539@noisy.programming.kicks-ass.net> 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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 08:09:27 -0700 (PDT) > 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. -Andi