srg-imperial / SaBRe

Load-time selective binary rewriting
Other
152 stars 16 forks source link

Use custom printing routines to avoid fprintf overhead #57

Closed daniel-grumberg closed 3 years ago

daniel-grumberg commented 3 years ago

When testing against syscall_intercept we discovered that the liberal use of fprintf introduced a significant slowdown (5x roughly on the dd benchmark we have been using). To improve this, I made the syscall handler print the current line into a stack local buffer using custom printing routines which gets outputed using a write syscall directly right before the syscall handler terminates.