[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Crash-utility] [PATCH] Change the way of determining the Xen scheduler



The command line options (such as opt_sched) are discarded after boot in Xen4, 
so they are no longer available. Use the "ops" variable (if exists) to 
determine the active scheduler. Without this patch, crash fails during 
initialization on Xen4 hypervisor dumps with 'crash: schedule data not 
found.'

Signed-off-by: Petr Tesarik <ptesarik suse cz>
---
 xen_hyper.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -445,13 +445,21 @@ xen_hyper_schedule_init(void)
 		error(FATAL, "cannot malloc scheduler struct space.\n");
 	}
 	buf = GETBUF(XEN_HYPER_SCHEDULER_NAME);	
-	opt_sched = symbol_value("opt_sched");
+	scheduler_opt_name = XEN_HYPER_OFFSET(scheduler_opt_name);
+	if (symbol_exists("ops")) {
+		if (!readmem(symbol_value("ops") + scheduler_opt_name, KVADDR,
+			&opt_sched, sizeof(ulong), "ops.opt_name",
+			RETURN_ON_ERROR)) {
+			error(FATAL, "cannot read ops.opt_name.\n");
+		}
+	} else {
+		opt_sched = symbol_value("opt_sched");
+	}
 	if (!readmem(opt_sched, KVADDR, xhscht->opt_sched,
 	XEN_HYPER_OPT_SCHED_SIZE, "opt_sched,", RETURN_ON_ERROR)) {
 		error(FATAL, "cannot read opt_sched,.\n");
 	}
 	schedulers = symbol_value("schedulers");
-	scheduler_opt_name = XEN_HYPER_OFFSET(scheduler_opt_name);
 	addr = schedulers;
 	while (xhscht->name == NULL) {
 		if (!readmem(addr, KVADDR, schedulers_buf,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]