On Mon, Oct 31, 2022 at 3:39 PM Limonciello, Mario <Mario.Limonciello@xxxxxxx> wrote: > > Just thinking about it a little bit more, it could be a lot nicer to have something like: > > /sys/power/suspend_stats/last_hw_deepest_state While I agree that reporting through a framework is generally better than getting infrastructure to grep for specific strings, I believe that a simple sysfs file is probably too simplistic. 1. We need more sophisticated reporting than just last_hw_deepest_state: - sometimes the system enters the deep state we want, yet after a while moves back up and gets "stuck" in an intermediate state (below S0). Or, the system enters the deep state we want, but moves back to S0 after a time without apparent reason. These platform-dependent failures are not so easily describable in a generic framework. - ChromeOS in particular has multiple independent S0ix / S3 / s2idle failure report sources. We have the kernel warning above; also our Embedded Controller monitors suspend failure cases which the simple kernel warning cannot catch, reported through a separate WARN_ONCE(). 2. A simple sysfs file will need to be polled by the infrastructure after every suspend; it would be preferable to have some signal or callback which the infrastructure could register itself with. The generic infrastructure to support this sounds like quite a bit of work, and for what gain? Compared to simply matching a log string and sending the whole dmesg if there's a match. Is the light worth the candle? Sven