aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 16:35:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 16:35:07 -0400
commit92b29b86fe2e183d44eb467e5e74a5f718ef2e43 (patch)
tree1bac8a1aa11d47322b66d10ec3a370016d843d06 /init/main.c
parentb9d7ccf56be1ac77b71a284a1c0e6337f9a7aff0 (diff)
parent98d9c66ab07471006fd7910cb16453581c41a3e7 (diff)
Merge branch 'tracing-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (131 commits) tracing/fastboot: improve help text tracing/stacktrace: improve help text tracing/fastboot: fix initcalls disposition in bootgraph.pl tracing/fastboot: fix bootgraph.pl initcall name regexp tracing/fastboot: fix issues and improve output of bootgraph.pl tracepoints: synchronize unregister static inline tracepoints: tracepoint_synchronize_unregister() ftrace: make ftrace_test_p6nop disassembler-friendly markers: fix synchronize marker unregister static inline tracing/fastboot: add better resolution to initcall debug/tracing trace: add build-time check to avoid overrunning hex buffer ftrace: fix hex output mode of ftrace tracing/fastboot: fix initcalls disposition in bootgraph.pl tracing/fastboot: fix printk format typo in boot tracer ftrace: return an error when setting a nonexistent tracer ftrace: make some tracers reentrant ring-buffer: make reentrant ring-buffer: move page indexes into page headers tracing/fastboot: only trace non-module initcalls ftrace: move pc counter in irqtrace ... Manually fix conflicts: - init/main.c: initcall tracing - kernel/module.c: verbose level vs tracepoints - scripts/bootgraph.pl: fallout from cherry-picking commits.
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/init/main.c b/init/main.c
index 4371d11721f6..3e17a3bafe60 100644
--- a/init/main.c
+++ b/init/main.c
@@ -61,6 +61,7 @@
61#include <linux/sched.h> 61#include <linux/sched.h>
62#include <linux/signal.h> 62#include <linux/signal.h>
63#include <linux/idr.h> 63#include <linux/idr.h>
64#include <linux/ftrace.h>
64 65
65#include <asm/io.h> 66#include <asm/io.h>
66#include <asm/bugs.h> 67#include <asm/bugs.h>
@@ -689,6 +690,8 @@ asmlinkage void __init start_kernel(void)
689 690
690 acpi_early_init(); /* before LAPIC and SMP init */ 691 acpi_early_init(); /* before LAPIC and SMP init */
691 692
693 ftrace_init();
694
692 /* Do the rest non-__init'ed, we're now alive */ 695 /* Do the rest non-__init'ed, we're now alive */
693 rest_init(); 696 rest_init();
694} 697}
@@ -705,30 +708,31 @@ __setup("initcall_debug", initcall_debug_setup);
705int do_one_initcall(initcall_t fn) 708int do_one_initcall(initcall_t fn)
706{ 709{
707 int count = preempt_count(); 710 int count = preempt_count();
708 ktime_t t0, t1, delta; 711 ktime_t delta;
709 char msgbuf[64]; 712 char msgbuf[64];
710 int result; 713 struct boot_trace it;
711 714
712 if (initcall_debug) { 715 if (initcall_debug) {
713 printk("calling %pF @ %i\n", fn, task_pid_nr(current)); 716 it.caller = task_pid_nr(current);
714 t0 = ktime_get(); 717 printk("calling %pF @ %i\n", fn, it.caller);
718 it.calltime = ktime_get();
715 } 719 }
716 720
717 result = fn(); 721 it.result = fn();
718 722
719 if (initcall_debug) { 723 if (initcall_debug) {
720 t1 = ktime_get(); 724 it.rettime = ktime_get();
721 delta = ktime_sub(t1, t0); 725 delta = ktime_sub(it.rettime, it.calltime);
722 726 it.duration = (unsigned long long) delta.tv64 >> 10;
723 printk("initcall %pF returned %d after %Ld msecs\n", 727 printk("initcall %pF returned %d after %Ld usecs\n", fn,
724 fn, result, 728 it.result, it.duration);
725 (unsigned long long) delta.tv64 >> 20); 729 trace_boot(&it, fn);
726 } 730 }
727 731
728 msgbuf[0] = 0; 732 msgbuf[0] = 0;
729 733
730 if (result && result != -ENODEV && initcall_debug) 734 if (it.result && it.result != -ENODEV && initcall_debug)
731 sprintf(msgbuf, "error code %d ", result); 735 sprintf(msgbuf, "error code %d ", it.result);
732 736
733 if (preempt_count() != count) { 737 if (preempt_count() != count) {
734 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 738 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -742,7 +746,7 @@ int do_one_initcall(initcall_t fn)
742 printk("initcall %pF returned with %s\n", fn, msgbuf); 746 printk("initcall %pF returned with %s\n", fn, msgbuf);
743 } 747 }
744 748
745 return result; 749 return it.result;
746} 750}
747 751
748 752
@@ -857,6 +861,7 @@ static int __init kernel_init(void * unused)
857 smp_prepare_cpus(setup_max_cpus); 861 smp_prepare_cpus(setup_max_cpus);
858 862
859 do_pre_smp_initcalls(); 863 do_pre_smp_initcalls();
864 start_boot_trace();
860 865
861 smp_init(); 866 smp_init();
862 sched_init_smp(); 867 sched_init_smp();
@@ -883,6 +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 */
891 stop_boot_trace();
886 init_post(); 892 init_post();
887 return 0; 893 return 0;
888} 894}