diff options
author | Peter Zijlstra <peterz@infradead.org> | 2014-05-21 11:32:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-06-06 01:54:02 -0400 |
commit | e041e328c4b41e1db79bfe5ba9992c2ed771ad19 (patch) | |
tree | 88f8689160ae586c728e6ef665cc4c580c116ba9 /include/linux/perf_event.h | |
parent | 22c91aa23547a4363fd2a9ffddde95c899ac8aa0 (diff) |
perf: Fix perf_event_comm() vs. exec() assumption
perf_event_comm() assumes that set_task_comm() is only called on
exec(), and in particular that its only called on current.
Neither are true, as Dave reported a WARN triggered by set_task_comm()
being called on !current.
Separate the exec() hook from the comm hook.
Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/20140521153219.GH5226@laptop.programming.kicks-ass.net
[ Build fix. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 3ef6ea12806a..9b5cd1992a88 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -695,6 +695,7 @@ extern struct perf_guest_info_callbacks *perf_guest_cbs; | |||
695 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 695 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
696 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 696 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
697 | 697 | ||
698 | extern void perf_event_exec(void); | ||
698 | extern void perf_event_comm(struct task_struct *tsk); | 699 | extern void perf_event_comm(struct task_struct *tsk); |
699 | extern void perf_event_fork(struct task_struct *tsk); | 700 | extern void perf_event_fork(struct task_struct *tsk); |
700 | 701 | ||
@@ -772,7 +773,7 @@ extern void perf_event_enable(struct perf_event *event); | |||
772 | extern void perf_event_disable(struct perf_event *event); | 773 | extern void perf_event_disable(struct perf_event *event); |
773 | extern int __perf_event_disable(void *info); | 774 | extern int __perf_event_disable(void *info); |
774 | extern void perf_event_task_tick(void); | 775 | extern void perf_event_task_tick(void); |
775 | #else | 776 | #else /* !CONFIG_PERF_EVENTS: */ |
776 | static inline void | 777 | static inline void |
777 | perf_event_task_sched_in(struct task_struct *prev, | 778 | perf_event_task_sched_in(struct task_struct *prev, |
778 | struct task_struct *task) { } | 779 | struct task_struct *task) { } |
@@ -802,6 +803,7 @@ static inline int perf_unregister_guest_info_callbacks | |||
802 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | 803 | (struct perf_guest_info_callbacks *callbacks) { return 0; } |
803 | 804 | ||
804 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 805 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
806 | static inline void perf_event_exec(void) { } | ||
805 | static inline void perf_event_comm(struct task_struct *tsk) { } | 807 | static inline void perf_event_comm(struct task_struct *tsk) { } |
806 | static inline void perf_event_fork(struct task_struct *tsk) { } | 808 | static inline void perf_event_fork(struct task_struct *tsk) { } |
807 | static inline void perf_event_init(void) { } | 809 | static inline void perf_event_init(void) { } |