aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index b5f91f198fd4..9635aa2c4fc1 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -22,6 +22,7 @@ enum trace_type {
22 TRACE_SPECIAL, 22 TRACE_SPECIAL,
23 TRACE_MMIO_RW, 23 TRACE_MMIO_RW,
24 TRACE_MMIO_MAP, 24 TRACE_MMIO_MAP,
25 TRACE_UNLIKELY,
25 TRACE_BOOT_CALL, 26 TRACE_BOOT_CALL,
26 TRACE_BOOT_RET, 27 TRACE_BOOT_RET,
27 TRACE_FN_RET, 28 TRACE_FN_RET,
@@ -134,6 +135,16 @@ struct trace_boot_ret {
134 struct boot_trace_ret boot_ret; 135 struct boot_trace_ret boot_ret;
135}; 136};
136 137
138#define TRACE_FUNC_SIZE 30
139#define TRACE_FILE_SIZE 20
140struct trace_unlikely {
141 struct trace_entry ent;
142 unsigned line;
143 char func[TRACE_FUNC_SIZE+1];
144 char file[TRACE_FILE_SIZE+1];
145 char correct;
146};
147
137/* 148/*
138 * trace_flag_type is an enumeration that holds different 149 * trace_flag_type is an enumeration that holds different
139 * states when a trace occurs. These are: 150 * states when a trace occurs. These are:
@@ -236,6 +247,7 @@ extern void __ftrace_bad_type(void);
236 TRACE_MMIO_MAP); \ 247 TRACE_MMIO_MAP); \
237 IF_ASSIGN(var, ent, struct trace_boot_call, TRACE_BOOT_CALL);\ 248 IF_ASSIGN(var, ent, struct trace_boot_call, TRACE_BOOT_CALL);\
238 IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\ 249 IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\
250 IF_ASSIGN(var, ent, struct trace_unlikely, TRACE_UNLIKELY); \
239 IF_ASSIGN(var, ent, struct ftrace_ret_entry, TRACE_FN_RET);\ 251 IF_ASSIGN(var, ent, struct ftrace_ret_entry, TRACE_FN_RET);\
240 __ftrace_bad_type(); \ 252 __ftrace_bad_type(); \
241 } while (0) 253 } while (0)
@@ -456,6 +468,9 @@ enum trace_iterator_flags {
456 TRACE_ITER_SCHED_TREE = 0x200, 468 TRACE_ITER_SCHED_TREE = 0x200,
457 TRACE_ITER_PRINTK = 0x400, 469 TRACE_ITER_PRINTK = 0x400,
458 TRACE_ITER_PREEMPTONLY = 0x800, 470 TRACE_ITER_PREEMPTONLY = 0x800,
471#ifdef CONFIG_UNLIKELY_TRACER
472 TRACE_ITER_UNLIKELY = 0x1000,
473#endif
459}; 474};
460 475
461/* 476/*
@@ -515,4 +530,28 @@ static inline void ftrace_preempt_enable(int resched)
515 preempt_enable_notrace(); 530 preempt_enable_notrace();
516} 531}
517 532
533#ifdef CONFIG_UNLIKELY_TRACER
534extern int enable_unlikely_tracing(struct trace_array *tr);
535extern void disable_unlikely_tracing(void);
536static inline int trace_unlikely_enable(struct trace_array *tr)
537{
538 if (trace_flags & TRACE_ITER_UNLIKELY)
539 return enable_unlikely_tracing(tr);
540 return 0;
541}
542static inline void trace_unlikely_disable(void)
543{
544 /* due to races, always disable */
545 disable_unlikely_tracing();
546}
547#else
548static inline int trace_unlikely_enable(struct trace_array *tr)
549{
550 return 0;
551}
552static inline void trace_unlikely_disable(void)
553{
554}
555#endif /* CONFIG_UNLIKELY_TRACER */
556
518#endif /* _LINUX_KERNEL_TRACE_H */ 557#endif /* _LINUX_KERNEL_TRACE_H */