-
Notifications
You must be signed in to change notification settings - Fork 322
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
Tools: Testbench: Set default trace level to info #9575
Conversation
d0db1a0
to
1e14666
Compare
tools/testbench/testbench.c
Outdated
if (tp->quiet) | ||
host_trace_level = LOG_LEVEL_INFO; | ||
else | ||
host_trace_level = LOG_LEVEL_DEBUG; |
There was a problem hiding this comment.
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
:
sof/tools/testbench/testbench.c
Lines 485 to 488 in cbcd51f
if (tp->quiet) | |
tb_enable_trace(0); /* reduce trace output */ | |
else | |
tb_enable_trace(1); |
and then
Lines 228 to 230 in cbcd51f
void tb_enable_trace(unsigned int log_level) | |
{ | |
host_trace_level = log_level; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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]>
a0815d6
to
a6bb94d
Compare
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]>
a6bb94d
to
19780c7
Compare
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.