Blame SOURCES/0003-Do-not-dump-on-the-Single-Range-Output-mode.patch

5b7cf4
From 14fe81602c9dd2f64ab803ed9c83b243226a6b05 Mon Sep 17 00:00:00 2001
5b7cf4
From: Lianbo Jiang <lijiang@redhat.com>
5b7cf4
Date: Tue, 19 Jul 2022 13:31:02 +0800
5b7cf4
Subject: [PATCH 3/3] Do not dump on the Single Range Output mode
5b7cf4
5b7cf4
Kernel commit 670638477aed ("perf/x86/intel/pt: Opportunistically use
5b7cf4
single range output mode") may cause the following failure:
5b7cf4
5b7cf4
  ptdump: page excluded: kernel virtual address: xxx  type: "struct topa_entry"
5b7cf4
  Cannot read topa table
5b7cf4
5b7cf4
When working on the Single Range Output mode, not support to dump and
5b7cf4
pint a warning.
5b7cf4
5b7cf4
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
5b7cf4
---
5b7cf4
 ptdump.c | 11 +++++++++++
5b7cf4
 1 file changed, 11 insertions(+)
5b7cf4
5b7cf4
diff --git a/ptdump.c b/ptdump.c
5b7cf4
index 54e4391739e3..d48cd0126716 100644
5b7cf4
--- a/ptdump.c
5b7cf4
+++ b/ptdump.c
5b7cf4
@@ -189,6 +189,17 @@ int init_pt_info(int cpu)
5b7cf4
 		dbgprintf(fp, "  %d: 0x%016lx\n", i, page);
5b7cf4
 	}
5b7cf4
 
5b7cf4
+	if (MEMBER_EXISTS("pt_buffer", "single")) {
5b7cf4
+		uint single = 0;
5b7cf4
+		if(!get_member(pt_info_ptr->pt_buffer, "pt_buffer", "single", &single)) {
5b7cf4
+			fprintf(fp, "failed to read pt_buffer.");
5b7cf4
+			return FALSE;
5b7cf4
+		}
5b7cf4
+
5b7cf4
+		if (!!single)
5b7cf4
+			error(FATAL, "Not support because of using Single Range Output instead of ToPA.\n");
5b7cf4
+        }
5b7cf4
+
5b7cf4
 	/* Get pt registes saved on panic */
5b7cf4
 	if(!get_member(pt_info_ptr->pt_buffer, "pt_buffer", "cur",
5b7cf4
 		       &topa_base))
5b7cf4
-- 
5b7cf4
2.31.1
5b7cf4