Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2819731rda; Wed, 25 Oct 2023 13:17:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZjtP4TuN6TO33hQztP7bKqULoHRvVM4uchQhF3Vz/Ss6c+UIYdnAisw6hlI5qIB3z5rhu X-Received: by 2002:a05:6808:3087:b0:3b2:e4b7:2b0a with SMTP id bl7-20020a056808308700b003b2e4b72b0amr19612494oib.47.1698265031633; Wed, 25 Oct 2023 13:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698265031; cv=none; d=google.com; s=arc-20160816; b=AubZiwj8HObB1h3USXoM+Y6NmyLM6WROxAzjZP+TNFUzAMBAHXC5IPtgWDd8/QEXS3 OTCPzF4Ils71Jvmxaw4dpHa3whc3ot9wj6uIeMOYvL0RcXALtVEG6+/1ZcKUk/8YC+l1 akxvEKzb0+e0I1UR6Lw0qjnvs/stF1VZX+UvdY3YOPZPiYJr32H9PtM1JCDnRuQbfILH DPupp4t8BoUtsOvcqnj2D22QzSoxXEIinagZ2QmtfmMu4bCauvmGpamss1ErF7W9tNxW wdaHZIQko2Qgc1JTNf1qny8WMzxjBSMEX+IyoWNH1QxtFfbci3FSN7gp9/SvJFn7wIw5 xcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ugvchm3XKYoW9fb/wvYNYyuJii6XjAemwb0xQ9uoYtQ=; fh=PWMgxgslqMjOtye8I2qVy8I5pPekyJtpFTusQltnkEg=; b=jNuubEyoJajg/AtrCX/nGgmj3OYlZE+9+6a0X8vwkuUPo4HZxD9XHXR483fUHmbpgF 4fG6bItARaCnwDiJyoMdrik2Naz12rxf+sqolxBgs5f66T1SV7OE7j+Rt6PFGYCrHsq+ 5lMt9QoHmUy+Dcas/p/9iMus+4pBEXEuhEC8+/t95LNmf6n2sAGqbfHOmy+pf3u6MXXr G89iMPKype6eaCQM++Anva0EJ121c3sEPiolKodUdhi0u03e6KN8n77g/z3MJnPMBOkO mQ2M4yXIfs5Q+iwKSvGEe3nAB6H6mZnWPl4UziMYwfDOgcGQcnJ1d8eB3+2FYJ6Xnd5N q6HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mZ99mlvJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y72-20020a25324b000000b00da02d3b0106si6035478yby.167.2023.10.25.13.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:17:11 -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=@intel.com header.s=Intel header.b=mZ99mlvJ; 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; 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 snail.vger.email (Postfix) with ESMTP id 2970A80DEA5A; Wed, 25 Oct 2023 13:16:40 -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 S234812AbjJYUQf (ORCPT + 99 others); Wed, 25 Oct 2023 16:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234315AbjJYUQ1 (ORCPT ); Wed, 25 Oct 2023 16:16:27 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D65AF181 for ; Wed, 25 Oct 2023 13:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698264985; x=1729800985; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NQDKu6N6x46M6QZQn4YFr/nofxFMJHrDOYlY3ozSJ9k=; b=mZ99mlvJ3E9oCInQbN3MqFstEAdbhJNK7nr5aQYz7GCTDGz7Lwpg8tNB VYLT9UvtabC5dN0BsvNLDoSrDIzC+PHHVfn7L6sX22m1o5OVxd4B6ONXd oFnYjf8dpXS9XeeubPwUosgyAsKCtdXLVkvkmoVorsJgq+Bykig96YYEt qAQdOCQXHBYE65HGL4UB/PZDAhS8EMgxvg238e6ALZf1Ale/QsEgpGTxC 3oJaveKljPSoX26oHQPmk72uambWqPb+F0qbFuZij4F93OVfIPMLyGKKG W5xlk97zokvXwmyHlCmSeI50CzqrnsZ+LyqIt25ULu/uHjKcoVR0eGHBb Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="377758229" X-IronPort-AV: E=Sophos;i="6.03,250,1694761200"; d="scan'208";a="377758229" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2023 13:16:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="752459090" X-IronPort-AV: E=Sophos;i="6.03,250,1694761200"; d="scan'208";a="752459090" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by orsmga007.jf.intel.com with ESMTP; 25 Oct 2023 13:16:23 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org Cc: 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, Kan Liang Subject: [PATCH V5 6/8] tools headers UAPI: Sync include/uapi/linux/perf_event.h header with the kernel Date: Wed, 25 Oct 2023 13:16:24 -0700 Message-Id: <20231025201626.3000228-6-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231025201626.3000228-1-kan.liang@linux.intel.com> References: <20231025201626.3000228-1-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 13:16:40 -0700 (PDT) From: Kan Liang Sync the new sample type for the branch counters feature. Signed-off-by: Kan Liang --- Changes since V4 - Add PERF_BRANCH_ENTRY_INFO_BITS_MAX tools/include/uapi/linux/perf_event.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index 39c6a250dd1b..3a64499b0f5d 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h @@ -204,6 +204,8 @@ enum perf_branch_sample_type_shift { PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 18, /* save privilege mode */ + PERF_SAMPLE_BRANCH_COUNTERS_SHIFT = 19, /* save occurrences of events on a branch */ + PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ }; @@ -235,6 +237,8 @@ enum perf_branch_sample_type { PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT, + PERF_SAMPLE_BRANCH_COUNTERS = 1U << PERF_SAMPLE_BRANCH_COUNTERS_SHIFT, + PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, }; @@ -982,6 +986,12 @@ enum perf_event_type { * { u64 nr; * { u64 hw_idx; } && PERF_SAMPLE_BRANCH_HW_INDEX * { u64 from, to, flags } lbr[nr]; + * # + * # The format of the counters is decided by the + * # "branch_counter_nr" and "branch_counter_width", + * # which are defined in the ABI. + * # + * { u64 counters; } cntr[nr] && PERF_SAMPLE_BRANCH_COUNTERS * } && PERF_SAMPLE_BRANCH_STACK * * { u64 abi; # enum perf_sample_regs_abi @@ -1427,6 +1437,9 @@ struct perf_branch_entry { reserved:31; }; +/* Size of used info bits in struct perf_branch_entry */ +#define PERF_BRANCH_ENTRY_INFO_BITS_MAX 33 + union perf_sample_weight { __u64 full; #if defined(__LITTLE_ENDIAN_BITFIELD) -- 2.35.1