trace.h (bdc067582b8b71c7771bab076bbc51569c594fb4) trace.h (ee08c6eccb7d1295516f7cf420fddf7b14e9146f)
1#ifndef _LINUX_KERNEL_TRACE_H
2#define _LINUX_KERNEL_TRACE_H
3
4#include <linux/fs.h>
5#include <asm/atomic.h>
6#include <linux/sched.h>
7#include <linux/clocksource.h>
8#include <linux/ring_buffer.h>

--- 6 unchanged lines hidden (view full) ---

15enum trace_type {
16 __TRACE_FIRST_TYPE = 0,
17
18 TRACE_FN,
19 TRACE_CTX,
20 TRACE_WAKE,
21 TRACE_STACK,
22 TRACE_PRINT,
1#ifndef _LINUX_KERNEL_TRACE_H
2#define _LINUX_KERNEL_TRACE_H
3
4#include <linux/fs.h>
5#include <asm/atomic.h>
6#include <linux/sched.h>
7#include <linux/clocksource.h>
8#include <linux/ring_buffer.h>

--- 6 unchanged lines hidden (view full) ---

15enum trace_type {
16 __TRACE_FIRST_TYPE = 0,
17
18 TRACE_FN,
19 TRACE_CTX,
20 TRACE_WAKE,
21 TRACE_STACK,
22 TRACE_PRINT,
23 TRACE_BPRINT,
24 TRACE_SPECIAL,
25 TRACE_MMIO_RW,
26 TRACE_MMIO_MAP,
27 TRACE_BRANCH,
28 TRACE_BOOT_CALL,
29 TRACE_BOOT_RET,
30 TRACE_GRAPH_RET,
31 TRACE_GRAPH_ENT,
32 TRACE_USER_STACK,
33 TRACE_HW_BRANCHES,
23 TRACE_SPECIAL,
24 TRACE_MMIO_RW,
25 TRACE_MMIO_MAP,
26 TRACE_BRANCH,
27 TRACE_BOOT_CALL,
28 TRACE_BOOT_RET,
29 TRACE_GRAPH_RET,
30 TRACE_GRAPH_ENT,
31 TRACE_USER_STACK,
32 TRACE_HW_BRANCHES,
33 TRACE_SYSCALL_ENTER,
34 TRACE_SYSCALL_EXIT,
34 TRACE_KMEM_ALLOC,
35 TRACE_KMEM_FREE,
36 TRACE_POWER,
37 TRACE_BLK,
38
39 __TRACE_LAST_TYPE,
40};
41

--- 71 unchanged lines hidden (view full) ---

113struct userstack_entry {
114 struct trace_entry ent;
115 unsigned long caller[FTRACE_STACK_ENTRIES];
116};
117
118/*
119 * trace_printk entry:
120 */
35 TRACE_KMEM_ALLOC,
36 TRACE_KMEM_FREE,
37 TRACE_POWER,
38 TRACE_BLK,
39
40 __TRACE_LAST_TYPE,
41};
42

--- 71 unchanged lines hidden (view full) ---

114struct userstack_entry {
115 struct trace_entry ent;
116 unsigned long caller[FTRACE_STACK_ENTRIES];
117};
118
119/*
120 * trace_printk entry:
121 */
121struct bprint_entry {
122struct print_entry {
122 struct trace_entry ent;
123 unsigned long ip;
124 int depth;
125 const char *fmt;
126 u32 buf[];
127};
128
123 struct trace_entry ent;
124 unsigned long ip;
125 int depth;
126 const char *fmt;
127 u32 buf[];
128};
129
129struct print_entry {
130 struct trace_entry ent;
131 unsigned long ip;
132 int depth;
133 char buf[];
134};
135
136#define TRACE_OLD_SIZE 88
137
138struct trace_field_cont {
139 unsigned char type;
140 /* Temporary till we get rid of this completely */
141 char buf[TRACE_OLD_SIZE - 1];
142};
143

--- 145 unchanged lines hidden (view full) ---

289 */
290#define trace_assign_type(var, ent) \
291 do { \
292 IF_ASSIGN(var, ent, struct ftrace_entry, TRACE_FN); \
293 IF_ASSIGN(var, ent, struct ctx_switch_entry, 0); \
294 IF_ASSIGN(var, ent, struct stack_entry, TRACE_STACK); \
295 IF_ASSIGN(var, ent, struct userstack_entry, TRACE_USER_STACK);\
296 IF_ASSIGN(var, ent, struct print_entry, TRACE_PRINT); \
130#define TRACE_OLD_SIZE 88
131
132struct trace_field_cont {
133 unsigned char type;
134 /* Temporary till we get rid of this completely */
135 char buf[TRACE_OLD_SIZE - 1];
136};
137

--- 145 unchanged lines hidden (view full) ---

283 */
284#define trace_assign_type(var, ent) \
285 do { \
286 IF_ASSIGN(var, ent, struct ftrace_entry, TRACE_FN); \
287 IF_ASSIGN(var, ent, struct ctx_switch_entry, 0); \
288 IF_ASSIGN(var, ent, struct stack_entry, TRACE_STACK); \
289 IF_ASSIGN(var, ent, struct userstack_entry, TRACE_USER_STACK);\
290 IF_ASSIGN(var, ent, struct print_entry, TRACE_PRINT); \
297 IF_ASSIGN(var, ent, struct bprint_entry, TRACE_BPRINT); \
298 IF_ASSIGN(var, ent, struct special_entry, 0); \
299 IF_ASSIGN(var, ent, struct trace_mmiotrace_rw, \
300 TRACE_MMIO_RW); \
301 IF_ASSIGN(var, ent, struct trace_mmiotrace_map, \
302 TRACE_MMIO_MAP); \
303 IF_ASSIGN(var, ent, struct trace_boot_call, TRACE_BOOT_CALL);\
304 IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\
305 IF_ASSIGN(var, ent, struct trace_branch, TRACE_BRANCH); \

--- 268 unchanged lines hidden (view full) ---

574 struct trace_array *tr);
575extern int trace_selftest_startup_branch(struct tracer *trace,
576 struct trace_array *tr);
577#endif /* CONFIG_FTRACE_STARTUP_TEST */
578
579extern void *head_page(struct trace_array_cpu *data);
580extern long ns2usecs(cycle_t nsec);
581extern int
291 IF_ASSIGN(var, ent, struct special_entry, 0); \
292 IF_ASSIGN(var, ent, struct trace_mmiotrace_rw, \
293 TRACE_MMIO_RW); \
294 IF_ASSIGN(var, ent, struct trace_mmiotrace_map, \
295 TRACE_MMIO_MAP); \
296 IF_ASSIGN(var, ent, struct trace_boot_call, TRACE_BOOT_CALL);\
297 IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\
298 IF_ASSIGN(var, ent, struct trace_branch, TRACE_BRANCH); \

--- 268 unchanged lines hidden (view full) ---

567 struct trace_array *tr);
568extern int trace_selftest_startup_branch(struct tracer *trace,
569 struct trace_array *tr);
570#endif /* CONFIG_FTRACE_STARTUP_TEST */
571
572extern void *head_page(struct trace_array_cpu *data);
573extern long ns2usecs(cycle_t nsec);
574extern int
582trace_vbprintk(unsigned long ip, int depth, const char *fmt, va_list args);
583extern int
584trace_vprintk(unsigned long ip, int depth, const char *fmt, va_list args);
585
586extern unsigned long trace_flags;
587
588/* Standard output formatting function used for function return traces */
589#ifdef CONFIG_FUNCTION_GRAPH_TRACER
590extern enum print_line_t print_graph_function(struct trace_iterator *iter);
591

--- 151 unchanged lines hidden (view full) ---

743{
744 return 0;
745}
746static inline void trace_branch_disable(void)
747{
748}
749#endif /* CONFIG_BRANCH_TRACER */
750
575trace_vprintk(unsigned long ip, int depth, const char *fmt, va_list args);
576
577extern unsigned long trace_flags;
578
579/* Standard output formatting function used for function return traces */
580#ifdef CONFIG_FUNCTION_GRAPH_TRACER
581extern enum print_line_t print_graph_function(struct trace_iterator *iter);
582

--- 151 unchanged lines hidden (view full) ---

734{
735 return 0;
736}
737static inline void trace_branch_disable(void)
738{
739}
740#endif /* CONFIG_BRANCH_TRACER */
741
751/* set ring buffers to default size if not already done so */
752int tracing_update_buffers(void);
753
754/* trace event type bit fields, not numeric */
755enum {
756 TRACE_EVENT_TYPE_PRINTF = 1,
757 TRACE_EVENT_TYPE_RAW = 2,
758};
759
760struct ftrace_event_call {
761 char *name;

--- 6 unchanged lines hidden (view full) ---

768 int (*raw_init)(void);
769 int (*show_format)(struct trace_seq *s);
770};
771
772void event_trace_printk(unsigned long ip, const char *fmt, ...);
773extern struct ftrace_event_call __start_ftrace_events[];
774extern struct ftrace_event_call __stop_ftrace_events[];
775
742/* trace event type bit fields, not numeric */
743enum {
744 TRACE_EVENT_TYPE_PRINTF = 1,
745 TRACE_EVENT_TYPE_RAW = 2,
746};
747
748struct ftrace_event_call {
749 char *name;

--- 6 unchanged lines hidden (view full) ---

756 int (*raw_init)(void);
757 int (*show_format)(struct trace_seq *s);
758};
759
760void event_trace_printk(unsigned long ip, const char *fmt, ...);
761extern struct ftrace_event_call __start_ftrace_events[];
762extern struct ftrace_event_call __stop_ftrace_events[];
763
776extern const char *__start___trace_bprintk_fmt[];
777extern const char *__stop___trace_bprintk_fmt[];
778
779/*
780 * The double __builtin_constant_p is because gcc will give us an error
781 * if we try to allocate the static variable to fmt if it is not a
782 * constant. Even with the outer if statement optimizing out.
783 */
784#define event_trace_printk(ip, fmt, args...) \
785do { \
786 __trace_printk_check_format(fmt, ##args); \
787 tracing_record_cmdline(current); \
788 if (__builtin_constant_p(fmt)) { \
789 static const char *trace_printk_fmt \
790 __attribute__((section("__trace_printk_fmt"))) = \
791 __builtin_constant_p(fmt) ? fmt : NULL; \
792 \
793 __trace_bprintk(ip, trace_printk_fmt, ##args); \
794 } else \
795 __trace_printk(ip, fmt, ##args); \
796} while (0)
797
798#endif /* _LINUX_KERNEL_TRACE_H */
764#endif /* _LINUX_KERNEL_TRACE_H */