vendredi 9 janvier 2015

Using `perf` repeatedly with file input


perf can be used to analyze the performance of a program.


Say you want to test the performance of a program prgrm, with input from a file, you can run:



perf stat prgrm < inp.dat


Now when you wish to repeat the experiment multiple times, you can use the --repeat option, but:



perf stat --repeat 50 prgrm < inp.dat


doesn't work. I understand the reason: the inp.dat is "piped" through perf and the second run, the first run has already "consumed" the entire file. Is it however possible, to repeatedly run the experiment by each time reading from inp.dat from the beginning?



Aucun commentaire:

Enregistrer un commentaire