Skip to content
Permalink
Browse files

sanitycheck: simplify fault detection

Any fatal error will print "ZEPHYR FATAL ERROR" now, so
we don't have to maintain a set of strings in the
sanitycheck harness.py

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
  • Loading branch information...
andrewboie committed Jul 16, 2019
1 parent 96571a8 commit 81ef42d2bcc3d7d59d61fa996712fc6ac5f10e1e
Showing with 8 additions and 14 deletions.
  1. +3 −0 kernel/fatal.c
  2. +5 −14 scripts/sanity_chk/harness.py
@@ -99,6 +99,9 @@ void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
{
struct k_thread *thread = k_current_get();

/* sanitycheck looks for the "ZEPHYR FATAL ERROR" string, don't
* change it without also updating sanitycheck
*/
z_fatal_print(">>> ZEPHYR FATAL ERROR %d: %s", reason,
reason_to_str(reason));

@@ -7,14 +7,7 @@
class Harness:
GCOV_START = "GCOV_COVERAGE_DUMP_START"
GCOV_END = "GCOV_COVERAGE_DUMP_END"
FAULTS = [
"Unknown Fatal Error",
"MPU FAULT",
"Kernel Panic",
"Kernel OOPS",
"BUS FAULT",
"CPU Page Fault"
]
FAULT = "ZEPHYR FATAL ERROR"

def __init__(self):
self.state = None
@@ -72,9 +65,8 @@ def handle(self, line):
self.state = "passed"

if self.fail_on_fault:
for fault in self.FAULTS:
if fault in line:
self.fault = True
if self.FAULT in line:
self.fault = True

if self.GCOV_START in line:
self.capture_coverage = True
@@ -107,9 +99,8 @@ def handle(self, line):
self.state = "failed"

if self.fail_on_fault:
for fault in self.FAULTS:
if fault in line:
self.fault = True
if self.FAULT in line:
self.fault = True

if self.GCOV_START in line:
self.capture_coverage = True

0 comments on commit 81ef42d

Please sign in to comment.
You can’t perform that action at this time.