-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Logging][Hexagon] Improve logging on Hexagon #13072
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment. Generated by tvm-bot |
2be47be
to
046af15
Compare
More details and discussion at https://discuss.tvm.apache.org/t/improving-logging-on-hexagon-with-proposed-changes-to-logmessageimpl/13731 |
LGTM! Love to see those clean log lines in the discussion post! I want to see if this improves perf at all. |
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.
Thanks for doing this! I have just a few clarifying questions (which likely could be addressed with comments), but otherwise looks good.
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.
overall looks good, added few comments
Currently Hexagon logging is done with a custom LogMessageImpl in hexagon_common.cc. This ends up calling HexagonLog and HEXAGON_PRINT which uses the HAP FARF API. Unfortunately, the TVM log level is lost along the way, with logs being produced at FARF’s ALWAYS level. This becomes especially noisy with RPC debug logging, which generates enough noise to cause some log data to be dropped. It also introduces a lot of useless noise, as the FARF API produces its own line number information, which only points to where hexagon_common.cc calls HEXAGON_PRINT. Using the HAP_debug_v2 API lets us pass the log level and file line information directly, and enables runtime selection of logging levels. This commit explicity passes the log level to LogMessage/LogMessageImpl and updates Hexagon's custom LogMessageImpl to use the HAP_debug_v2 API.
41b1717
to
fe1c5ba
Compare
@supersat LGTM! I started a job on hardware. Will merge after that finishes |
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.
LGTM
* [Logging][Hexagon] Improve logging on Hexagon Currently Hexagon logging is done with a custom LogMessageImpl in hexagon_common.cc. This ends up calling HexagonLog and HEXAGON_PRINT which uses the HAP FARF API. Unfortunately, the TVM log level is lost along the way, with logs being produced at FARF’s ALWAYS level. This becomes especially noisy with RPC debug logging, which generates enough noise to cause some log data to be dropped. It also introduces a lot of useless noise, as the FARF API produces its own line number information, which only points to where hexagon_common.cc calls HEXAGON_PRINT. Using the HAP_debug_v2 API lets us pass the log level and file line information directly, and enables runtime selection of logging levels. This commit explicity passes the log level to LogMessage/LogMessageImpl and updates Hexagon's custom LogMessageImpl to use the HAP_debug_v2 API. * Adjust Hexagon rpc_server logging to use the DEBUG level * Update hexagon_api launcher script to omit DEBUG-level logs * Update WASM LogMessageImpl to accept explicit level * Update Android LogMessageImpl to accept and forward explicit log level * Move LogMessage::level_strings_ out of some ifdefs * Update iOS LogMessageImpl to accept explicit log level * Attempt to fix Windows build * Add comments about runtime hexagon log level encodings * Remove unneeded string processing in LogMessage * Remove TODO * Update HexagonLauncherAndroid to accept runtime log filtering configuration
* [Logging][Hexagon] Improve logging on Hexagon Currently Hexagon logging is done with a custom LogMessageImpl in hexagon_common.cc. This ends up calling HexagonLog and HEXAGON_PRINT which uses the HAP FARF API. Unfortunately, the TVM log level is lost along the way, with logs being produced at FARF’s ALWAYS level. This becomes especially noisy with RPC debug logging, which generates enough noise to cause some log data to be dropped. It also introduces a lot of useless noise, as the FARF API produces its own line number information, which only points to where hexagon_common.cc calls HEXAGON_PRINT. Using the HAP_debug_v2 API lets us pass the log level and file line information directly, and enables runtime selection of logging levels. This commit explicity passes the log level to LogMessage/LogMessageImpl and updates Hexagon's custom LogMessageImpl to use the HAP_debug_v2 API. * Adjust Hexagon rpc_server logging to use the DEBUG level * Update hexagon_api launcher script to omit DEBUG-level logs * Update WASM LogMessageImpl to accept explicit level * Update Android LogMessageImpl to accept and forward explicit log level * Move LogMessage::level_strings_ out of some ifdefs * Update iOS LogMessageImpl to accept explicit log level * Attempt to fix Windows build * Add comments about runtime hexagon log level encodings * Remove unneeded string processing in LogMessage * Remove TODO * Update HexagonLauncherAndroid to accept runtime log filtering configuration
Currently Hexagon logging is done with a custom
LogMessageImpl
inhexagon_common.cc
. This ends up callingHexagonLog
andHEXAGON_PRINT
which uses the HAP FARF API. Unfortunately, the TVM log level is lost along the way, with logs being produced at FARF’sALWAYS
level. This becomes especially noisy with RPC debug logging, which generates enough noise to cause some log data to be dropped. It also introduces a lot of useless noise, as the FARF API produces its own line number information, which only points to wherehexagon_common.cc
callsHEXAGON_PRINT
. Using theHAP_debug_runtime
API lets us pass the log level and file line information directly, and enables runtime selection of logging levels.This commit explicitly passes the log level to
LogMessage
/LogMessageImpl
and updates Hexagon's customLogMessageImpl
to use theHAP_debug_runtime
API.