From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Adrian Hunter <adrian.hunter@intel.com>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 4.19] perf/x86/intel/pt: Fix buffer full but size is 0 case
Date: Wed, 4 Dec 2024 17:11:51 -0500 [thread overview]
Message-ID: <20241204160811-7c261423eb5dcf59@stable.kernel.org> (raw)
In-Reply-To: <20241204181126.61934-1-adrian.hunter@intel.com>
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 5b590160d2cf776b304eb054afafea2bd55e3620
Status in newer kernel trees:
6.12.y | Present (different SHA1: bd0081617661)
6.11.y | Present (different SHA1: 549225e02e9b)
6.6.y | Present (different SHA1: 1488d93e3e1f)
6.1.y | Present (different SHA1: bda8868213ee)
5.15.y | Present (different SHA1: 1b843f820f7a)
5.10.y | Present (different SHA1: b243226da582)
5.4.y | Not found
4.19.y | Not found
Note: The patch differs from the upstream commit:
---
1: 5b590160d2cf7 ! 1: 787e984867a5b perf/x86/intel/pt: Fix buffer full but size is 0 case
@@ Metadata
## Commit message ##
perf/x86/intel/pt: Fix buffer full but size is 0 case
+ commit 5b590160d2cf776b304eb054afafea2bd55e3620 upstream.
+
If the trace data buffer becomes full, a truncated flag [T] is reported
in PERF_RECORD_AUX. In some cases, the size reported is 0, even though
data must have been added to make the buffer full.
@@ Commit message
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20241022155920.17511-2-adrian.hunter@intel.com
+ Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
## arch/x86/events/intel/pt.c ##
@@ arch/x86/events/intel/pt.c: static void pt_buffer_advance(struct pt_buffer *buf)
@@ arch/x86/events/intel/pt.c: static void pt_buffer_advance(struct pt_buffer *buf)
+ buf->wrapped = false;
+
- if (buf->single) {
- local_set(&buf->data_size, buf->output_off);
- return;
+ /* offset of the first region in this table from the beginning of buf */
+ base = buf->cur->offset + buf->output_off;
+
@@ arch/x86/events/intel/pt.c: static void pt_update_head(struct pt *pt)
} else {
old = (local64_xchg(&buf->head, base) &
@@ arch/x86/events/intel/pt.c: static void pt_update_head(struct pt *pt)
## arch/x86/events/intel/pt.h ##
@@ arch/x86/events/intel/pt.h: struct pt_pmu {
+ * @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
+ * @wrapped: buffer advance wrapped back to the first topa table
- * @stop_pos: STOP topa entry index
- * @intr_pos: INT topa entry index
- * @stop_te: STOP topa entry pointer
+ * @stop_pos: STOP topa entry in the buffer
+ * @intr_pos: INT topa entry in the buffer
+ * @data_pages: array of pages from perf
@@ arch/x86/events/intel/pt.h: struct pt_buffer {
+ local_t data_size;
local64_t head;
bool snapshot;
- bool single;
+ bool wrapped;
- long stop_pos, intr_pos;
- struct topa_entry *stop_te, *intr_te;
+ unsigned long stop_pos, intr_pos;
void **data_pages;
+ struct topa_entry *topa_index[0];
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-4.19.y | Success | Success |
next prev parent reply other threads:[~2024-12-04 23:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 15:03 FAILED: patch "[PATCH] perf/x86/intel/pt: Fix buffer full but size is 0 case" failed to apply to 4.19-stable tree gregkh
2024-12-04 18:11 ` [PATCH 4.19] perf/x86/intel/pt: Fix buffer full but size is 0 case Adrian Hunter
2024-12-04 22:11 ` Sasha Levin [this message]
2024-12-06 9:29 ` Greg KH
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=20241204160811-7c261423eb5dcf59@stable.kernel.org \
--to=sashal@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=stable@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.