mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-09 02:24:45 +00:00
tools:acrn-crashlog: Detect and classify the crash in ACRN and kernel
Since ACRN has the capability to reboot and reboot reason is available
in SOS, acrnprobe could detect the crash of acrn and SOS kernel.
List of added crash types:
1. ACRNCRASH - crashed in hypervisor, this detection depends on
files in /tmp/acrnlog_last(provided by acrnlog).
2. IPANIC - crashed in SOS kernel, this detection depends on
pstore.
3. SWWDT_IPANIC - crashed in SOS kernel and reboot reason is wdt.
4. HWWDT_UNHANDLE - only recognize reboot reason is global, there is no
further clues that it's a SOS kernel crash or a
hypervisor crash.
5. SWWDT_UNHANDLE - only recognize reboot reason is wdt, there is no
further clues that it's a SOS kernel crash or a
hypervisor crash.
6. UNKNOWN - only recognize reboot reason is warm, there is no
further clues that it's a SOS kernel crash or a
hypervisor crash.
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#include "fsutils.h"
|
||||
#include "strutils.h"
|
||||
#include "channels.h"
|
||||
#include "startupreason.h"
|
||||
#include "probeutils.h"
|
||||
#include "log_sys.h"
|
||||
|
||||
#define POLLING_TIMER_SIG 0xCEAC
|
||||
@@ -105,11 +107,13 @@ static void channel_oneshot(struct channel_t *cnl)
|
||||
|
||||
LOGD("initializing channel %s ...\n", cname);
|
||||
|
||||
if (!is_boot_id_changed())
|
||||
return;
|
||||
|
||||
e = create_event(REBOOT, cname, NULL, 0, NULL);
|
||||
if (e)
|
||||
event_enqueue(e);
|
||||
|
||||
|
||||
for_each_crash(id, crash, conf) {
|
||||
if (!crash || !is_root_crash(crash))
|
||||
continue;
|
||||
@@ -117,13 +121,26 @@ static void channel_oneshot(struct channel_t *cnl)
|
||||
if (strcmp(crash->channel, cname))
|
||||
continue;
|
||||
|
||||
if (crash->trigger &&
|
||||
!strcmp("file", crash->trigger->type) &&
|
||||
file_exists(crash->trigger->path)) {
|
||||
e = create_event(CRASH, cname, (void *)crash,
|
||||
0, crash->trigger->path);
|
||||
if (e)
|
||||
event_enqueue(e);
|
||||
if (!crash->trigger)
|
||||
continue;
|
||||
|
||||
if (!strcmp("file", crash->trigger->type)) {
|
||||
if (file_exists(crash->trigger->path)) {
|
||||
e = create_event(CRASH, cname, (void *)crash,
|
||||
0, crash->trigger->path);
|
||||
if (e)
|
||||
event_enqueue(e);
|
||||
}
|
||||
} else if (!strcmp("rebootreason", crash->trigger->type)) {
|
||||
char rreason[REBOOT_REASON_SIZE];
|
||||
|
||||
read_startupreason(rreason, sizeof(rreason));
|
||||
if (!strcmp(rreason, crash->content[0])) {
|
||||
e = create_event(CRASH, cname, (void *)crash,
|
||||
0, crash->trigger->path);
|
||||
if (e)
|
||||
event_enqueue(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user