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 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 [thread overview]
Message-ID: <20231004184044.3062788-5-kan.liang@linux.intel.com> (raw)
In-Reply-To: <20231004184044.3062788-1-kan.liang@linux.intel.com>
From: Kan Liang <kan.liang@linux.intel.com>
Sync the new sample type for the branch counters feature.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---
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
next prev parent reply other threads:[~2023-10-04 18:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 18:40 [PATCH V4 1/7] perf: Add branch stack counters kan.liang
2023-10-04 18:40 ` [PATCH V4 2/7] perf/x86: Add PERF_X86_EVENT_NEEDS_BRANCH_STACK flag kan.liang
2023-10-04 18:40 ` [PATCH V4 3/7] perf: Add branch_sample_call_stack kan.liang
2023-10-04 18:40 ` [PATCH V4 4/7] perf/x86/intel: Support LBR event logging kan.liang
2023-10-19 9:23 ` Peter Zijlstra
2023-10-19 13:56 ` Liang, Kan
2023-10-19 9:26 ` Peter Zijlstra
2023-10-19 13:58 ` Liang, Kan
2023-10-19 10:52 ` Peter Zijlstra
2023-10-19 14:26 ` Liang, Kan
2023-10-19 18:18 ` Peter Zijlstra
2023-10-19 11:00 ` Peter Zijlstra
2023-10-19 14:28 ` Liang, Kan
2023-10-19 11:09 ` Peter Zijlstra
2023-10-19 14:31 ` Liang, Kan
2023-10-19 11:12 ` Peter Zijlstra
2023-10-20 12:45 ` Liang, Kan
2023-10-04 18:40 ` kan.liang [this message]
2023-10-04 18:40 ` [PATCH V4 6/7] perf header: Support num and width of branch counters kan.liang
2023-10-04 18:40 ` [PATCH V4 7/7] perf tools: Add branch counter knob kan.liang
2023-10-16 17:48 ` [PATCH V4 1/7] perf: Add branch stack counters Liang, Kan
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=20231004184044.3062788-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