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 -
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
31 Mar, 2011
1 commit
-
Fixes generated by 'codespell' and manually reviewed.
Signed-off-by: Lucas De Marchi
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
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"
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
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
24 Nov, 2009
1 commit
-
Attribute authorship to developers of hw-breakpoint related
files.Signed-off-by: K.Prasad
Cc: Alan Stern
Cc: Frederic Weisbecker
LKML-Reference:
[ v2: moved it to latest -tip ]
Signed-off-by: Ingo Molnar
10 Nov, 2009
1 commit
-
The hw-breakpoint sample module has been broken during the
hw-breakpoint internals refactoring. Propagate the changes
to it.Reported-by: "K. Prasad"
Signed-off-by: Frederic Weisbecker
03 Jun, 2009
1 commit
-
This patch introduces a sample kernel module to demonstrate the use of Hardware
Breakpoint feature. It places a breakpoint over the kernel variable 'pid_max'
to monitor all write operations and emits a function-backtrace when done.Signed-off-by: K.Prasad
Signed-off-by: Frederic Weisbecker