---
 kernel/trace/latency_hist.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Index: linux-3.18.43-rt46-fulldebug/kernel/trace/latency_hist.c
===================================================================
--- linux-3.18.43-rt46-fulldebug.orig/kernel/trace/latency_hist.c
+++ linux-3.18.43-rt46-fulldebug/kernel/trace/latency_hist.c
@@ -126,8 +126,10 @@ static notrace void probe_wakeup_latency
 	struct task_struct *p);
 static notrace void probe_wakeup_latency_hist_stop(void *v,
 	struct task_struct *prev, struct task_struct *next);
+#ifdef CONFIG_SMP
 static notrace void probe_sched_migrate_task(void *,
 	struct task_struct *task, int cpu);
+#endif
 static struct enable_data wakeup_latency_enabled_data = {
 	.latency_type = WAKEUP_LATENCY,
 	.enabled = 0,
@@ -692,6 +694,7 @@ do_enable(struct file *file, const char 
 				    probe_wakeup_latency_hist_start, NULL);
 				return ret;
 			}
+#ifdef CONFIG_SMP
 			ret = register_trace_sched_migrate_task(
 			    probe_sched_migrate_task, NULL);
 			if (ret) {
@@ -704,6 +707,7 @@ do_enable(struct file *file, const char 
 				    probe_wakeup_latency_hist_stop, NULL);
 				return ret;
 			}
+#endif
 			break;
 #endif
 #ifdef CONFIG_MISSED_TIMER_OFFSETS_HIST
@@ -786,8 +790,10 @@ do_enable(struct file *file, const char 
 				    probe_wakeup_latency_hist_start, NULL);
 				unregister_trace_sched_switch(
 				    probe_wakeup_latency_hist_stop, NULL);
+#ifdef CONFIG_SMP
 				unregister_trace_sched_migrate_task(
 				    probe_sched_migrate_task, NULL);
+#endif
 
 				for_each_online_cpu(cpu) {
 					per_cpu(wakeup_task, cpu) = NULL;
@@ -975,6 +981,7 @@ static DEFINE_RAW_SPINLOCK(wakeup_lock);
 #ifdef CONFIG_SWITCHTIME_HIST
 static DEFINE_RAW_SPINLOCK(switchtime_lock);
 #endif
+#ifdef CONFIG_SMP
 static notrace void probe_sched_migrate_task(void *v, struct task_struct *task,
 	int cpu)
 {
@@ -995,23 +1002,24 @@ static notrace void probe_sched_migrate_
 		raw_spin_unlock_irqrestore(&wakeup_lock, flags);
 
 #ifdef CONFIG_SWITCHTIME_HIST
-		{
-			struct task_struct *cpu_switchtime_task;
+                {
+                        struct task_struct *cpu_switchtime_task;
 
-			raw_spin_lock_irqsave(&switchtime_lock, flags);
-			cpu_switchtime_task = per_cpu(switchtime_task, old_cpu);
-			if (task == cpu_switchtime_task) {
-				put_task_struct(cpu_switchtime_task);
-				per_cpu(switchtime_task, old_cpu) = NULL;
-				cpu_switchtime_task =
-				    per_cpu(switchtime_task, cpu) = task;
-				get_task_struct(cpu_switchtime_task);
-			}
-			raw_spin_unlock_irqrestore(&switchtime_lock, flags);
-		}
+                        raw_spin_lock_irqsave(&switchtime_lock, flags);
+                        cpu_switchtime_task = per_cpu(switchtime_task, old_cpu);
+                        if (task == cpu_switchtime_task) {
+                                put_task_struct(cpu_switchtime_task);
+                                per_cpu(switchtime_task, old_cpu) = NULL;
+                                cpu_switchtime_task =
+                                    per_cpu(switchtime_task, cpu) = task;
+                                get_task_struct(cpu_switchtime_task);
+                        }
+                        raw_spin_unlock_irqrestore(&switchtime_lock, flags);
+                }
 #endif
 	}
 }
+#endif /* CONFIG_SMP */
 
 static notrace void probe_wakeup_latency_hist_start(void *v,
 	struct task_struct *p)