linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 <kan.liang@linux.intel.com>
Subject: [PATCH V2 5/6] tools headers UAPI: Sync include/uapi/linux/perf_event.h header with the kernel
Date: Mon, 22 May 2023 04:30:39 -0700	[thread overview]
Message-ID: <20230522113040.2329924-5-kan.liang@linux.intel.com> (raw)
In-Reply-To: <20230522113040.2329924-1-kan.liang@linux.intel.com>

From: Kan Liang <kan.liang@linux.intel.com>

Sync the new sample type and extension bit for the branch event feature.

Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---

Changes since V1:
- Rename to PERF_SAMPLE_BRANCH_EVT_CNTRS
- Drop the event ID sample type
- Add extension bit

 tools/include/uapi/linux/perf_event.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index 37675437b768..3911cf000e8a 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_EVT_CNTRS_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_EVT_CNTRS	= 1U << PERF_SAMPLE_BRANCH_EVT_CNTRS_SHIFT,
+
 	PERF_SAMPLE_BRANCH_MAX		= 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
 };
 
@@ -1410,6 +1414,7 @@ union perf_mem_data_src {
  *    cycles: cycles from last branch (or 0 if not supported)
  *      type: branch type
  *      spec: branch speculation info (or 0 if not supported)
+ *       ext: has extension space for extra info (or 0 if not supported)
  */
 struct perf_branch_entry {
 	__u64	from;
@@ -1423,7 +1428,8 @@ struct perf_branch_entry {
 		spec:2,     /* branch speculation info */
 		new_type:4, /* additional branch type */
 		priv:3,     /* privilege level */
-		reserved:31;
+		ext:1,      /* has extension */
+		reserved:30;
 };
 
 union perf_sample_weight {
-- 
2.35.1


  parent reply	other threads:[~2023-05-22 11:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 11:30 [PATCH V2 1/6] perf/x86/intel: Add Grand Ridge and Sierra Forest kan.liang
2023-05-22 11:30 ` [PATCH V2 2/6] perf: Add branch stack extension kan.liang
2023-05-23  6:03   ` Sandipan Das
2023-05-23 13:08     ` Liang, Kan
2023-08-02 21:58   ` Peter Zijlstra
2023-08-03 14:22     ` Liang, Kan
2023-05-22 11:30 ` [PATCH V2 3/6] perf: Support branch events kan.liang
2023-05-22 11:30 ` [PATCH V2 4/6] perf/x86/intel: Support LBR event logging kan.liang
2023-05-22 11:30 ` kan.liang [this message]
2023-05-22 11:30 ` [PATCH V2 6/6] perf tools: Add branch event knob kan.liang
2023-05-22 20:26 ` [PATCH V2 1/6] perf/x86/intel: Add Grand Ridge and Sierra Forest Peter Zijlstra
2023-05-22 20:42   ` Luck, Tony
2023-05-22 20:48     ` Peter Zijlstra
2023-06-07 21:43   ` Luck, Tony
2023-06-08  7:24     ` Peter Zijlstra
2023-06-08 16:20       ` Luck, Tony
2023-06-29 22:39         ` Tony Luck
2023-08-02 15:01         ` Peter Zijlstra
2023-06-06 12:42 ` Liang, Kan
2023-06-06 13:24   ` Peter Zijlstra
2023-06-06 16:16     ` Liang, Kan
2023-06-06 18:17       ` Peter Zijlstra
2023-06-06 18:34         ` Liang, Kan
2023-06-06 19:37           ` Peter Zijlstra
2023-06-06 19:54             ` Liang, Kan
2023-08-09 20:04 ` [tip: perf/core] perf/x86/intel: Add Crestmont PMU tip-bot2 for Kan Liang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230522113040.2329924-5-kan.liang@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexey.v.bayduraev@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tinghao.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).