aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 12:30:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-06 12:30:52 -0400
commit4aed2fd8e3181fea7c09ba79cf64e7e3f4413bf9 (patch)
tree1f69733e5daab4915a76a41de0e4d1dc61e12cfb /init
parent3a3527b6461b1298cc53ce72f336346739297ac8 (diff)
parentfc9ea5a1e53ee54f681e226d735008e2a6f8f470 (diff)
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (162 commits) tracing/kprobes: unregister_trace_probe needs to be called under mutex perf: expose event__process function perf events: Fix mmap offset determination perf, powerpc: fsl_emb: Restore setting perf_sample_data.period perf, powerpc: Convert the FSL driver to use local64_t perf tools: Don't keep unreferenced maps when unmaps are detected perf session: Invalidate last_match when removing threads from rb_tree perf session: Free the ref_reloc_sym memory at the right place x86,mmiotrace: Add support for tracing STOS instruction perf, sched migration: Librarize task states and event headers helpers perf, sched migration: Librarize the GUI class perf, sched migration: Make the GUI class client agnostic perf, sched migration: Make it vertically scrollable perf, sched migration: Parameterize cpu height and spacing perf, sched migration: Fix key bindings perf, sched migration: Ignore unhandled task states perf, sched migration: Handle ignored migrate out events perf: New migration tool overview tracing: Drop cpparg() macro perf: Use tracepoint_synchronize_unregister() to flush any pending tracepoint call ... Fix up trivial conflicts in Makefile and drivers/cpufreq/cpufreq.c
Diffstat (limited to 'init')
-rw-r--r--init/main.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/init/main.c b/init/main.c
index 4ddb53f04f2a..b03a4c1f69fa 100644
--- a/init/main.c
+++ b/init/main.c
@@ -66,11 +66,9 @@
66#include <linux/ftrace.h> 66#include <linux/ftrace.h>
67#include <linux/async.h> 67#include <linux/async.h>
68#include <linux/kmemcheck.h> 68#include <linux/kmemcheck.h>
69#include <linux/kmemtrace.h>
70#include <linux/sfi.h> 69#include <linux/sfi.h>
71#include <linux/shmem_fs.h> 70#include <linux/shmem_fs.h>
72#include <linux/slab.h> 71#include <linux/slab.h>
73#include <trace/boot.h>
74 72
75#include <asm/io.h> 73#include <asm/io.h>
76#include <asm/bugs.h> 74#include <asm/bugs.h>
@@ -664,7 +662,6 @@ asmlinkage void __init start_kernel(void)
664#endif 662#endif
665 page_cgroup_init(); 663 page_cgroup_init();
666 enable_debug_pagealloc(); 664 enable_debug_pagealloc();
667 kmemtrace_init();
668 kmemleak_init(); 665 kmemleak_init();
669 debug_objects_mem_init(); 666 debug_objects_mem_init();
670 idr_init_cache(); 667 idr_init_cache();
@@ -726,38 +723,33 @@ int initcall_debug;
726core_param(initcall_debug, initcall_debug, bool, 0644); 723core_param(initcall_debug, initcall_debug, bool, 0644);
727 724
728static char msgbuf[64]; 725static char msgbuf[64];
729static struct boot_trace_call call;
730static struct boot_trace_ret ret;
731 726
732int do_one_initcall(initcall_t fn) 727int do_one_initcall(initcall_t fn)
733{ 728{
734 int count = preempt_count(); 729 int count = preempt_count();
735 ktime_t calltime, delta, rettime; 730 ktime_t calltime, delta, rettime;
731 unsigned long long duration;
732 int ret;
736 733
737 if (initcall_debug) { 734 if (initcall_debug) {
738 call.caller = task_pid_nr(current); 735 printk("calling %pF @ %i\n", fn, task_pid_nr(current));
739 printk("calling %pF @ %i\n", fn, call.caller);
740 calltime = ktime_get(); 736 calltime = ktime_get();
741 trace_boot_call(&call, fn);
742 enable_boot_trace();
743 } 737 }
744 738
745 ret.result = fn(); 739 ret = fn();
746 740
747 if (initcall_debug) { 741 if (initcall_debug) {
748 disable_boot_trace();
749 rettime = ktime_get(); 742 rettime = ktime_get();
750 delta = ktime_sub(rettime, calltime); 743 delta = ktime_sub(rettime, calltime);
751 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10; 744 duration = (unsigned long long) ktime_to_ns(delta) >> 10;
752 trace_boot_ret(&ret, fn); 745 printk("initcall %pF returned %d after %lld usecs\n", fn,
753 printk("initcall %pF returned %d after %Ld usecs\n", fn, 746 ret, duration);
754 ret.result, ret.duration);
755 } 747 }
756 748
757 msgbuf[0] = 0; 749 msgbuf[0] = 0;
758 750
759 if (ret.result && ret.result != -ENODEV && initcall_debug) 751 if (ret && ret != -ENODEV && initcall_debug)
760 sprintf(msgbuf, "error code %d ", ret.result); 752 sprintf(msgbuf, "error code %d ", ret);
761 753
762 if (preempt_count() != count) { 754 if (preempt_count() != count) {
763 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 755 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -771,7 +763,7 @@ int do_one_initcall(initcall_t fn)
771 printk("initcall %pF returned with %s\n", fn, msgbuf); 763 printk("initcall %pF returned with %s\n", fn, msgbuf);
772 } 764 }
773 765
774 return ret.result; 766 return ret;
775} 767}
776 768
777 769
@@ -895,7 +887,6 @@ static int __init kernel_init(void * unused)
895 smp_prepare_cpus(setup_max_cpus); 887 smp_prepare_cpus(setup_max_cpus);
896 888
897 do_pre_smp_initcalls(); 889 do_pre_smp_initcalls();
898 start_boot_trace();
899 890
900 smp_init(); 891 smp_init();
901 sched_init_smp(); 892 sched_init_smp();