Loading kernel/trace/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,14 @@ config PREEMPT_TRACER enabled. This option and the irqs-off timing option can be used together or separately.) config SYSPROF_TRACER bool "Sysprof Tracer" depends on X86 select TRACING help This tracer provides the trace needed by the 'Sysprof' userspace tool. config SCHED_TRACER bool "Scheduling Latency Tracer" depends on HAVE_FTRACE Loading kernel/trace/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ obj-$(CONFIG_FTRACE) += libftrace.o obj-$(CONFIG_TRACING) += trace.o obj-$(CONFIG_CONTEXT_SWITCH_TRACER) += trace_sched_switch.o obj-$(CONFIG_SYSPROF_TRACER) += trace_sysprof.o obj-$(CONFIG_FTRACE) += trace_functions.o obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o Loading kernel/trace/trace.c +3 −0 Original line number Diff line number Diff line Loading @@ -2913,6 +2913,9 @@ static __init void tracer_init_debugfs(void) pr_warning("Could not create debugfs " "'dyn_ftrace_total_info' entry\n"); #endif #ifdef CONFIG_SYSPROF_TRACER init_tracer_sysprof_debugfs(d_tracer); #endif } static int trace_alloc_page(void) Loading kernel/trace/trace.h +6 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,8 @@ struct trace_iterator { void tracing_reset(struct trace_array_cpu *data); int tracing_open_generic(struct inode *inode, struct file *filp); struct dentry *tracing_init_dentry(void); void init_tracer_sysprof_debugfs(struct dentry *d_tracer); void ftrace(struct trace_array *tr, struct trace_array_cpu *data, unsigned long ip, Loading Loading @@ -294,6 +296,10 @@ extern int trace_selftest_startup_wakeup(struct tracer *trace, extern int trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr); #endif #ifdef CONFIG_SYSPROF_TRACER extern int trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr); #endif #endif /* CONFIG_FTRACE_STARTUP_TEST */ extern void *head_page(struct trace_array_cpu *data); Loading kernel/trace/trace_selftest.c +23 −0 Original line number Diff line number Diff line Loading @@ -538,3 +538,26 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr return ret; } #endif /* CONFIG_CONTEXT_SWITCH_TRACER */ #ifdef CONFIG_SYSPROF_TRACER int trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) { unsigned long count; int ret; /* start the tracing */ tr->ctrl = 1; trace->init(tr); /* Sleep for a 1/10 of a second */ msleep(100); /* stop the tracing. */ tr->ctrl = 0; trace->ctrl_update(tr); /* check the trace buffer */ ret = trace_test_buffer(tr, &count); trace->reset(tr); return ret; } #endif /* CONFIG_SYSPROF_TRACER */ Loading
kernel/trace/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,14 @@ config PREEMPT_TRACER enabled. This option and the irqs-off timing option can be used together or separately.) config SYSPROF_TRACER bool "Sysprof Tracer" depends on X86 select TRACING help This tracer provides the trace needed by the 'Sysprof' userspace tool. config SCHED_TRACER bool "Scheduling Latency Tracer" depends on HAVE_FTRACE Loading
kernel/trace/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ obj-$(CONFIG_FTRACE) += libftrace.o obj-$(CONFIG_TRACING) += trace.o obj-$(CONFIG_CONTEXT_SWITCH_TRACER) += trace_sched_switch.o obj-$(CONFIG_SYSPROF_TRACER) += trace_sysprof.o obj-$(CONFIG_FTRACE) += trace_functions.o obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o Loading
kernel/trace/trace.c +3 −0 Original line number Diff line number Diff line Loading @@ -2913,6 +2913,9 @@ static __init void tracer_init_debugfs(void) pr_warning("Could not create debugfs " "'dyn_ftrace_total_info' entry\n"); #endif #ifdef CONFIG_SYSPROF_TRACER init_tracer_sysprof_debugfs(d_tracer); #endif } static int trace_alloc_page(void) Loading
kernel/trace/trace.h +6 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,8 @@ struct trace_iterator { void tracing_reset(struct trace_array_cpu *data); int tracing_open_generic(struct inode *inode, struct file *filp); struct dentry *tracing_init_dentry(void); void init_tracer_sysprof_debugfs(struct dentry *d_tracer); void ftrace(struct trace_array *tr, struct trace_array_cpu *data, unsigned long ip, Loading Loading @@ -294,6 +296,10 @@ extern int trace_selftest_startup_wakeup(struct tracer *trace, extern int trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr); #endif #ifdef CONFIG_SYSPROF_TRACER extern int trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr); #endif #endif /* CONFIG_FTRACE_STARTUP_TEST */ extern void *head_page(struct trace_array_cpu *data); Loading
kernel/trace/trace_selftest.c +23 −0 Original line number Diff line number Diff line Loading @@ -538,3 +538,26 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr return ret; } #endif /* CONFIG_CONTEXT_SWITCH_TRACER */ #ifdef CONFIG_SYSPROF_TRACER int trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr) { unsigned long count; int ret; /* start the tracing */ tr->ctrl = 1; trace->init(tr); /* Sleep for a 1/10 of a second */ msleep(100); /* stop the tracing. */ tr->ctrl = 0; trace->ctrl_update(tr); /* check the trace buffer */ ret = trace_test_buffer(tr, &count); trace->reset(tr); return ret; } #endif /* CONFIG_SYSPROF_TRACER */