stdlib: Add Kernel Panic/Oops exit event to stdlib
RISCV full system workloads have the capability of exit the simulation loop upon the guest's kernel panic/oops. This change adds more stdlib exit event types to accommodate the corresponding gem5 exits upon the guest's kernel panic and kernel oops. Change-Id: I3a4f313711793a473c6f138ff831b948034d0bb6 Signed-off-by: Hoa Nguyen <hn@hnpl.org>
This commit is contained in:
committed by
Jason Lowe-Power
parent
cf087d4d11
commit
4a77d532b0
@@ -53,6 +53,8 @@ class ExitEvent(Enum):
|
||||
PERF_COUNTER_DISABLE = "performance counter disabled"
|
||||
PERF_COUNTER_RESET = "performance counter reset"
|
||||
PERF_COUNTER_INTERRUPT = "performance counter interrupt"
|
||||
KERNEL_PANIC = "kernel panic in simulated system"
|
||||
KERNEL_OOPS = "kernel oops in simulated system"
|
||||
|
||||
@classmethod
|
||||
def translate_exit_status(cls, exit_string: str) -> "ExitEvent":
|
||||
@@ -103,6 +105,10 @@ class ExitEvent(Enum):
|
||||
return ExitEvent.PERF_COUNTER_RESET
|
||||
elif exit_string == "performance counter interrupt":
|
||||
return ExitEvent.PERF_COUNTER_INTERRUPT
|
||||
elif exit_string == "Kernel panic in simulated system.":
|
||||
return ExitEvent.KERNEL_PANIC
|
||||
elif exit_string == "Kernel oops in simulated system.":
|
||||
return ExitEvent.KERNEL_OOPS
|
||||
elif exit_string.endswith("will terminate the simulation.\n"):
|
||||
# This is for the traffic generator exit event
|
||||
return ExitEvent.EXIT
|
||||
|
||||
@@ -308,6 +308,8 @@ class Simulator:
|
||||
"max instructions",
|
||||
"exiting the simulation",
|
||||
)(),
|
||||
ExitEvent.KERNEL_PANIC: exit_generator(),
|
||||
ExitEvent.KERNEL_OOPS: exit_generator(),
|
||||
}
|
||||
|
||||
if on_exit_event:
|
||||
|
||||
Reference in New Issue
Block a user