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

Allow redirecting trace output to a file #275

Merged
merged 3 commits into from
Aug 28, 2023

Commits on Aug 3, 2023

  1. csim: Allow redirecting trace output to a file using command line flag

    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`
    arichardson committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    be0962c View commit details
    Browse the repository at this point in the history
  2. Fix --help output for options without a short flag

    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
    ```
    arichardson committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    ffa591d View commit details
    Browse the repository at this point in the history
  3. Avoid unnecessary empty lines when instruction tracing is on

    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.
    arichardson committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    4f3fd51 View commit details
    Browse the repository at this point in the history