aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig34
-rw-r--r--init/main.c41
2 files changed, 61 insertions, 14 deletions
diff --git a/init/Kconfig b/init/Kconfig
index d4e9671347ee..9b68fee8d79e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -933,6 +933,40 @@ config AIO
933 by some high performance threaded applications. Disabling 933 by some high performance threaded applications. Disabling
934 this option saves about 7k. 934 this option saves about 7k.
935 935
936config HAVE_PERF_COUNTERS
937 bool
938
939menu "Performance Counters"
940
941config PERF_COUNTERS
942 bool "Kernel Performance Counters"
943 depends on HAVE_PERF_COUNTERS
944 select ANON_INODES
945 help
946 Enable kernel support for performance counter hardware.
947
948 Performance counters are special hardware registers available
949 on most modern CPUs. These registers count the number of certain
950 types of hw events: such as instructions executed, cachemisses
951 suffered, or branches mis-predicted - without slowing down the
952 kernel or applications. These registers can also trigger interrupts
953 when a threshold number of events have passed - and can thus be
954 used to profile the code that runs on that CPU.
955
956 The Linux Performance Counter subsystem provides an abstraction of
957 these hardware capabilities, available via a system call. It
958 provides per task and per CPU counters, and it provides event
959 capabilities on top of those.
960
961 Say Y if unsure.
962
963config EVENT_PROFILE
964 bool "Tracepoint profile sources"
965 depends on PERF_COUNTERS && EVENT_TRACER
966 default y
967
968endmenu
969
936config VM_EVENT_COUNTERS 970config VM_EVENT_COUNTERS
937 default y 971 default y
938 bool "Enable VM event counters for /proc/vmstat" if EMBEDDED 972 bool "Enable VM event counters for /proc/vmstat" if EMBEDDED
diff --git a/init/main.c b/init/main.c
index 9d759d68d7a0..5616661eac01 100644
--- a/init/main.c
+++ b/init/main.c
@@ -534,6 +534,16 @@ void __init __weak thread_info_cache_init(void)
534{ 534{
535} 535}
536 536
537/*
538 * Set up kernel memory allocators
539 */
540static void __init mm_init(void)
541{
542 mem_init();
543 kmem_cache_init();
544 vmalloc_init();
545}
546
537asmlinkage void __init start_kernel(void) 547asmlinkage void __init start_kernel(void)
538{ 548{
539 char * command_line; 549 char * command_line;
@@ -575,6 +585,23 @@ asmlinkage void __init start_kernel(void)
575 setup_nr_cpu_ids(); 585 setup_nr_cpu_ids();
576 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ 586 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
577 587
588 build_all_zonelists();
589 page_alloc_init();
590
591 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
592 parse_early_param();
593 parse_args("Booting kernel", static_command_line, __start___param,
594 __stop___param - __start___param,
595 &unknown_bootoption);
596 /*
597 * These use large bootmem allocations and must precede
598 * kmem_cache_init()
599 */
600 pidhash_init();
601 vfs_caches_init_early();
602 sort_main_extable();
603 trap_init();
604 mm_init();
578 /* 605 /*
579 * Set up the scheduler prior starting any interrupts (such as the 606 * Set up the scheduler prior starting any interrupts (such as the
580 * timer interrupt). Full topology setup happens at smp_init() 607 * timer interrupt). Full topology setup happens at smp_init()
@@ -586,26 +613,16 @@ asmlinkage void __init start_kernel(void)
586 * fragile until we cpu_idle() for the first time. 613 * fragile until we cpu_idle() for the first time.
587 */ 614 */
588 preempt_disable(); 615 preempt_disable();
589 build_all_zonelists();
590 page_alloc_init();
591 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
592 parse_early_param();
593 parse_args("Booting kernel", static_command_line, __start___param,
594 __stop___param - __start___param,
595 &unknown_bootoption);
596 if (!irqs_disabled()) { 616 if (!irqs_disabled()) {
597 printk(KERN_WARNING "start_kernel(): bug: interrupts were " 617 printk(KERN_WARNING "start_kernel(): bug: interrupts were "
598 "enabled *very* early, fixing it\n"); 618 "enabled *very* early, fixing it\n");
599 local_irq_disable(); 619 local_irq_disable();
600 } 620 }
601 sort_main_extable();
602 trap_init();
603 rcu_init(); 621 rcu_init();
604 /* init some links before init_ISA_irqs() */ 622 /* init some links before init_ISA_irqs() */
605 early_irq_init(); 623 early_irq_init();
606 init_IRQ(); 624 init_IRQ();
607 prio_tree_init(); 625 prio_tree_init();
608 pidhash_init();
609 init_timers(); 626 init_timers();
610 hrtimers_init(); 627 hrtimers_init();
611 softirq_init(); 628 softirq_init();
@@ -647,14 +664,10 @@ asmlinkage void __init start_kernel(void)
647 initrd_start = 0; 664 initrd_start = 0;
648 } 665 }
649#endif 666#endif
650 vmalloc_init();
651 vfs_caches_init_early();
652 cpuset_init_early(); 667 cpuset_init_early();
653 page_cgroup_init(); 668 page_cgroup_init();
654 mem_init();
655 enable_debug_pagealloc(); 669 enable_debug_pagealloc();
656 cpu_hotplug_init(); 670 cpu_hotplug_init();
657 kmem_cache_init();
658 kmemtrace_init(); 671 kmemtrace_init();
659 kmemleak_init(); 672 kmemleak_init();
660 debug_objects_mem_init(); 673 debug_objects_mem_init();