aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-10-14 11:43:23 -0400
committerIngo Molnar <mingo@elte.hu>2010-10-18 13:58:55 -0400
commitd580ff8699e8811a9af37e9de4dea375401bdeec (patch)
treef2789d8a8628b856ad902c0bfbb1899e6cc67697 /include/linux/perf_event.h
parentc6be5a5cb62592d9d661899a2aa78236eb00ffa5 (diff)
perf, hw_breakpoint: Fix crash in hw_breakpoint creation
hw_breakpoint creation needs to account stuff per-task to ensure there is always sufficient hardware resources to back these things due to ptrace. With the perf per pmu context changes the event initialization no longer has access to the event context, for the simple reason that we need to first find the pmu (result of initialization) before we can find the context. This makes hw_breakpoints unhappy, because it can no longer do per task accounting, cure this by frobbing a task pointer in the event::hw bits for now... Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20101014203625.391543667@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 2ebfc9ae4755..97965fac55fe 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -536,6 +536,12 @@ struct hw_perf_event {
536 struct { /* breakpoint */ 536 struct { /* breakpoint */
537 struct arch_hw_breakpoint info; 537 struct arch_hw_breakpoint info;
538 struct list_head bp_list; 538 struct list_head bp_list;
539 /*
540 * Crufty hack to avoid the chicken and egg
541 * problem hw_breakpoint has with context
542 * creation and event initalization.
543 */
544 struct task_struct *bp_target;
539 }; 545 };
540#endif 546#endif
541 }; 547 };
@@ -693,6 +699,7 @@ struct swevent_hlist {
693 699
694#define PERF_ATTACH_CONTEXT 0x01 700#define PERF_ATTACH_CONTEXT 0x01
695#define PERF_ATTACH_GROUP 0x02 701#define PERF_ATTACH_GROUP 0x02
702#define PERF_ATTACH_TASK 0x04
696 703
697/** 704/**
698 * struct perf_event - performance event kernel representation: 705 * struct perf_event - performance event kernel representation: