aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:21:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:21:10 -0500
commitb0f4b285d7ed174804658539129a834270f4829a (patch)
treebe7f8dca58075aba2c6a137fcfd4d44c5c333efc /init/main.c
parentbe9c5ae4eeec2e85527e95647348b8ea4eb25128 (diff)
parent5250d329e38cdf7580faeb9c53c17d3588d7d19c (diff)
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (241 commits) sched, trace: update trace_sched_wakeup() tracing/ftrace: don't trace on early stage of a secondary cpu boot, v3 Revert "x86: disable X86_PTRACE_BTS" ring-buffer: prevent false positive warning ring-buffer: fix dangling commit race ftrace: enable format arguments checking x86, bts: memory accounting x86, bts: add fork and exit handling ftrace: introduce tracing_reset_online_cpus() helper tracing: fix warnings in kernel/trace/trace_sched_switch.c tracing: fix warning in kernel/trace/trace.c tracing/ring-buffer: remove unused ring_buffer size trace: fix task state printout ftrace: add not to regex on filtering functions trace: better use of stack_trace_enabled for boot up code trace: add a way to enable or disable the stack tracer x86: entry_64 - introduce FTRACE_ frame macro v2 tracing/ftrace: add the printk-msg-only option tracing/ftrace: use preempt_enable_no_resched_notrace in ring_buffer_time_stamp() x86, bts: correctly report invalid bts records ... Fixed up trivial conflict in scripts/recordmcount.pl due to SH bits being already partly merged by the SH merge.
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/init/main.c b/init/main.c
index db843bff5732..17e9757bfde2 100644
--- a/init/main.c
+++ b/init/main.c
@@ -63,6 +63,7 @@
63#include <linux/signal.h> 63#include <linux/signal.h>
64#include <linux/idr.h> 64#include <linux/idr.h>
65#include <linux/ftrace.h> 65#include <linux/ftrace.h>
66#include <trace/boot.h>
66 67
67#include <asm/io.h> 68#include <asm/io.h>
68#include <asm/bugs.h> 69#include <asm/bugs.h>
@@ -704,31 +705,35 @@ core_param(initcall_debug, initcall_debug, bool, 0644);
704int do_one_initcall(initcall_t fn) 705int do_one_initcall(initcall_t fn)
705{ 706{
706 int count = preempt_count(); 707 int count = preempt_count();
707 ktime_t delta; 708 ktime_t calltime, delta, rettime;
708 char msgbuf[64]; 709 char msgbuf[64];
709 struct boot_trace it; 710 struct boot_trace_call call;
711 struct boot_trace_ret ret;
710 712
711 if (initcall_debug) { 713 if (initcall_debug) {
712 it.caller = task_pid_nr(current); 714 call.caller = task_pid_nr(current);
713 printk("calling %pF @ %i\n", fn, it.caller); 715 printk("calling %pF @ %i\n", fn, call.caller);
714 it.calltime = ktime_get(); 716 calltime = ktime_get();
717 trace_boot_call(&call, fn);
718 enable_boot_trace();
715 } 719 }
716 720
717 it.result = fn(); 721 ret.result = fn();
718 722
719 if (initcall_debug) { 723 if (initcall_debug) {
720 it.rettime = ktime_get(); 724 disable_boot_trace();
721 delta = ktime_sub(it.rettime, it.calltime); 725 rettime = ktime_get();
722 it.duration = (unsigned long long) delta.tv64 >> 10; 726 delta = ktime_sub(rettime, calltime);
727 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10;
728 trace_boot_ret(&ret, fn);
723 printk("initcall %pF returned %d after %Ld usecs\n", fn, 729 printk("initcall %pF returned %d after %Ld usecs\n", fn,
724 it.result, it.duration); 730 ret.result, ret.duration);
725 trace_boot(&it, fn);
726 } 731 }
727 732
728 msgbuf[0] = 0; 733 msgbuf[0] = 0;
729 734
730 if (it.result && it.result != -ENODEV && initcall_debug) 735 if (ret.result && ret.result != -ENODEV && initcall_debug)
731 sprintf(msgbuf, "error code %d ", it.result); 736 sprintf(msgbuf, "error code %d ", ret.result);
732 737
733 if (preempt_count() != count) { 738 if (preempt_count() != count) {
734 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 739 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -742,7 +747,7 @@ int do_one_initcall(initcall_t fn)
742 printk("initcall %pF returned with %s\n", fn, msgbuf); 747 printk("initcall %pF returned with %s\n", fn, msgbuf);
743 } 748 }
744 749
745 return it.result; 750 return ret.result;
746} 751}
747 752
748 753
@@ -883,7 +888,7 @@ static int __init kernel_init(void * unused)
883 * we're essentially up and running. Get rid of the 888 * we're essentially up and running. Get rid of the
884 * initmem segments and start the user-mode stuff.. 889 * initmem segments and start the user-mode stuff..
885 */ 890 */
886 stop_boot_trace(); 891
887 init_post(); 892 init_post();
888 return 0; 893 return 0;
889} 894}