aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index e4bb1dd7b308..ceda5799466e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -118,6 +118,12 @@
118 */ 118 */
119#define RUNTIME_INF ((u64)~0ULL) 119#define RUNTIME_INF ((u64)~0ULL)
120 120
121DEFINE_TRACE(sched_wait_task);
122DEFINE_TRACE(sched_wakeup);
123DEFINE_TRACE(sched_wakeup_new);
124DEFINE_TRACE(sched_switch);
125DEFINE_TRACE(sched_migrate_task);
126
121#ifdef CONFIG_SMP 127#ifdef CONFIG_SMP
122/* 128/*
123 * Divide a load by a sched group cpu_power : (load / sg->__cpu_power) 129 * Divide a load by a sched group cpu_power : (load / sg->__cpu_power)
@@ -1845,6 +1851,8 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
1845 1851
1846 clock_offset = old_rq->clock - new_rq->clock; 1852 clock_offset = old_rq->clock - new_rq->clock;
1847 1853
1854 trace_sched_migrate_task(p, task_cpu(p), new_cpu);
1855
1848#ifdef CONFIG_SCHEDSTATS 1856#ifdef CONFIG_SCHEDSTATS
1849 if (p->se.wait_start) 1857 if (p->se.wait_start)
1850 p->se.wait_start -= clock_offset; 1858 p->se.wait_start -= clock_offset;
@@ -2449,7 +2457,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
2449 p->sched_class->task_new(rq, p); 2457 p->sched_class->task_new(rq, p);
2450 inc_nr_running(rq); 2458 inc_nr_running(rq);
2451 } 2459 }
2452 trace_sched_wakeup_new(rq, p); 2460 trace_sched_wakeup_new(rq, p, 1);
2453 check_preempt_curr(rq, p, 0); 2461 check_preempt_curr(rq, p, 0);
2454#ifdef CONFIG_SMP 2462#ifdef CONFIG_SMP
2455 if (p->sched_class->task_wake_up) 2463 if (p->sched_class->task_wake_up)
@@ -2862,7 +2870,6 @@ static void sched_migrate_task(struct task_struct *p, int dest_cpu)
2862 || unlikely(!cpu_active(dest_cpu))) 2870 || unlikely(!cpu_active(dest_cpu)))
2863 goto out; 2871 goto out;
2864 2872
2865 trace_sched_migrate_task(rq, p, dest_cpu);
2866 /* force the process onto the specified CPU */ 2873 /* force the process onto the specified CPU */
2867 if (migrate_task(p, dest_cpu, &req)) { 2874 if (migrate_task(p, dest_cpu, &req)) {
2868 /* Need to wait for migration thread (might exit: take ref). */ 2875 /* Need to wait for migration thread (might exit: take ref). */
@@ -5896,6 +5903,7 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
5896 * The idle tasks have their own, simple scheduling class: 5903 * The idle tasks have their own, simple scheduling class:
5897 */ 5904 */
5898 idle->sched_class = &idle_sched_class; 5905 idle->sched_class = &idle_sched_class;
5906 ftrace_graph_init_task(idle);
5899} 5907}
5900 5908
5901/* 5909/*