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

Summarize panics if piped into head #31

Open
Darksonn opened this issue Apr 25, 2019 · 1 comment
Open

Summarize panics if piped into head #31

Darksonn opened this issue Apr 25, 2019 · 1 comment
Labels
bug Something isn't working T-summarize Related to the summarize tool

Comments

@Darksonn
Copy link
Contributor

Summarize prints a very long table so I piped it into head to get the start of the output, however it panics:

$ ~/src/measureme/target/debug/summarize pid-8987 | head
+------------------------------------------+-----------+-----------------+------------+------------+--------------+-----------------------+
| Item                                     | Self time | % of total time | Item count | Cache hits | Blocked time | Incremental load time |
+------------------------------------------+-----------+-----------------+------------+------------+--------------+-----------------------+
| LLVM_emit_obj                            | 3.72s     | 44.144          | 152        | 0          | 0.00ns       | 0.00ns                |
+------------------------------------------+-----------+-----------------+------------+------------+--------------+-----------------------+
| LLVM_module_passes                       | 873.62ms  | 10.379          | 152        | 0          | 0.00ns       | 0.00ns                |
+------------------------------------------+-----------+-----------------+------------+------------+--------------+-----------------------+
| LLVM_make_bitcode                        | 608.96ms  | 7.235           | 152        | 0          | 0.00ns       | 0.00ns                |
+------------------------------------------+-----------+-----------------+------------+------------+--------------+-----------------------+
| typeck_tables_of                         | 484.63ms  | 5.758           | 953        | 0          | 0.00ns       | 0.00ns                |
thread 'main' panicked at 'Cannot print table to standard output : Broken pipe (os error 32)', /home/alice/.cargo/registry/src/github.com-1ecc6299db9ec823/prettytable-rs-0.8.0/src/lib.rs:194:23
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
@wesleywiser wesleywiser added the T-summarize Related to the summarize tool label Apr 25, 2019
@wesleywiser wesleywiser added the bug Something isn't working label May 10, 2019
@marieell
Copy link
Contributor

Maybe the easiest and nicest would be to not use prettytable and not buffer output if stdout is not a tty?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working T-summarize Related to the summarize tool
Projects
None yet
Development

No branches or pull requests

3 participants