Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2798888rdb; Wed, 4 Oct 2023 11:44:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaxt7IDccBSSCCJgf7bNx4+EUsqID+Ey8RnAEkesUFG8iaeA1yVvN7jLQGJucrTFKQaR7G X-Received: by 2002:a05:6a21:3984:b0:134:2e3c:9845 with SMTP id ad4-20020a056a21398400b001342e3c9845mr2494579pzc.22.1696445060163; Wed, 04 Oct 2023 11:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445060; cv=none; d=google.com; s=arc-20160816; b=ohunrrNYq2RddO7pyVIbsQP36wQ16xhPkOqRfgJ8rVzDlQwhQqIvY4+c36xXjfn9VT 9c8YOWjauTA8q2jBE734mrDjOqQrtZpuJq+gUj3GicCfkhEgzLt8q4GHDNORf2zCeW05 qvpcxSyMwXlHcMp1ilXhXwEKL9mGtg0FjwTArpC4vMhCv29t3SYCOHa3IaVRiH3vqe8h rW5mA6us6LK29pYINhS0zhAEEVMVopHAdgc447GEOFxbtwBLZYirp1/D3evBWF4+uA98 pbadJHb4xKJkl/hrenjwxAN2w9uLTaylQZ9oLtP32hYe0zXblzxQEPX8zTDPCmWYTbnm uoUg== 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=g1dCvzgzbN9NsGZAcf7ZCqEYIEJvLzNdKYiQVp25y9Q=; fh=PWMgxgslqMjOtye8I2qVy8I5pPekyJtpFTusQltnkEg=; b=Qt9bB05p4COZN8WweGqFRvkdkNdXv6IDTsRfW0LY4O25yTLYYwS1mlOjZt/bkf32m5 R93c7A989fgympJic8nQEf522BDDVZOLfiM3ZI1ttPbuyglN0Fopv2j7ezeLIu3TeKyc 9zXhQSwn6drt0jySg22XcItA3ZWlV+qgyh4P0zSkprsbZ6PZXfAmt0bVmUGfoWjpv6wC zi6/w7UEnyPFVegl5XK1XUWODrtub1LZwTXozH5uIusJySr69F6Ty8epK/5o8UhupxVh a69AOC072LuN+ZgqyvyPRa1tl/Sqh6SsWgeqIo56wwDgRF+TKnDowIjtifNwdmI2ca0I iwbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XZoHMN9m; 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 d6-20020a170902654600b001c7380aca09si4168831pln.512.2023.10.04.11.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:44:20 -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=XZoHMN9m; 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 2195B81E557A; Wed, 4 Oct 2023 11:44:14 -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 S243827AbjJDSk4 (ORCPT + 99 others); Wed, 4 Oct 2023 14:40:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243731AbjJDSku (ORCPT ); Wed, 4 Oct 2023 14:40:50 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA880D8 for ; Wed, 4 Oct 2023 11:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696444846; x=1727980846; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y7kvztODIA2R9OyWe64IJ0e/oXjqlzVTL79vhZqnyKg=; b=XZoHMN9mN+fXvk4PbKdvP/4g2ZMBgyHzOneclm01rRAOsLSPIvvEWnxv RneFT9HvO6Mz+jY3K/Mxds6AZvRQ+zwFYjntd/U5OgugX9UP/2B3Ob/zM TU/agsSc8WTJo9vQzGtrrlWQxjkq+t60Trtgc/eNdoW22r8tOM88GYPnU KthNC9pcdJtCttSdUjvL9+QICb7dRnTUXLPJMKKwVTeW2yqssQgYIeZ5I Alw6bC0qPxmDEs39Ru11/Ds76s3EE1pLpiYEjb+mN72shMRwrNj5WQlEo b9BN70e2zNB2UgLZKafiq/iZOrrqOPYL2gyROrdaIHsjd7lIhviDyEpDd g==; X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="469537702" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208";a="469537702" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 11:40:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="786626017" X-IronPort-AV: E=Sophos;i="6.03,201,1694761200"; d="scan'208";a="786626017" Received: from kanliang-dev.jf.intel.com ([10.165.154.102]) by orsmga001.jf.intel.com with ESMTP; 04 Oct 2023 11:40:42 -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 V4 5/7] tools headers UAPI: Sync include/uapi/linux/perf_event.h header with the kernel Date: Wed, 4 Oct 2023 11:40:42 -0700 Message-Id: <20231004184044.3062788-5-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231004184044.3062788-1-kan.liang@linux.intel.com> References: <20231004184044.3062788-1-kan.liang@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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]); Wed, 04 Oct 2023 11:44:14 -0700 (PDT) X-Spam-Level: ** From: Kan Liang Sync the new sample type for the branch counters feature. Signed-off-by: Kan Liang --- Changes since V3: - Support PERF_SAMPLE_BRANCH_COUNTERS tools/include/uapi/linux/perf_event.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index 39c6a250dd1b..4461f380425b 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 -- 2.35.1