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

Tools: Testbench: Set default trace level to info #9575

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

singalsu
Copy link
Collaborator

@singalsu singalsu commented Oct 14, 2024

This speeds up a lot scripts/host-testbench.sh execution that should also help CI workload. The xt-testbench shows with this comparable MCPS to a real device after not consuming most of performance to debug traces printing. The other patches also improve the testbench traces print format.

@singalsu singalsu changed the title Tools: Tesbench: Set trace level to info when option quiet is set Tools: Testbench: Set trace level to info when option quiet is set Oct 15, 2024
@singalsu singalsu force-pushed the testbench_trace_flood_control branch from d0db1a0 to 1e14666 Compare October 15, 2024 07:50
@singalsu singalsu marked this pull request as ready for review October 15, 2024 07:53
if (tp->quiet)
host_trace_level = LOG_LEVEL_INFO;
else
host_trace_level = LOG_LEVEL_DEBUG;
Copy link
Collaborator

Choose a reason for hiding this comment

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

you already can use -d to set host_trace_level, seems not very logical to have 2 arguments directly affect the same parameter. Besides .quiet is also already used to set host_trace_level:

if (tp->quiet)
tb_enable_trace(0); /* reduce trace output */
else
tb_enable_trace(1);

and then

sof/tools/testbench/utils.c

Lines 228 to 230 in cbcd51f

void tb_enable_trace(unsigned int log_level)
{
host_trace_level = log_level;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, true that it is confusing and there would be lottery if use both. Maybe I should set default trace level to info and drop -q option (need to be removed from some scripts).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lyakh Now the command line options should be consistent.

The test for trace level was wrong way, higher priority traces
like errors have a lower number value. It caused non-controllable
flood of debug traces.

These changes help scripts to extract trace from stderr output
with string "trace:" printed to begin of each line. The time and
level information is made similar to normal trace output in devices.

Example of printed trace:
trace: [1728921012.720684] <inf> (eq_iir.c:55) eq_iir_init()

Signed-off-by: Seppo Ingalsuo <[email protected]>
@singalsu singalsu force-pushed the testbench_trace_flood_control branch from a0815d6 to a6bb94d Compare October 16, 2024 15:29
@singalsu singalsu changed the title Tools: Testbench: Set trace level to info when option quiet is set Tools: Testbench: Set default trace level to info Oct 16, 2024
@singalsu singalsu requested a review from lyakh October 16, 2024 15:30
tools/testbench/utils.c Outdated Show resolved Hide resolved
The default testbench trace level debug consumes a lot of
processing time due to large amount of prints. It also adds
a lot to measured MCPS with xtensa build of testbench.

The command line options -d and -q controlled the same
host_trace_level that was confusing. Also the handling of
option -d was wrong. As a fix the command -q is removed
and -d is fixed to usable.

The default trace level is LOG_LEVEL_INFO (3) that is applied
if no option -d <level> is given. It is a suitable level for
code profiling and performance measurement.

The wrappers for testbench run comp_run.sh, tdfb_direction_test.m,
and tdfb_test.m are updated due to the changes in testbench
trace control.

Signed-off-by: Seppo Ingalsuo <[email protected]>
The previously removed command line options are removed from
help text print to avoid confusion.

The functions tb_debug_print() and tb_check_trace() are used
to reduce printing of less important messages those are still
useful when debugging issues with components or testbench
itself. Also tplg_debug() makes prints more clean looking
with "debug:" prefix.

Signed-off-by: Seppo Ingalsuo <[email protected]>
@singalsu singalsu force-pushed the testbench_trace_flood_control branch from a6bb94d to 19780c7 Compare October 16, 2024 16:05
@kv2019i kv2019i merged commit 735cf0a into thesofproject:main Oct 17, 2024
42 of 47 checks passed
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.

4 participants