-
Notifications
You must be signed in to change notification settings - Fork 3k
Remove STM's qspi_api trace which is verbose and slows down operations #13804
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
Conversation
@LDong-Arm, thank you for your changes. |
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.
Impact of changes
No more traces generated from STM's qspi_api implementation, when mbed-trace is enabled.
You have to explain me this...
If you don't want trace, you disable trace...
If you find it too much verbose, you can change some info trace to debug
info is way to generous here. However, the trace that is being removed is only printing arguments and the name of the function being executed. The same could be done on the driver level (another question would be if we really need this type of tracing in the driver, but that is for a review in another issue/pull request). |
OK, so just replace tr_info in qspi_command_transfer by tr_debug |
@jeromecoutant @0xc0170 I'm happy to change it to |
Part of the answer is mbed-trace is newer than most HALs, so most sorted out their porting infrastructure without it, and didn't update. When something new is progressing slowly through the system without an active conversion push, you don't want to back it out on the grounds of consistency. (But that natural response is a good reason to do a conversion push if you mean it). Other answer is that most people don't want to see debug from subsystems they're not working on, such as the HAL, but there isn't a per-subsystem/file switch for it. Linux trace gets this right in that its printk "debug" level is not all-or-nothing in filters, like other levels, but has to be activated for specific files. We could do that using the mbed-trace group (ideally with some macro magic to allow compiler exclusion). Best current compromise is to make sure this debug is at debug level, and expect normal non-developer operation (like Greentea tests) to set global filter level to info or higher to avoid it. |
This is the key problem. I want to debug the project I work on by setting trace level to debug, without traces from other modules. mbed-os/connectivity/lwipstack/mbed_lib.json Lines 57 to 60 in 78c8d84
So now I propose one "HAL tracing" config that affects all HALs of all targets (for now, it's only relevant to ST's QSPI). |
There is group filtering in mbed-trace you can use. I'm not sure how many options it offers though - can you say "all except X,Y,Z" or "only X,Y,Z"? I know you can't do "all info, and debug only from X". That's the main omission. Plus the fact that there's no compile-time group exclusion. There should be no need for every component to invent its own local switch - the intent was that mbed-trace would handle this centrally using the groups, it's just that the API is not fleshed out enough. |
@kjbracey-arm That's a good idea, I'll try it. |
@LDong-Arm Any update for this PR? |
I'll close this PR and create a new one to change |
Summary of changes
While tracing can be useful, trace in STM's qspi_api HAL is verbose and slows down operations - printing takes way longer than most storage operations.
Since HAL implementations are fundamental, it should have very low overhead and be assumed to work reliable without the need for tracing. STM qspi_api is the only place in targets/ where mbed-trace is used, so this PR removes it.
Impact of changes
No more traces generated from STM's qspi_api implementation, when mbed-trace is enabled.
Migration actions required
None.
Documentation
None.
Pull request type
Test results
Reviewers
@ARMmbed/mbed-os-hal @mbed-os-core @ARMmbed/team-st-mcd