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

Optimize Valgrind event generation #1

Open
mikelui opened this issue Jun 1, 2018 · 1 comment
Open

Optimize Valgrind event generation #1

mikelui opened this issue Jun 1, 2018 · 1 comment
Labels
enhancement New feature or request frontend/valgrind

Comments

@mikelui
Copy link
Member

mikelui commented Jun 1, 2018

The Valgrind frontend (sigrind) uses a heavily modded Callgrind implementation, which was chosen for its built-in function tracking functionality. For very heavyweight analysis/characterization, like generating SynchroTraces, this is okay because the workload analysis covers up the slow event generation. For simpler prism tools, the sigrind event generation is excessively slow.

A lighter-weight Valgrind frontend (gengrind) has been in progress, with its function-tracking logic also based on Callgrind's. Right now gengrind is not implemented because a dead-end was hit inserting conditional VEX IR for turning instrumentation "on" and "off" without having to flush the instrumented basic blocks.

This is easily done in DynamoRIO by adding branches to labels. However, the support in mainline Valgrind for this is poor. The two options are conditional dirty calls and insert VEX Exit statements.

  • Conditional dirty calls would require saving each BB's events in separate buffers, increasing overall memory usage and hurting cache performance
  • VEX Exit statements can only target addresses in the original binary, and they appear to generate extra basic blocks, obfuscating the workload.

The 'jit-hacks-2' branch of Valgrind has some dedicated support of IfThenElse VEX IR statements, and should be investigated further.

@mikelui mikelui added the enhancement New feature or request label Jun 1, 2018
@mikelui
Copy link
Member Author

mikelui commented Jun 19, 2018

This is being addressed in https://github.com/VANDAL/valgrind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend/valgrind
Projects
None yet
Development

No branches or pull requests

1 participant