01 Jul, 2011

2 commits

  • The perf_event overflow handler does not receive any caller-derived
    argument, so many callers need to resort to looking up the perf_event
    in their local data structure. This is ugly and doesn't scale if a
    single callback services many perf_events.

    Fix by adding a context parameter to perf_event_create_kernel_counter()
    (and derived hardware breakpoints APIs) and storing it in the perf_event.
    The field can be accessed from the callback as event->overflow_handler_context.
    All callers are updated.

    Signed-off-by: Avi Kivity
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1309362157-6596-2-git-send-email-avi@redhat.com
    Signed-off-by: Ingo Molnar

    Avi Kivity
     
  • The nmi parameter indicated if we could do wakeups from the current
    context, if not, we would set some state and self-IPI and let the
    resulting interrupt do the wakeup.

    For the various event classes:

    - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from
    the PMI-tail (ARM etc.)
    - tracepoint: nmi=0; since tracepoint could be from NMI context.
    - software: nmi=[0,1]; some, like the schedule thing cannot
    perform wakeups, and hence need 0.

    As one can see, there is very little nmi=1 usage, and the down-side of
    not using it is that on some platforms some software events can have a
    jiffy delay in wakeup (when arch_irq_work_raise isn't implemented).

    The up-side however is that we can remove the nmi parameter and save a
    bunch of conditionals in fast paths.

    Signed-off-by: Peter Zijlstra
    Cc: Michael Cree
    Cc: Will Deacon
    Cc: Deng-Cheng Zhu
    Cc: Anton Blanchard
    Cc: Eric B Munson
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Cc: David S. Miller
    Cc: Frederic Weisbecker
    Cc: Jason Wessel
    Cc: Don Zickus
    Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

31 Mar, 2011

1 commit


27 Feb, 2010

1 commit

  • Add __percpu sparse annotations to hw_breakpoint.

    These annotations are to make sparse consider percpu variables to be
    in a different address space and warn if accessed without going
    through percpu accessors. This patch doesn't affect normal builds.

    In kernel/hw_breakpoint.c, per_cpu(nr_task_bp_pinned, cpu)'s will
    trigger spurious noderef related warnings from sparse. Changing it to
    &per_cpu(nr_task_bp_pinned[0], cpu) will work around the problem but
    deemed to ugly by the maintainer. Leave it alone until better
    solution can be found.

    Signed-off-by: Tejun Heo
    Cc: Stephen Rothwell
    Cc: K.Prasad
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tejun Heo
     

06 Dec, 2009

1 commit

  • struct perf_event::event callback was called when a breakpoint
    triggers. But this is a rather opaque callback, pretty
    tied-only to the breakpoint API and not really integrated into perf
    as it triggers even when we don't overflow.

    We prefer to use overflow_handler() as it fits into the perf events
    rules, being called only when we overflow.

    Reported-by: Peter Zijlstra
    Signed-off-by: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: "K. Prasad"

    Frederic Weisbecker
     

27 Nov, 2009

1 commit

  • Kernel breakpoints are created using functions in which we pass
    breakpoint parameters as individual variables: address, length
    and type.

    Although it fits well for x86, this just does not scale across
    architectures that may support this api later as these may have
    more or different needs. Pass in a perf_event_attr structure
    instead because it is meant to evolve as much as possible into
    a generic hardware breakpoint parameter structure.

    Reported-by: K.Prasad
    Signed-off-by: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

26 Nov, 2009

1 commit

  • This simplifies the error handling when we create a breakpoint.
    We don't need to check the NULL return value corner case anymore
    since we have improved perf_event_create_kernel_counter() to
    always return an error code in the failure case.

    Signed-off-by: Frederic Weisbecker
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Steven Rostedt
    Cc: Prasad
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

24 Nov, 2009

1 commit


10 Nov, 2009

1 commit


03 Jun, 2009

1 commit