Skip to content

Commit

Permalink
tracing: Remove boot tracer
Browse files Browse the repository at this point in the history
The boot tracer is useless. It simply logs the initcalls
but in fact these initcalls are also logged through printk
while using the initcall_debug kernel parameter.

Nobody seem to be using it so far. Then just remove it.

Signed-off-by: WANG Cong <[email protected]>
Cc: Chase Douglas <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Li Zefan <[email protected]>
LKML-Reference: <[email protected]>
[ remove the hooks in main.c, and the headers ]
Signed-off-by: Frederic Weisbecker <[email protected]>
  • Loading branch information
congwang authored and fweisbec committed Jun 8, 2010
1 parent b0f82b8 commit 30dbb20
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 318 deletions.
60 changes: 0 additions & 60 deletions include/trace/boot.h

This file was deleted.

27 changes: 10 additions & 17 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#include <linux/sfi.h>
#include <linux/shmem_fs.h>
#include <linux/slab.h>
#include <trace/boot.h>

#include <asm/io.h>
#include <asm/bugs.h>
Expand Down Expand Up @@ -715,38 +714,33 @@ int initcall_debug;
core_param(initcall_debug, initcall_debug, bool, 0644);

static char msgbuf[64];
static struct boot_trace_call call;
static struct boot_trace_ret ret;

int do_one_initcall(initcall_t fn)
{
int count = preempt_count();
ktime_t calltime, delta, rettime;
unsigned long long duration;
int ret;

if (initcall_debug) {
call.caller = task_pid_nr(current);
printk("calling %pF @ %i\n", fn, call.caller);
printk("calling %pF @ %i\n", fn, task_pid_nr(current));
calltime = ktime_get();
trace_boot_call(&call, fn);
enable_boot_trace();
}

ret.result = fn();
ret = fn();

if (initcall_debug) {
disable_boot_trace();
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10;
trace_boot_ret(&ret, fn);
printk("initcall %pF returned %d after %Ld usecs\n", fn,
ret.result, ret.duration);
duration = (unsigned long long) ktime_to_ns(delta) >> 10;
printk("initcall %pF returned %d after %lld usecs\n", fn,
ret, duration);
}

msgbuf[0] = 0;

if (ret.result && ret.result != -ENODEV && initcall_debug)
sprintf(msgbuf, "error code %d ", ret.result);
if (ret && ret != -ENODEV && initcall_debug)
sprintf(msgbuf, "error code %d ", ret);

if (preempt_count() != count) {
strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
Expand All @@ -760,7 +754,7 @@ int do_one_initcall(initcall_t fn)
printk("initcall %pF returned with %s\n", fn, msgbuf);
}

return ret.result;
return ret;
}


Expand Down Expand Up @@ -880,7 +874,6 @@ static int __init kernel_init(void * unused)
smp_prepare_cpus(setup_max_cpus);

do_pre_smp_initcalls();
start_boot_trace();

smp_init();
sched_init_smp();
Expand Down
17 changes: 0 additions & 17 deletions kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -229,23 +229,6 @@ config FTRACE_SYSCALLS
help
Basic tracer to catch the syscall entry and exit events.

config BOOT_TRACER
bool "Trace boot initcalls"
select GENERIC_TRACER
select CONTEXT_SWITCH_TRACER
help
This tracer helps developers to optimize boot times: it records
the timings of the initcalls and traces key events and the identity
of tasks that can cause boot delays, such as context-switches.

Its aim is to be parsed by the scripts/bootgraph.pl tool to
produce pretty graphics about boot inefficiencies, giving a visual
representation of the delays during initcalls - but the raw
/debug/tracing/trace text output is readable too.

You must pass in initcall_debug and ftrace=initcall to the kernel
command line to enable this on bootup.

config TRACE_BRANCH_PROFILING
bool
select GENERIC_TRACER
Expand Down
1 change: 0 additions & 1 deletion kernel/trace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
obj-$(CONFIG_NOP_TRACER) += trace_nop.o
obj-$(CONFIG_STACK_TRACER) += trace_stack.o
obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
obj-$(CONFIG_BOOT_TRACER) += trace_boot.o
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += trace_functions_graph.o
obj-$(CONFIG_TRACE_BRANCH_PROFILING) += trace_branch.o
obj-$(CONFIG_KMEMTRACE) += kmemtrace.o
Expand Down
3 changes: 0 additions & 3 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -4603,9 +4603,6 @@ __init static int tracer_alloc_buffers(void)

register_tracer(&nop_trace);
current_trace = &nop_trace;
#ifdef CONFIG_BOOT_TRACER
register_tracer(&boot_tracer);
#endif
/* All seems OK, enable tracing */
tracing_disabled = 0;

Expand Down
8 changes: 0 additions & 8 deletions kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#include <linux/mmiotrace.h>
#include <linux/tracepoint.h>
#include <linux/ftrace.h>
#include <trace/boot.h>
#include <linux/kmemtrace.h>
#include <linux/hw_breakpoint.h>

#include <linux/trace_seq.h>
#include <linux/ftrace_event.h>

Expand All @@ -29,8 +27,6 @@ enum trace_type {
TRACE_MMIO_RW,
TRACE_MMIO_MAP,
TRACE_BRANCH,
TRACE_BOOT_CALL,
TRACE_BOOT_RET,
TRACE_GRAPH_RET,
TRACE_GRAPH_ENT,
TRACE_USER_STACK,
Expand All @@ -48,8 +44,6 @@ enum kmemtrace_type_id {
KMEMTRACE_TYPE_PAGES, /* __get_free_pages() and friends. */
};

extern struct tracer boot_tracer;

#undef __field
#define __field(type, item) type item;

Expand Down Expand Up @@ -209,8 +203,6 @@ extern void __ftrace_bad_type(void);
TRACE_MMIO_RW); \
IF_ASSIGN(var, ent, struct trace_mmiotrace_map, \
TRACE_MMIO_MAP); \
IF_ASSIGN(var, ent, struct trace_boot_call, TRACE_BOOT_CALL);\
IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\
IF_ASSIGN(var, ent, struct trace_branch, TRACE_BRANCH); \
IF_ASSIGN(var, ent, struct ftrace_graph_ent_entry, \
TRACE_GRAPH_ENT); \
Expand Down
185 changes: 0 additions & 185 deletions kernel/trace/trace_boot.c

This file was deleted.

Loading

0 comments on commit 30dbb20

Please sign in to comment.