• Ingo Molnar's avatar
    perf_counter, x86: Fix/improve apic fallback · 04da8a43
    Ingo Molnar authored
    Johannes Stezenbach reported that his Pentium-M based
    laptop does not have the local APIC enabled by default,
    and hence perfcounters do not get initialized.
    
    Add a fallback for this case: allow non-sampled counters
    and return with an error on sampled counters. This allows
    'perf stat' to work out of box - and allows 'perf top'
    and 'perf record' to fall back on a hrtimer based sampling
    method.
    
    ( Passing 'lapic' on the boot line will allow hardware
      sampling to occur - but if the APIC is disabled
      permanently by the hardware then this fallback still
      allows more systems to use perfcounters. )
    
    Also decouple perfcounter support from X86_LOCAL_APIC.
    
    -v2: fix typo breaking counters on all other systems ...
    Reported-by: default avatarJohannes Stezenbach <js@sig21.net>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <new-submission>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    04da8a43
perf_counter.c 45.7 KB