Today I want to bench my program with many threads. However, from the docs of valgrind:
--max-threads= [default: 500]
By default, Valgrind can handle to up to 500 threads. Occasionally, that number is too small. Use this option to provide a different limit. E.g. --max-threads=3000.
Also there may be other reasons for which people may want to add args to valgrind.
I think we can pass the args by env such as VALGRIND_FLAGS like RUST_FLAGS in Cargo.