From: Marco Cavenati <cavenati.marco@gmail.com>
To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org
Cc: vincenzo.mezzela@gmail.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org,
Marco Cavenati <cavenati.marco@gmail.com>
Subject: [PATCH] perf/x86/intel/pt: Fix outdated and add docs
Date: Thu, 16 May 2024 23:42:36 +0200 [thread overview]
Message-ID: <20240516214235.14770-1-cavenati.marco@gmail.com> (raw)
This patch adds docs for the TOPA_SHIFT constatnt and for the sizes
function, removes two outdated parameters from the documentation of the
struct pt_buffer and renames the constant PT_FILTERS_NUM to
PT_FILTERS_MAX_NUM making clearer that the number of filters can be lower
since it depends on the CPU as specified in Intel's SDM.
Signed-off-by: Marco Cavenati <cavenati.marco@gmail.com>
---
arch/x86/events/intel/pt.h | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/arch/x86/events/intel/pt.h b/arch/x86/events/intel/pt.h
index 96906a62aacd..fd5d9095997b 100644
--- a/arch/x86/events/intel/pt.h
+++ b/arch/x86/events/intel/pt.h
@@ -17,8 +17,18 @@
*/
#define TOPA_PMI_MARGIN 512
+/*
+ * Shift for 4K-aligned values
+ */
#define TOPA_SHIFT 12
+/**
+ * sizes() - compute output buffer size in bytes from ToPA entry encoded size
+ *
+ * @tsz: encoded ToPA entry size
+ *
+ * Return: size in bytes
+ */
static inline unsigned int sizes(unsigned int tsz)
{
return 1 << (tsz + TOPA_SHIFT);
@@ -61,7 +71,6 @@ struct pt_pmu {
* @cur_idx: current output region's index within @cur table
* @output_off: offset within the current output region
* @data_size: running total of the amount of data in this buffer
- * @lost: if data was lost/truncated
* @head: logical write offset inside the buffer
* @snapshot: if this is for a snapshot/overwrite counter
* @single: use Single Range Output instead of ToPA
@@ -70,7 +79,6 @@ struct pt_pmu {
* @stop_te: STOP topa entry pointer
* @intr_te: INT topa entry pointer
* @data_pages: array of pages from perf
- * @topa_index: table of topa entries indexed by page offset
*/
struct pt_buffer {
struct list_head tables;
@@ -87,7 +95,7 @@ struct pt_buffer {
void **data_pages;
};
-#define PT_FILTERS_NUM 4
+#define PT_FILTERS_MAX_NUM 4
/**
* struct pt_filter - IP range filter configuration
@@ -107,7 +115,7 @@ struct pt_filter {
* @nr_filters: number of defined filters in the @filter array
*/
struct pt_filters {
- struct pt_filter filter[PT_FILTERS_NUM];
+ struct pt_filter filter[PT_FILTERS_MAX_NUM];
unsigned int nr_filters;
};
--
2.39.2
reply other threads:[~2024-05-16 21:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240516214235.14770-1-cavenati.marco@gmail.com \
--to=cavenati.marco@gmail.com \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=vincenzo.mezzela@gmail.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 read-only IMAP folder(s) and NNTP newsgroup(s).