This code is a bit odd, in autotest's client/cros/power_suspend.py:
if abort_regex.search(line):
wake_source = 'unknown'
match = re.search(r'last active wakeup source: (.*)$',
'\n'.join(self._logs[i-5:i+3]), re.MULTILINE)
...
if "rtc" in driver:
raise sys_power.SuspendTimeout('System took too '
'long to suspend.')
Two problems:
1. It's grepping kernel logs for a pr_debug() message; this is not an ABI, and it might break someday.
2. It assumes that all RTC drivers will have "rtc" in their name; works out fine I guess, but probably unwise.
For #1: why not parse /sys/kernel/debug/wakeup_sources instead? suspend_stress_test does this.
For #2: Might be better to match with /sys/class/rtc/*, or check for an 'rtc' subdevice -- e.g., /sys/devices/.../FOO/rtc
Comment 1 by tbroch@chromium.org
, Mar 8 2017