Make the profiler output binaries (which can be used to visualise the data)
Description
Stats gathered by the (cProfile) profiler can be dumped to a file with the cProfile.dump_stats() method. Such binaries can be used with visualisation tools (for example, snakeviz) to present the data of the profiler.
This patch ensures that the profiler writes sensible logs and .cprofile binaries, with their timestamps (so that data is not lost on a rerun of the profiler).