Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140682
b: refs/heads/master
c: 79fb076
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Feb 3, 2009
1 parent 74f1cd9 commit e6d8951
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2821ae68b14480bfc85ea1629537163310bc5cd
refs/heads/master: 79fb0768fbd371f3b94d909f51f587b3a24ab272
7 changes: 3 additions & 4 deletions trunk/kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,8 @@ config BOOT_TRACER
representation of the delays during initcalls - but the raw
/debug/tracing/trace text output is readable too.

( Note that tracing self tests can't be enabled if this tracer is
selected, because the self-tests are an initcall as well and that
would invalidate the boot trace. )
You must pass in ftrace=initcall to the kernel command line
to enable this on bootup.

config TRACE_BRANCH_PROFILING
bool "Trace likely/unlikely profiler"
Expand Down Expand Up @@ -326,7 +325,7 @@ config FTRACE_SELFTEST

config FTRACE_STARTUP_TEST
bool "Perform a startup test on ftrace"
depends on TRACING && DEBUG_KERNEL && !BOOT_TRACER
depends on TRACING && DEBUG_KERNEL
select FTRACE_SELFTEST
help
This option performs a series of startup tests on ftrace. On bootup
Expand Down
5 changes: 1 addition & 4 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3167,12 +3167,9 @@ __init static int tracer_alloc_buffers(void)
trace_init_cmdlines();

register_tracer(&nop_trace);
current_trace = &nop_trace;
#ifdef CONFIG_BOOT_TRACER
register_tracer(&boot_tracer);
current_trace = &boot_tracer;
current_trace->init(&global_trace);
#else
current_trace = &nop_trace;
#endif
/* All seems OK, enable tracing */
tracing_disabled = 0;
Expand Down
11 changes: 7 additions & 4 deletions trunk/kernel/trace/trace_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ void start_boot_trace(void)

void enable_boot_trace(void)
{
if (pre_initcalls_finished)
if (boot_trace && pre_initcalls_finished)
tracing_start_sched_switch_record();
}

void disable_boot_trace(void)
{
if (pre_initcalls_finished)
if (boot_trace && pre_initcalls_finished)
tracing_stop_sched_switch_record();
}

Expand All @@ -43,6 +43,9 @@ static int boot_trace_init(struct trace_array *tr)
int cpu;
boot_trace = tr;

if (!tr)
return 0;

for_each_cpu(cpu, cpu_possible_mask)
tracing_reset(tr, cpu);

Expand Down Expand Up @@ -132,7 +135,7 @@ void trace_boot_call(struct boot_trace_call *bt, initcall_t fn)
unsigned long irq_flags;
struct trace_array *tr = boot_trace;

if (!pre_initcalls_finished)
if (!tr || !pre_initcalls_finished)
return;

/* Get its name now since this function could
Expand Down Expand Up @@ -164,7 +167,7 @@ void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn)
unsigned long irq_flags;
struct trace_array *tr = boot_trace;

if (!pre_initcalls_finished)
if (!tr || !pre_initcalls_finished)
return;

sprint_symbol(bt->func, (unsigned long)fn);
Expand Down

0 comments on commit e6d8951

Please sign in to comment.