Support for multiple JSON stat dumps
The current JSON stat dumper doesn't store multiple dumps. Storing multiple dumps in a single file is currently not supported by the JSON schema we use and is likely to be complicated for multiple reasons.
A simple way to add support for multiple dumps would be to store them in different files. We have a similar issue when forking the simulator to simulate different options. In that case, the fork function in simulate.py uses Python's built in string formatting function to generate a file name from a template provided by the user. The template is formatted using a dictionary of "useful things" (fork sequence number, current tick, etc).
We could do something similar for stat dumps, for example a user could specify a file name like this:
Unlike the fork function, we should probably use str.format to avoid the need for a '%' on the command line.
It would be nice if we could support this mechanism for C++ stat dumpers as well, but that’d require us to refactor the interface to the dumper and provide a filename when the dump is created.