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

tracer: make bytes truncation configurable #60

Merged
merged 4 commits into from
Jul 26, 2023
Merged

Conversation

chriso
Copy link
Contributor

@chriso chriso commented Jun 20, 2023

To keep output reasonable when a program does large reads and writes, the tracer truncates strings after 32 bytes. This PR makes the truncation point configurable via a --tracer-string-size command-line option.

Example:

$ wasirun --trace hello.wasm
...
FDWrite(1, [1]IOVec{[14]byte("Hello, World!\n")}) => 14
...
$ wasirun --trace --tracer-string-size 5 hello.wasm
...
FDWrite(1, [1]IOVec{[14]byte("Hello"...)}) => 14
...

This is like strace's -s, --strsize option.

tracer.go Outdated Show resolved Hide resolved
@chriso chriso closed this Jul 26, 2023
@chriso chriso reopened this Jul 26, 2023
@chriso chriso merged commit 8d274b9 into main Jul 26, 2023
2 checks passed
@chriso chriso deleted the configurable-tracer-bytes branch July 26, 2023 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants