aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2008-10-03 09:39:21 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-14 04:39:17 -0400
commit097d036a2f25eecc42435c57e010aaf4a2eed2d9 (patch)
treeee5e40b940475e8a047e02093688072ff3e330d3
parent6450c1d3213e27b0dcbf34cce7ad1ae74244c520 (diff)
tracing/fastboot: only trace non-module initcalls
At this time, only built-in initcalls interest us. We can't really produce a relevant graph if we include the modules initcall too. I had good results after this patch (see svg in attachment). Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--init/main.c1
-rw-r--r--kernel/trace/trace_boot.c11
3 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index ed53265d1f63..5812dba4ee24 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -225,9 +225,11 @@ struct boot_trace {
225#ifdef CONFIG_BOOT_TRACER 225#ifdef CONFIG_BOOT_TRACER
226extern void trace_boot(struct boot_trace *it, initcall_t fn); 226extern void trace_boot(struct boot_trace *it, initcall_t fn);
227extern void start_boot_trace(void); 227extern void start_boot_trace(void);
228extern void stop_boot_trace(void);
228#else 229#else
229static inline void trace_boot(struct boot_trace *it, initcall_t fn) { } 230static inline void trace_boot(struct boot_trace *it, initcall_t fn) { }
230static inline void start_boot_trace(void) { } 231static inline void start_boot_trace(void) { }
232static inline void stop_boot_trace(void) { }
231#endif 233#endif
232 234
233 235
diff --git a/init/main.c b/init/main.c
index 8e96a0ef17f4..e7939de80f3e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -886,6 +886,7 @@ static int __init kernel_init(void * unused)
886 * we're essentially up and running. Get rid of the 886 * we're essentially up and running. Get rid of the
887 * initmem segments and start the user-mode stuff.. 887 * initmem segments and start the user-mode stuff..
888 */ 888 */
889 stop_boot_trace();
889 init_post(); 890 init_post();
890 return 0; 891 return 0;
891} 892}
diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index b9dc2c0093ab..a7efe3559654 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -22,11 +22,16 @@ void start_boot_trace(void)
22 trace_boot_enabled = 1; 22 trace_boot_enabled = 1;
23} 23}
24 24
25void stop_boot_trace(struct trace_array *tr) 25void stop_boot_trace(void)
26{ 26{
27 trace_boot_enabled = 0; 27 trace_boot_enabled = 0;
28} 28}
29 29
30void reset_boot_trace(struct trace_array *tr)
31{
32 stop_boot_trace();
33}
34
30static void boot_trace_init(struct trace_array *tr) 35static void boot_trace_init(struct trace_array *tr)
31{ 36{
32 int cpu; 37 int cpu;
@@ -43,7 +48,7 @@ static void boot_trace_ctrl_update(struct trace_array *tr)
43 if (tr->ctrl) 48 if (tr->ctrl)
44 start_boot_trace(); 49 start_boot_trace();
45 else 50 else
46 stop_boot_trace(tr); 51 stop_boot_trace();
47} 52}
48 53
49static enum print_line_t initcall_print_line(struct trace_iterator *iter) 54static enum print_line_t initcall_print_line(struct trace_iterator *iter)
@@ -81,7 +86,7 @@ struct tracer boot_tracer __read_mostly =
81{ 86{
82 .name = "initcall", 87 .name = "initcall",
83 .init = boot_trace_init, 88 .init = boot_trace_init,
84 .reset = stop_boot_trace, 89 .reset = reset_boot_trace,
85 .ctrl_update = boot_trace_ctrl_update, 90 .ctrl_update = boot_trace_ctrl_update,
86 .print_line = initcall_print_line, 91 .print_line = initcall_print_line,
87}; 92};