diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 16:24:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 16:24:03 -0400 |
commit | 483e3cd6a34ad2d7e41100bc1b98614ac42a4567 (patch) | |
tree | ef544ccdd1e95991c32fd8b656714583b7398371 /include/trace/events | |
parent | 774a694f8cd08115d130a290d73c6d8563f26b1b (diff) | |
parent | d28daf923ac5e4a0d7cecebae56f3e339189366b (diff) |
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (105 commits)
ring-buffer: only enable ring_buffer_swap_cpu when needed
ring-buffer: check for swapped buffers in start of committing
tracing: report error in trace if we fail to swap latency buffer
tracing: add trace_array_printk for internal tracers to use
tracing: pass around ring buffer instead of tracer
tracing: make tracing_reset safe for external use
tracing: use timestamp to determine start of latency traces
tracing: Remove mentioning of legacy latency_trace file from documentation
tracing/filters: Defer pred allocation, fix memory leak
tracing: remove users of tracing_reset
tracing: disable buffers and synchronize_sched before resetting
tracing: disable update max tracer while reading trace
tracing: print out start and stop in latency traces
ring-buffer: disable all cpu buffers when one finds a problem
ring-buffer: do not count discarded events
ring-buffer: remove ring_buffer_event_discard
ring-buffer: fix ring_buffer_read crossing pages
ring-buffer: remove unnecessary cpu_relax
ring-buffer: do not swap buffers during a commit
ring-buffer: do not reset while in a commit
...
Diffstat (limited to 'include/trace/events')
-rw-r--r-- | include/trace/events/module.h | 126 | ||||
-rw-r--r-- | include/trace/events/sched.h | 12 | ||||
-rw-r--r-- | include/trace/events/syscalls.h | 70 |
3 files changed, 204 insertions, 4 deletions
diff --git a/include/trace/events/module.h b/include/trace/events/module.h new file mode 100644 index 000000000000..84160fb18478 --- /dev/null +++ b/include/trace/events/module.h | |||
@@ -0,0 +1,126 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM module | ||
3 | |||
4 | #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_MODULE_H | ||
6 | |||
7 | #include <linux/tracepoint.h> | ||
8 | |||
9 | #ifdef CONFIG_MODULES | ||
10 | |||
11 | struct module; | ||
12 | |||
13 | #define show_module_flags(flags) __print_flags(flags, "", \ | ||
14 | { (1UL << TAINT_PROPRIETARY_MODULE), "P" }, \ | ||
15 | { (1UL << TAINT_FORCED_MODULE), "F" }, \ | ||
16 | { (1UL << TAINT_CRAP), "C" }) | ||
17 | |||
18 | TRACE_EVENT(module_load, | ||
19 | |||
20 | TP_PROTO(struct module *mod), | ||
21 | |||
22 | TP_ARGS(mod), | ||
23 | |||
24 | TP_STRUCT__entry( | ||
25 | __field( unsigned int, taints ) | ||
26 | __string( name, mod->name ) | ||
27 | ), | ||
28 | |||
29 | TP_fast_assign( | ||
30 | __entry->taints = mod->taints; | ||
31 | __assign_str(name, mod->name); | ||
32 | ), | ||
33 | |||
34 | TP_printk("%s %s", __get_str(name), show_module_flags(__entry->taints)) | ||
35 | ); | ||
36 | |||
37 | TRACE_EVENT(module_free, | ||
38 | |||
39 | TP_PROTO(struct module *mod), | ||
40 | |||
41 | TP_ARGS(mod), | ||
42 | |||
43 | TP_STRUCT__entry( | ||
44 | __string( name, mod->name ) | ||
45 | ), | ||
46 | |||
47 | TP_fast_assign( | ||
48 | __assign_str(name, mod->name); | ||
49 | ), | ||
50 | |||
51 | TP_printk("%s", __get_str(name)) | ||
52 | ); | ||
53 | |||
54 | TRACE_EVENT(module_get, | ||
55 | |||
56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | ||
57 | |||
58 | TP_ARGS(mod, ip, refcnt), | ||
59 | |||
60 | TP_STRUCT__entry( | ||
61 | __field( unsigned long, ip ) | ||
62 | __field( int, refcnt ) | ||
63 | __string( name, mod->name ) | ||
64 | ), | ||
65 | |||
66 | TP_fast_assign( | ||
67 | __entry->ip = ip; | ||
68 | __entry->refcnt = refcnt; | ||
69 | __assign_str(name, mod->name); | ||
70 | ), | ||
71 | |||
72 | TP_printk("%s call_site=%pf refcnt=%d", | ||
73 | __get_str(name), (void *)__entry->ip, __entry->refcnt) | ||
74 | ); | ||
75 | |||
76 | TRACE_EVENT(module_put, | ||
77 | |||
78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | ||
79 | |||
80 | TP_ARGS(mod, ip, refcnt), | ||
81 | |||
82 | TP_STRUCT__entry( | ||
83 | __field( unsigned long, ip ) | ||
84 | __field( int, refcnt ) | ||
85 | __string( name, mod->name ) | ||
86 | ), | ||
87 | |||
88 | TP_fast_assign( | ||
89 | __entry->ip = ip; | ||
90 | __entry->refcnt = refcnt; | ||
91 | __assign_str(name, mod->name); | ||
92 | ), | ||
93 | |||
94 | TP_printk("%s call_site=%pf refcnt=%d", | ||
95 | __get_str(name), (void *)__entry->ip, __entry->refcnt) | ||
96 | ); | ||
97 | |||
98 | TRACE_EVENT(module_request, | ||
99 | |||
100 | TP_PROTO(char *name, bool wait, unsigned long ip), | ||
101 | |||
102 | TP_ARGS(name, wait, ip), | ||
103 | |||
104 | TP_STRUCT__entry( | ||
105 | __field( bool, wait ) | ||
106 | __field( unsigned long, ip ) | ||
107 | __string( name, name ) | ||
108 | ), | ||
109 | |||
110 | TP_fast_assign( | ||
111 | __entry->wait = wait; | ||
112 | __entry->ip = ip; | ||
113 | __assign_str(name, name); | ||
114 | ), | ||
115 | |||
116 | TP_printk("%s wait=%d call_site=%pf", | ||
117 | __get_str(name), (int)__entry->wait, (void *)__entry->ip) | ||
118 | ); | ||
119 | |||
120 | #endif /* CONFIG_MODULES */ | ||
121 | |||
122 | #endif /* _TRACE_MODULE_H */ | ||
123 | |||
124 | /* This part must be outside protection */ | ||
125 | #include <trace/define_trace.h> | ||
126 | |||
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index a4c369ec328f..b48f1ad7c946 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -94,6 +94,7 @@ TRACE_EVENT(sched_wakeup, | |||
94 | __field( pid_t, pid ) | 94 | __field( pid_t, pid ) |
95 | __field( int, prio ) | 95 | __field( int, prio ) |
96 | __field( int, success ) | 96 | __field( int, success ) |
97 | __field( int, cpu ) | ||
97 | ), | 98 | ), |
98 | 99 | ||
99 | TP_fast_assign( | 100 | TP_fast_assign( |
@@ -101,11 +102,12 @@ TRACE_EVENT(sched_wakeup, | |||
101 | __entry->pid = p->pid; | 102 | __entry->pid = p->pid; |
102 | __entry->prio = p->prio; | 103 | __entry->prio = p->prio; |
103 | __entry->success = success; | 104 | __entry->success = success; |
105 | __entry->cpu = task_cpu(p); | ||
104 | ), | 106 | ), |
105 | 107 | ||
106 | TP_printk("task %s:%d [%d] success=%d", | 108 | TP_printk("task %s:%d [%d] success=%d [%03d]", |
107 | __entry->comm, __entry->pid, __entry->prio, | 109 | __entry->comm, __entry->pid, __entry->prio, |
108 | __entry->success) | 110 | __entry->success, __entry->cpu) |
109 | ); | 111 | ); |
110 | 112 | ||
111 | /* | 113 | /* |
@@ -125,6 +127,7 @@ TRACE_EVENT(sched_wakeup_new, | |||
125 | __field( pid_t, pid ) | 127 | __field( pid_t, pid ) |
126 | __field( int, prio ) | 128 | __field( int, prio ) |
127 | __field( int, success ) | 129 | __field( int, success ) |
130 | __field( int, cpu ) | ||
128 | ), | 131 | ), |
129 | 132 | ||
130 | TP_fast_assign( | 133 | TP_fast_assign( |
@@ -132,11 +135,12 @@ TRACE_EVENT(sched_wakeup_new, | |||
132 | __entry->pid = p->pid; | 135 | __entry->pid = p->pid; |
133 | __entry->prio = p->prio; | 136 | __entry->prio = p->prio; |
134 | __entry->success = success; | 137 | __entry->success = success; |
138 | __entry->cpu = task_cpu(p); | ||
135 | ), | 139 | ), |
136 | 140 | ||
137 | TP_printk("task %s:%d [%d] success=%d", | 141 | TP_printk("task %s:%d [%d] success=%d [%03d]", |
138 | __entry->comm, __entry->pid, __entry->prio, | 142 | __entry->comm, __entry->pid, __entry->prio, |
139 | __entry->success) | 143 | __entry->success, __entry->cpu) |
140 | ); | 144 | ); |
141 | 145 | ||
142 | /* | 146 | /* |
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h new file mode 100644 index 000000000000..397dff2dbd5a --- /dev/null +++ b/include/trace/events/syscalls.h | |||
@@ -0,0 +1,70 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM syscalls | ||
3 | |||
4 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_EVENTS_SYSCALLS_H | ||
6 | |||
7 | #include <linux/tracepoint.h> | ||
8 | |||
9 | #include <asm/ptrace.h> | ||
10 | #include <asm/syscall.h> | ||
11 | |||
12 | |||
13 | #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS | ||
14 | |||
15 | extern void syscall_regfunc(void); | ||
16 | extern void syscall_unregfunc(void); | ||
17 | |||
18 | TRACE_EVENT_FN(sys_enter, | ||
19 | |||
20 | TP_PROTO(struct pt_regs *regs, long id), | ||
21 | |||
22 | TP_ARGS(regs, id), | ||
23 | |||
24 | TP_STRUCT__entry( | ||
25 | __field( long, id ) | ||
26 | __array( unsigned long, args, 6 ) | ||
27 | ), | ||
28 | |||
29 | TP_fast_assign( | ||
30 | __entry->id = id; | ||
31 | syscall_get_arguments(current, regs, 0, 6, __entry->args); | ||
32 | ), | ||
33 | |||
34 | TP_printk("NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)", | ||
35 | __entry->id, | ||
36 | __entry->args[0], __entry->args[1], __entry->args[2], | ||
37 | __entry->args[3], __entry->args[4], __entry->args[5]), | ||
38 | |||
39 | syscall_regfunc, syscall_unregfunc | ||
40 | ); | ||
41 | |||
42 | TRACE_EVENT_FN(sys_exit, | ||
43 | |||
44 | TP_PROTO(struct pt_regs *regs, long ret), | ||
45 | |||
46 | TP_ARGS(regs, ret), | ||
47 | |||
48 | TP_STRUCT__entry( | ||
49 | __field( long, id ) | ||
50 | __field( long, ret ) | ||
51 | ), | ||
52 | |||
53 | TP_fast_assign( | ||
54 | __entry->id = syscall_get_nr(current, regs); | ||
55 | __entry->ret = ret; | ||
56 | ), | ||
57 | |||
58 | TP_printk("NR %ld = %ld", | ||
59 | __entry->id, __entry->ret), | ||
60 | |||
61 | syscall_regfunc, syscall_unregfunc | ||
62 | ); | ||
63 | |||
64 | #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */ | ||
65 | |||
66 | #endif /* _TRACE_EVENTS_SYSCALLS_H */ | ||
67 | |||
68 | /* This part must be outside protection */ | ||
69 | #include <trace/define_trace.h> | ||
70 | |||