mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	tracing: Split tracing initialization into two for early initialization
Create an early_trace_init() function that will initialize the buffers and allow for ealier use of trace_printk(). This will also allow for future work to have function tracing start earlier at boot up. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
		
							parent
							
								
									97da3854c5
								
							
						
					
					
						commit
						e725c731e3
					
				
					 3 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
					@ -42,8 +42,10 @@
 | 
				
			||||||
/* Main tracing buffer and events set up */
 | 
					/* Main tracing buffer and events set up */
 | 
				
			||||||
#ifdef CONFIG_TRACING
 | 
					#ifdef CONFIG_TRACING
 | 
				
			||||||
void trace_init(void);
 | 
					void trace_init(void);
 | 
				
			||||||
 | 
					void early_trace_init(void);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
static inline void trace_init(void) { }
 | 
					static inline void trace_init(void) { }
 | 
				
			||||||
 | 
					static inline void early_trace_init(void) { }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct module;
 | 
					struct module;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -545,6 +545,9 @@ asmlinkage __visible void __init start_kernel(void)
 | 
				
			||||||
	trap_init();
 | 
						trap_init();
 | 
				
			||||||
	mm_init();
 | 
						mm_init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* trace_printk can be enabled here */
 | 
				
			||||||
 | 
						early_trace_init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Set up the scheduler prior starting any interrupts (such as the
 | 
						 * Set up the scheduler prior starting any interrupts (such as the
 | 
				
			||||||
	 * timer interrupt). Full topology setup happens at smp_init()
 | 
						 * timer interrupt). Full topology setup happens at smp_init()
 | 
				
			||||||
| 
						 | 
					@ -570,7 +573,7 @@ asmlinkage __visible void __init start_kernel(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rcu_init();
 | 
						rcu_init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* trace_printk() and trace points may be used after this */
 | 
						/* Trace events are available after this */
 | 
				
			||||||
	trace_init();
 | 
						trace_init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	context_tracking_init();
 | 
						context_tracking_init();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7999,7 +7999,7 @@ __init static int tracer_alloc_buffers(void)
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init trace_init(void)
 | 
					void __init early_trace_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (tracepoint_printk) {
 | 
						if (tracepoint_printk) {
 | 
				
			||||||
		tracepoint_print_iter =
 | 
							tracepoint_print_iter =
 | 
				
			||||||
| 
						 | 
					@ -8010,6 +8010,10 @@ void __init trace_init(void)
 | 
				
			||||||
			static_key_enable(&tracepoint_printk_key.key);
 | 
								static_key_enable(&tracepoint_printk_key.key);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	tracer_alloc_buffers();
 | 
						tracer_alloc_buffers();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void __init trace_init(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
	trace_event_init();
 | 
						trace_event_init();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue