• Frederic Weisbecker's avatar
    perf top: Fix zero or negative refresh delay · 2f335a02
    Frederic Weisbecker authored
    If perf top is executed with a zero value for the refresh rate,
    we get a division by zero exception while computing samples_per_sec.
    
    Also a zero refresh rate is not possible, neither do we want to
    accept negative values.
    
    [ Impact: fix division by zero in perf top ]
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
    Cc: Marcelo Tosatti <mtosatti@redhat.com>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <1244223061-5399-1-git-send-email-fweisbec@gmail.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    2f335a02
builtin-top.c 16.5 KB