aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_boot.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_boot.c')
-rw-r--r--kernel/trace/trace_boot.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index 0e94b3d091f7..1f07895977a0 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -28,13 +28,13 @@ void start_boot_trace(void)
28 28
29void enable_boot_trace(void) 29void enable_boot_trace(void)
30{ 30{
31 if (pre_initcalls_finished) 31 if (boot_trace && pre_initcalls_finished)
32 tracing_start_sched_switch_record(); 32 tracing_start_sched_switch_record();
33} 33}
34 34
35void disable_boot_trace(void) 35void disable_boot_trace(void)
36{ 36{
37 if (pre_initcalls_finished) 37 if (boot_trace && pre_initcalls_finished)
38 tracing_stop_sched_switch_record(); 38 tracing_stop_sched_switch_record();
39} 39}
40 40
@@ -43,6 +43,9 @@ static int boot_trace_init(struct trace_array *tr)
43 int cpu; 43 int cpu;
44 boot_trace = tr; 44 boot_trace = tr;
45 45
46 if (!tr)
47 return 0;
48
46 for_each_cpu(cpu, cpu_possible_mask) 49 for_each_cpu(cpu, cpu_possible_mask)
47 tracing_reset(tr, cpu); 50 tracing_reset(tr, cpu);
48 51
@@ -132,7 +135,7 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn)
132 unsigned long irq_flags; 135 unsigned long irq_flags;
133 struct trace_array *tr = boot_trace; 136 struct trace_array *tr = boot_trace;
134 137
135 if (!pre_initcalls_finished) 138 if (!tr || !pre_initcalls_finished)
136 return; 139 return;
137 140
138 /* Get its name now since this function could 141 /* Get its name now since this function could
@@ -164,7 +167,7 @@ void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn)
164 unsigned long irq_flags; 167 unsigned long irq_flags;
165 struct trace_array *tr = boot_trace; 168 struct trace_array *tr = boot_trace;
166 169
167 if (!pre_initcalls_finished) 170 if (!tr || !pre_initcalls_finished)
168 return; 171 return;
169 172
170 sprint_symbol(bt->func, (unsigned long)fn); 173 sprint_symbol(bt->func, (unsigned long)fn);