aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-08-26 02:29:02 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-26 02:29:02 -0400
commit35dce1a99d010f3d738af4ce1b9b77302fdfe69c (patch)
treee34a37de965a79a2ae301de4d0557f500111dde6 /include/trace
parent7cb2e3ee2aeec5b83ecadba929a2dc575dd4008f (diff)
parent1c569f0264ea629c10bbab471dd0626ce4d3f19f (diff)
Merge branch 'tracing/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into tracing/core
Conflicts: include/linux/tracepoint.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/define_trace.h5
-rw-r--r--include/trace/events/syscalls.h70
-rw-r--r--include/trace/ftrace.h9
-rw-r--r--include/trace/syscall.h17
4 files changed, 84 insertions, 17 deletions
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index cd150b9d8e32..a89ed590597a 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -26,6 +26,11 @@
26#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ 26#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
27 DEFINE_TRACE(name) 27 DEFINE_TRACE(name)
28 28
29#undef TRACE_EVENT_FN
30#define TRACE_EVENT_FN(name, proto, args, tstruct, \
31 assign, print, reg, unreg) \
32 DEFINE_TRACE_FN(name, reg, unreg)
33
29#undef DECLARE_TRACE 34#undef DECLARE_TRACE
30#define DECLARE_TRACE(name, proto, args) \ 35#define DECLARE_TRACE(name, proto, args) \
31 DEFINE_TRACE(name) 36 DEFINE_TRACE(name)
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
15extern void syscall_regfunc(void);
16extern void syscall_unregfunc(void);
17
18TRACE_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
42TRACE_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
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 1b1f742a6045..360a77ad79e1 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -45,6 +45,15 @@
45 }; \ 45 }; \
46 static struct ftrace_event_call event_##name 46 static struct ftrace_event_call event_##name
47 47
48/* Callbacks are meaningless to ftrace. */
49#undef TRACE_EVENT_FN
50#define TRACE_EVENT_FN(name, proto, args, tstruct, \
51 assign, print, reg, unreg) \
52 TRACE_EVENT(name, TP_PROTO(proto), TP_ARGS(args), \
53 TP_STRUCT__entry(tstruct), \
54 TP_fast_assign(assign), \
55 TP_printk(print))
56
48#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 57#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
49 58
50 59
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 9661dd406b93..5dc283ba5ae0 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -8,23 +8,6 @@
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9 9
10 10
11extern void syscall_regfunc(void);
12extern void syscall_unregfunc(void);
13
14DECLARE_TRACE_WITH_CALLBACK(syscall_enter,
15 TP_PROTO(struct pt_regs *regs, long id),
16 TP_ARGS(regs, id),
17 syscall_regfunc,
18 syscall_unregfunc
19);
20
21DECLARE_TRACE_WITH_CALLBACK(syscall_exit,
22 TP_PROTO(struct pt_regs *regs, long ret),
23 TP_ARGS(regs, ret),
24 syscall_regfunc,
25 syscall_unregfunc
26);
27
28/* 11/*
29 * A syscall entry in the ftrace syscalls array. 12 * A syscall entry in the ftrace syscalls array.
30 * 13 *