ARM-software / devlib

Library for interaction with and instrumentation of remote devices.
Apache License 2.0
47 stars 78 forks source link

collector/dmesg: Avoid unnecessary dmesg command #636

Closed douglas-raillard-arm closed 1 year ago

douglas-raillard-arm commented 1 year ago

Only run the minimal amount of commands, as executing a command can be costly.

In the sequence reset() -> start(), we only need to get the output of dmesg upon start() to know what part of the log will be ignored (everything before the call to start()). There is no need to perform that upon reset() since the sequence:

reset() -> start() -> stop() -> start() -> stop()
           \______1________/    \______2________/

is anyway equivalent to:

reset() -> start() -> stop()
           \______2________/

So reset() can essentially be a no-op and the actual reset logic lives in start().