-
Notifications
You must be signed in to change notification settings - Fork 167
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
Allow redirecting trace output to a file #275
Allow redirecting trace output to a file #275
Conversation
ping? |
ping? |
This looks good to me, I don't think there are any reasons not to merge this. The only problem I could foresee is if you don't use these printing functions and use the ones in the Sail standard library they won't be redirected. |
This is useful when booting an operating system with tracing enabled as it allows showing the printed messages on the terminal and storing the trace log to a separate file. All categorized trace messages are now redirected to the --trace-output file when passed. If this option is not gived, the current behaviour of using stdout is retained. Example usage: `./c_emulator/riscv_sim_RV64 -b os-boot/rv64-64mb.dtb --trace-output /dev/stderr os-boot/linux-rv64-64mb.bbl --trace-output /tmp/linux.log`
Previously --help printed the following: ``` -V --no-trace -� --trace-output -l --inst-limit ``` With the new change it is: ``` -V --no-trace --trace-output -l --inst-limit ```
2cdab0f
to
ffa591d
Compare
These empty lines don't add to the readability of the trace and in fact when trace redirection is enabled they result in lots of empty lines being printed to stderr which makes it impossible to read the OS boot messages.
I believe I've addressed all outstanding comments, and I've updated the commit messages to explain which messages are redirected:
I've made these commits logically separate, so please rebase and merge rather than squashing the commits. |
ping? |
This is useful when booting an operating system with tracing enabled
as it allows showing the printed messages on the terminal and storing
the trace log to a separate file.
Example usage:
./c_emulator/riscv_sim_RV64 -b os-boot/rv64-64mb.dtb -t /dev/stderr os-boot/linux-rv64-64mb.bbl --trace-output /tmp/linux.log
This PR also includes a second commit to fix --help for options without a corresponding short option (rebase and merge preferred over squash and merge).