diff options
author | Andrew Vagin <avagin@openvz.org> | 2012-07-12 06:14:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-07-26 06:23:10 -0400 |
commit | 895dd92c032e1604aa0d7afaef7716e058343b67 (patch) | |
tree | 8662091be28c24a44287fc43790cf92547499a83 /kernel | |
parent | 045e7e6047037d93824d265cc30c33eb631f8883 (diff) |
sched: Deliver sched_switch events to the current task
Otherwise they can't be filtered for a defined task:
perf record -e sched:sched_switch ./foo
This command doesn't report any events without this patch.
I think it isn't a security concern if someone knows who will
be executed next - this can already be observed by polling /proc
state. By default perf is disabled for non-root users in any case.
I need these events for profiling sleep times. sched_switch is used for
getting callchains and sched_stat_* is used for getting time periods.
These events are combined in user space, then it can be analyzed by
perf tools.
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arun Sharma <asharma@fb.com>
Link: http://lkml.kernel.org/r/1342088069-1005148-1-git-send-email-avagin@openvz.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 468bdd44c1ba..ad732b56ba70 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -1910,12 +1910,12 @@ static inline void | |||
1910 | prepare_task_switch(struct rq *rq, struct task_struct *prev, | 1910 | prepare_task_switch(struct rq *rq, struct task_struct *prev, |
1911 | struct task_struct *next) | 1911 | struct task_struct *next) |
1912 | { | 1912 | { |
1913 | trace_sched_switch(prev, next); | ||
1913 | sched_info_switch(prev, next); | 1914 | sched_info_switch(prev, next); |
1914 | perf_event_task_sched_out(prev, next); | 1915 | perf_event_task_sched_out(prev, next); |
1915 | fire_sched_out_preempt_notifiers(prev, next); | 1916 | fire_sched_out_preempt_notifiers(prev, next); |
1916 | prepare_lock_switch(rq, next); | 1917 | prepare_lock_switch(rq, next); |
1917 | prepare_arch_switch(next); | 1918 | prepare_arch_switch(next); |
1918 | trace_sched_switch(prev, next); | ||
1919 | } | 1919 | } |
1920 | 1920 | ||
1921 | /** | 1921 | /** |