blob: 5a4c04a75b3d369fc9665eca1deee12a2d442d61 [file] [log] [blame]
Josh Stone1c569f02009-08-24 14:43:14 -07001#undef TRACE_SYSTEM
Lai Jiangshanb8007ef2009-11-03 13:45:32 +08002#define TRACE_SYSTEM raw_syscalls
3#define TRACE_INCLUDE_FILE syscalls
Josh Stone1c569f02009-08-24 14:43:14 -07004
5#if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_EVENTS_SYSCALLS_H
7
8#include <linux/tracepoint.h>
9
10#include <asm/ptrace.h>
11#include <asm/syscall.h>
12
13
14#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
15
16extern void syscall_regfunc(void);
17extern void syscall_unregfunc(void);
18
19TRACE_EVENT_FN(sys_enter,
20
21 TP_PROTO(struct pt_regs *regs, long id),
22
23 TP_ARGS(regs, id),
24
25 TP_STRUCT__entry(
26 __field( long, id )
27 __array( unsigned long, args, 6 )
28 ),
29
30 TP_fast_assign(
31 __entry->id = id;
32 syscall_get_arguments(current, regs, 0, 6, __entry->args);
33 ),
34
35 TP_printk("NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)",
36 __entry->id,
37 __entry->args[0], __entry->args[1], __entry->args[2],
38 __entry->args[3], __entry->args[4], __entry->args[5]),
39
40 syscall_regfunc, syscall_unregfunc
41);
42
Frederic Weisbeckerfe554202010-11-18 01:52:06 +010043TRACE_EVENT_FLAGS(sys_enter, TRACE_EVENT_FL_CAP_ANY)
44
Josh Stone1c569f02009-08-24 14:43:14 -070045TRACE_EVENT_FN(sys_exit,
46
47 TP_PROTO(struct pt_regs *regs, long ret),
48
49 TP_ARGS(regs, ret),
50
51 TP_STRUCT__entry(
52 __field( long, id )
53 __field( long, ret )
54 ),
55
56 TP_fast_assign(
57 __entry->id = syscall_get_nr(current, regs);
58 __entry->ret = ret;
59 ),
60
61 TP_printk("NR %ld = %ld",
62 __entry->id, __entry->ret),
63
64 syscall_regfunc, syscall_unregfunc
65);
66
Frederic Weisbeckerfe554202010-11-18 01:52:06 +010067TRACE_EVENT_FLAGS(sys_exit, TRACE_EVENT_FL_CAP_ANY)
68
Josh Stone1c569f02009-08-24 14:43:14 -070069#endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */
70
71#endif /* _TRACE_EVENTS_SYSCALLS_H */
72
73/* This part must be outside protection */
74#include <trace/define_trace.h>
75