aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/profile.c')
-rw-r--r--kernel/profile.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/profile.c b/kernel/profile.c
index 11550b2290b6..a6574a18514e 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -40,7 +40,10 @@ int (*timer_hook)(struct pt_regs *) __read_mostly;
40 40
41static atomic_t *prof_buffer; 41static atomic_t *prof_buffer;
42static unsigned long prof_len, prof_shift; 42static unsigned long prof_len, prof_shift;
43
43int prof_on __read_mostly; 44int prof_on __read_mostly;
45EXPORT_SYMBOL_GPL(prof_on);
46
44static cpumask_t prof_cpu_mask = CPU_MASK_ALL; 47static cpumask_t prof_cpu_mask = CPU_MASK_ALL;
45#ifdef CONFIG_SMP 48#ifdef CONFIG_SMP
46static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits); 49static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
@@ -52,6 +55,7 @@ static int __init profile_setup(char * str)
52{ 55{
53 static char __initdata schedstr[] = "schedule"; 56 static char __initdata schedstr[] = "schedule";
54 static char __initdata sleepstr[] = "sleep"; 57 static char __initdata sleepstr[] = "sleep";
58 static char __initdata kvmstr[] = "kvm";
55 int par; 59 int par;
56 60
57 if (!strncmp(str, sleepstr, strlen(sleepstr))) { 61 if (!strncmp(str, sleepstr, strlen(sleepstr))) {
@@ -72,6 +76,15 @@ static int __init profile_setup(char * str)
72 printk(KERN_INFO 76 printk(KERN_INFO
73 "kernel schedule profiling enabled (shift: %ld)\n", 77 "kernel schedule profiling enabled (shift: %ld)\n",
74 prof_shift); 78 prof_shift);
79 } else if (!strncmp(str, kvmstr, strlen(kvmstr))) {
80 prof_on = KVM_PROFILING;
81 if (str[strlen(kvmstr)] == ',')
82 str += strlen(kvmstr) + 1;
83 if (get_option(&str, &par))
84 prof_shift = par;
85 printk(KERN_INFO
86 "kernel KVM profiling enabled (shift: %ld)\n",
87 prof_shift);
75 } else if (get_option(&str, &par)) { 88 } else if (get_option(&str, &par)) {
76 prof_shift = par; 89 prof_shift = par;
77 prof_on = CPU_PROFILING; 90 prof_on = CPU_PROFILING;
@@ -318,6 +331,7 @@ out:
318 local_irq_restore(flags); 331 local_irq_restore(flags);
319 put_cpu(); 332 put_cpu();
320} 333}
334EXPORT_SYMBOL_GPL(profile_hits);
321 335
322static int __devinit profile_cpu_callback(struct notifier_block *info, 336static int __devinit profile_cpu_callback(struct notifier_block *info,
323 unsigned long action, void *__cpu) 337 unsigned long action, void *__cpu)