perf stat: Introduce --repeat forever
The following patch causes 'perf stat --repeat 0' to be interpreted as 'forever', displaying the stats for every run. We act as if a single run was asked, and reset the stats in each iteration. In this mode SIGINT is passed to perf to be able to stop the loop with Ctrl+C. Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20130301180227.GA24385@ks398093.ip-192-95-24.net Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
d723a55096
commit
a7e191c376
@@ -633,6 +633,12 @@ int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void perf_evsel__reset_counts(struct perf_evsel *evsel, int ncpus)
|
||||
{
|
||||
memset(evsel->counts, 0, (sizeof(*evsel->counts) +
|
||||
(ncpus * sizeof(struct perf_counts_values))));
|
||||
}
|
||||
|
||||
int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus)
|
||||
{
|
||||
evsel->counts = zalloc((sizeof(*evsel->counts) +
|
||||
|
Reference in New Issue
Block a user