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 in the second run, the first run has already "consumed" the entire file so the input fed to stdin has reached its end.
Is it however possible, to repeatedly run the experiment by each time reading from inp.dat
from the beginning?