Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30dbb20e authored by Américo Wang's avatar Américo Wang Committed by Frederic Weisbecker
Browse files

tracing: Remove boot tracer



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: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Cc: Chase Douglas <chase.douglas@canonical.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <20100526105753.GA5677@cr0.nay.redhat.com>
[ remove the hooks in main.c, and the headers ]
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
parent b0f82b81
Loading
Loading
Loading
Loading

include/trace/boot.h

deleted100644 → 0
+0 −60
Original line number Diff line number Diff line
#ifndef _LINUX_TRACE_BOOT_H
#define _LINUX_TRACE_BOOT_H

#include <linux/module.h>
#include <linux/kallsyms.h>
#include <linux/init.h>

/*
 * Structure which defines the trace of an initcall
 * while it is called.
 * You don't have to fill the func field since it is
 * only used internally by the tracer.
 */
struct boot_trace_call {
	pid_t			caller;
	char			func[KSYM_SYMBOL_LEN];
};

/*
 * Structure which defines the trace of an initcall
 * while it returns.
 */
struct boot_trace_ret {
	char			func[KSYM_SYMBOL_LEN];
	int				result;
	unsigned long long	duration;		/* nsecs */
};

#ifdef CONFIG_BOOT_TRACER
/* Append the traces on the ring-buffer */
extern void trace_boot_call(struct boot_trace_call *bt, initcall_t fn);
extern void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn);

/* Tells the tracer that smp_pre_initcall is finished.
 * So we can start the tracing
 */
extern void start_boot_trace(void);

/* Resume the tracing of other necessary events
 * such as sched switches
 */
extern void enable_boot_trace(void);

/* Suspend this tracing. Actually, only sched_switches tracing have
 * to be suspended. Initcalls doesn't need it.)
 */
extern void disable_boot_trace(void);
#else
static inline
void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) { }

static inline
void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) { }

static inline void start_boot_trace(void) { }
static inline void enable_boot_trace(void) { }
static inline void disable_boot_trace(void) { }
#endif /* CONFIG_BOOT_TRACER */

#endif /* __LINUX_TRACE_BOOT_H */
+10 −17
Original line number Diff line number Diff line
@@ -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>
@@ -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));
@@ -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;
}


@@ -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();
+0 −17
Original line number Diff line number Diff line
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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
+0 −3
Original line number Diff line number Diff line
@@ -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;

Loading