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

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