perf stat: handle Ctrl-C
authorIngo Molnar <mingo@elte.hu>
Fri, 15 May 2009 09:03:23 +0000 (11:03 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 15 May 2009 10:09:54 +0000 (12:09 +0200)
commit58d7e993b16b62d30f8ef27757614056fe4def11
treea469295442ce5689b85581c84b24d1a9b06fc59c
parent251e8e3c7235f5944805a64f24c79fc4696793f1
perf stat: handle Ctrl-C

Before this change, if a long-running perf stat workload was Ctrl-C-ed,
the utility exited without displaying statistics.

After the change, the Ctrl-C gets propagated into the workload (and
causes its early exit there), but perf stat itself will still continue
to run and will display counter results.

This is useful to run open-ended workloads, let them run for
a while, then Ctrl-C them to get the stats.

[ Impact: extend perf stat with new functionality ]

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Documentation/perf_counter/builtin-stat.c