Ranges are in pairs (memory base and size).
profile= [KNL] Enable kernel profiling via /proc/profile
- (param: profile step/bucket size as a power of 2)
+ { schedule | <number> }
+ (param: schedule - profile schedule points}
+ (param: profile step/bucket size as a power of 2 for
+ statistical time based profiling)
prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk
before loading.
#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
-/*
- * The profiling function is SMP safe. (nothing can mess
- * around with "current", and the profiling counters are
- * updated with atomic operations). This is especially
- * useful with a profiling multiplier != 1
- */
-static inline void x86_do_profile(struct pt_regs * regs)
+static inline void __do_profile(unsigned long eip)
{
- unsigned long eip;
extern unsigned long prof_cpu_mask;
- profile_hook(regs);
-
- if (user_mode(regs))
- return;
-
if (!prof_buffer)
return;
- eip = regs->eip;
-
/*
* Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
* (default is all CPUs.)
atomic_inc((atomic_t *)&prof_buffer[eip]);
}
+#define kern_profile(eip) __do_profile(eip)
+
+/*
+ * The profiling function is SMP safe. (nothing can mess
+ * around with "current", and the profiling counters are
+ * updated with atomic operations). This is especially
+ * useful with a profiling multiplier != 1
+ */
+static inline void x86_do_profile(struct pt_regs * regs)
+{
+ profile_hook(regs);
+
+ if (prof_on != 1 || user_mode(regs))
+ return;
+
+ __do_profile(regs->eip);
+}
+
#if defined(CONFIG_X86_IO_APIC)
static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
{
int __init profile_setup(char * str)
{
int par;
+
+ if (!strncmp(str, "schedule", 8)) {
+ prof_on = 2;
+ printk(KERN_INFO "kernel schedule profiling enabled\n");
+ if (str[7] == ',')
+ str += 8;
+ }
if (get_option(&str,&par)) {
prof_shift = par;
prof_on = 1;
- printk(KERN_INFO "kernel profiling enabled\n");
+ printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n",
+ prof_shift);
}
return 1;
}