Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collector/dmesg: Avoid unnecessary dmesg command #636

Merged

Conversation

douglas-raillard-arm
Copy link
Contributor

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().

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().
@marcbonnici marcbonnici merged commit cf4d3b5 into ARM-software:master Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants