Skip to content

Commit 3f5ec13

Browse files
fweisbecIngo Molnar
authored andcommitted
tracing/fastboot: move boot tracer structs and funcs into their own header.
Impact: Cleanups on the boot tracer and ftrace This patch bring some cleanups about the boot tracer headers. The functions and structures of this tracer have nothing related to ftrace and should have so their own header file. Signed-off-by: Frederic Weisbecker <[email protected]> Acked-by: Steven Rostedt <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 60a011c commit 3f5ec13

File tree

4 files changed

+45
-41
lines changed

4 files changed

+45
-41
lines changed

include/linux/ftrace.h

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -287,45 +287,4 @@ extern trace_function_return_t ftrace_function_return;
287287
extern void unregister_ftrace_return(void);
288288
#endif
289289

290-
/*
291-
* Structure which defines the trace of an initcall.
292-
* You don't have to fill the func field since it is
293-
* only used internally by the tracer.
294-
*/
295-
struct boot_trace {
296-
pid_t caller;
297-
char func[KSYM_NAME_LEN];
298-
int result;
299-
unsigned long long duration; /* usecs */
300-
ktime_t calltime;
301-
ktime_t rettime;
302-
};
303-
304-
#ifdef CONFIG_BOOT_TRACER
305-
/* Append the trace on the ring-buffer */
306-
extern void trace_boot(struct boot_trace *it, initcall_t fn);
307-
308-
/* Tells the tracer that smp_pre_initcall is finished.
309-
* So we can start the tracing
310-
*/
311-
extern void start_boot_trace(void);
312-
313-
/* Resume the tracing of other necessary events
314-
* such as sched switches
315-
*/
316-
extern void enable_boot_trace(void);
317-
318-
/* Suspend this tracing. Actually, only sched_switches tracing have
319-
* to be suspended. Initcalls doesn't need it.)
320-
*/
321-
extern void disable_boot_trace(void);
322-
#else
323-
static inline void trace_boot(struct boot_trace *it, initcall_t fn) { }
324-
static inline void start_boot_trace(void) { }
325-
static inline void enable_boot_trace(void) { }
326-
static inline void disable_boot_trace(void) { }
327-
#endif
328-
329-
330-
331290
#endif /* _LINUX_FTRACE_H */

include/trace/boot.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#ifndef _LINUX_TRACE_BOOT_H
2+
#define _LINUX_TRACE_BOOT_H
3+
4+
/*
5+
* Structure which defines the trace of an initcall.
6+
* You don't have to fill the func field since it is
7+
* only used internally by the tracer.
8+
*/
9+
struct boot_trace {
10+
pid_t caller;
11+
char func[KSYM_NAME_LEN];
12+
int result;
13+
unsigned long long duration; /* usecs */
14+
ktime_t calltime;
15+
ktime_t rettime;
16+
};
17+
18+
#ifdef CONFIG_BOOT_TRACER
19+
/* Append the trace on the ring-buffer */
20+
extern void trace_boot(struct boot_trace *it, initcall_t fn);
21+
22+
/* Tells the tracer that smp_pre_initcall is finished.
23+
* So we can start the tracing
24+
*/
25+
extern void start_boot_trace(void);
26+
27+
/* Resume the tracing of other necessary events
28+
* such as sched switches
29+
*/
30+
extern void enable_boot_trace(void);
31+
32+
/* Suspend this tracing. Actually, only sched_switches tracing have
33+
* to be suspended. Initcalls doesn't need it.)
34+
*/
35+
extern void disable_boot_trace(void);
36+
#else
37+
static inline void trace_boot(struct boot_trace *it, initcall_t fn) { }
38+
static inline void start_boot_trace(void) { }
39+
static inline void enable_boot_trace(void) { }
40+
static inline void disable_boot_trace(void) { }
41+
#endif /* CONFIG_BOOT_TRACER */
42+
43+
#endif /* __LINUX_TRACE_BOOT_H */

init/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include <linux/signal.h>
6464
#include <linux/idr.h>
6565
#include <linux/ftrace.h>
66+
#include <trace/boot.h>
6667

6768
#include <asm/io.h>
6869
#include <asm/bugs.h>

kernel/trace/trace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/ring_buffer.h>
99
#include <linux/mmiotrace.h>
1010
#include <linux/ftrace.h>
11+
#include <trace/boot.h>
1112

1213
enum trace_type {
1314
__TRACE_FIRST_TYPE = 0,

0 commit comments

Comments
 (0)