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

case-lib: add support for no logger mode #811

Closed
wants to merge 1 commit into from

Conversation

aiChaoSONG
Copy link

Logger is not supported for firmware without
ldc file, add a new mode to test without
sof-logger.

Signed-off-by: Chao Song [email protected]

@aiChaoSONG aiChaoSONG requested a review from a team as a code owner November 24, 2021 04:40
@aiChaoSONG
Copy link
Author

To use this feature, run export NO_LOGGER_MODE=true before run any test cases, or you can make this line in your .bashrc. if you run test case remotely via ssh, insert NO_LOGGER_MODE=true into /etc/environment

keqiaozhang
keqiaozhang previously approved these changes Nov 24, 2021
@marc-hb
Copy link
Collaborator

marc-hb commented Nov 24, 2021

How about downgrading the find_ldc_file failure to your dlogw warning instead?

@aiChaoSONG
Copy link
Author

How about downgrading the find_ldc_file failure to your dlogw warning instead?

I think it can not resolve the problem, even if the function find_ldc_file is not fatal, sof-test still try to start sof-logger, and kill it in the end, which causes the case failure. What Pierres want is the no logger mode actually, that is when there is no ldc file, or even logger cannot support the FW, we still want the test case run, and get the right exit status.

case-lib/lib.sh Outdated Show resolved Hide resolved
@marc-hb
Copy link
Collaborator

marc-hb commented Nov 24, 2021

even if the function find_ldc_file is not fatal, sof-test still try to start sof-logger,

No, see suggested code change above.

What Pierres want is the no logger mode actually, that is when there is no ldc file, or even logger cannot support the FW, we still want the test case run, and get the right exit status.

The user should not have to manually tell sof-test that there is no .ldc file when there is already a function that knows how to look for the .ldc file automatically.

@aiChaoSONG
Copy link
Author

This is kind of use ldc file to hide sof-logger incapability

case-lib/config.sh Outdated Show resolved Hide resolved
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of use ldc file to hide sof-logger incapability

Why would you install an .ldc file when it cannot work?

Now let's say you want to temporarily test without a working sof-logger for some reason like #726. Then it's much simpler to rename the .ldc file than remember the name of an environment variable and pass it to a far away process.

case-lib/config.sh Outdated Show resolved Hide resolved
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there is already a logger_disabled() function in the same lib.sh file, so we should adjust it and not duplicate it elsewhere. It was successfully used by Zephyr for a few months.

See #681, #726 and commit 0a464ff

@aiChaoSONG
Copy link
Author

@marc-hb OK, let keep on your first suggestion.

case-lib/lib.sh Outdated Show resolved Hide resolved
@marc-hb
Copy link
Collaborator

marc-hb commented Nov 29, 2021

Also, there is already a logger_disabled() function in the same lib.sh file, so we should adjust it and not duplicate it elsewhere. It was successfully used by Zephyr for a few months.
See #681, #726 and commit 0a464ff

Zephyr could not use sof-logger for months. Yet it could pass some tests with zero dependency on sof-logger thanks to the function logger_disabled(). As this function logger_disabled() has been well tested up to 1 week ago and still exists, please re-use it and modify it. Don't change func_lib_start_log_collect() at all.

Logger is not supported, add a new mode to
run test without sof-logger.

Signed-off-by: Chao Song <[email protected]>
@marc-hb
Copy link
Collaborator

marc-hb commented Nov 30, 2021

v1 commit 7b89481 used manual LOGGER_MODE configuration
v2 commit 6f1c6aa used automatic find_ldc_file configuration
v3 commit 161b34e is back to manual LOGGER_MODE configuration (in a better tested place)

Any objection to automatic configuration in the better tested place?

In general, the fewer settings the better. Fewer settings means everyone including CI runs the same code, it reduces combinatorial explosion.

Here's why I think we can and should avoid a new LOGGER_MODE setting:

  • If you have no matching .ldc filename on your system, then why would you be required to manually configure sof-test with LOGGER_MODE=false to say that you don't want logging? You can't have logging anyway without a matching .ldc file, so it should be obvious that you don't want logging. If the lack of .ldc file was an accident, then it's not the job of every test to detect that system configuration accident and a new variable is a very high price to pay for just that.

  • If you do have a matching .ldc filename on your system, then

    • either it works and sof-test should definitely be using it
    • or it does not work (leftover from a previous build?) and your system configuration is broken and must be cleaned up: just delete that bogus .ldc file. Again it's not the job of the tests to verify your system configuration, it's better and simpler if the tests assume the system is configured correctly and automatically adjust to it. There's an infinite number of ways to misconfigure a system; sof-test should only report the very dangerous / time-consuming misconfigurations. Thanks to the dictionary checksum this misconfiguration has a very good error message already.

On the other hand, sof-test should always report clearly whether it found some .ldc file or not and what decision it made.

marc-hb added a commit to marc-hb/sof-test that referenced this pull request Dec 1, 2021
Some configurations don't support the logger. Others do but do not want
to run it for various reasons.

Supersedes thesofproject#811, see earlier discussions there.

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb
Copy link
Collaborator

marc-hb commented Dec 1, 2021

In a private discussion @plbossart expressed a strong preference for the environment variable type of interface.

My top concern with the environment variable was adding a new configuration step for everyone who does not have or want any .ldc file (valid or not). As mentioned by @plbossart , this includes some Linux distributions.

After some more thought I realized we can have it all: automated when possible and both manual configuration ways. This is what I just submitted in #813 which I hope will supersede this.

Note I changed the environment variable to SOF_LOGGING=none so it's ready for a future SOF_LOGGING=etrace as requested in #726

marc-hb added a commit to marc-hb/sof-test that referenced this pull request Dec 1, 2021
Some configurations don't support the logger. Others do but do not want
to run it for various reasons.

Supersedes thesofproject#811, see earlier discussions there.

Signed-off-by: Marc Herbert <[email protected]>
marc-hb added a commit that referenced this pull request Dec 2, 2021
Some configurations don't support the logger. Others do but do not want
to run it for various reasons.

Supersedes #811, see earlier discussions there.

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb
Copy link
Collaborator

marc-hb commented Dec 2, 2021

Superseded by #813

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.

5 participants