lkml.org 
[lkml]   [2009]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [tip:perfcounters/core] perf stat: handle Ctrl-C
From
Date
On Thu, 2009-05-28 at 21:09 +1000, Paul Mackerras wrote:
> tip-bot for Ingo Molnar writes:
>
> > 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.
>
> Unfortunately it means that if you do e.g.
>
> $ while true; do perf stat something; done
>
> it's impossible to kill the loop with ctrl-C. To fix this we need to
> make perf stat kill itself with the signal after printing the results,
> so bash sees the died-due-to-signal exit status and stops the loop.

Yep, just ran into the same..

^Z kill $! worked though, but that's not ideal.



\
 
 \ /
  Last update: 2009-05-28 14:23    [W:1.946 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site