crash-reporter: add a sanity check for kernel dmesg records

On some devices, after a cold boot, a junk pstore record
/dev/pstore/dmesg-ramoops-0 is created which is just a chunk
of uninitialized memory containing random bits, and it's not
the result of a kernel crash.

The sanity check scans for the dmesg log level pattern to
avoid creating junk .kcrash files.

TEST=platform_KernelErrorPaths with 3.8 and 3.14 kernel;
check no kcrash file is created for random binary ramoops dump
on stumpy.

Change-Id: I83041436cd8e5e0c7c0015c529f462032ce82f30
Signed-off-by: Ben Zhang <>
Reviewed-by: Olof Johansson <>
Reviewed-by: Grant Grundler <>
Reviewed-by: Mike Frysinger <>
2 files changed
tree: 81edf49d356e7bb8ea11a7adcfdb7248d2684440
  1. crash_reporter/