Rename LTTng instrumentation macros
[lttng-modules.git] / instrumentation / events / lttng-module / syscalls.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM raw_syscalls
3 #define TRACE_INCLUDE_FILE syscalls
4
5 #if !defined(LTTNG_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_EVENTS_SYSCALLS_H
7
8 #include "../../../probes/lttng-tracepoint-event.h"
9
10 #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
11
12 #ifndef _TRACE_SYSCALLS_DEF_
13 #define _TRACE_SYSCALLS_DEF_
14
15 #include <asm/ptrace.h>
16 #include <asm/syscall.h>
17
18 #endif /* _TRACE_SYSCALLS_DEF_ */
19
20 LTTNG_TRACEPOINT_EVENT(sys_enter,
21
22 TP_PROTO(struct pt_regs *regs, long id),
23
24 TP_ARGS(regs, id),
25
26 TP_STRUCT__entry(
27 __field( long, id )
28 __array( unsigned long, args, 6 )
29 ),
30
31 TP_fast_assign(
32 tp_assign(id, id)
33 {
34 tp_memcpy(args,
35 ({
36 unsigned long args_copy[6];
37 syscall_get_arguments(current, regs,
38 0, 6, args_copy);
39 args_copy;
40 }), 6 * sizeof(unsigned long));
41 }
42 ),
43
44 TP_printk("NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)",
45 __entry->id,
46 __entry->args[0], __entry->args[1], __entry->args[2],
47 __entry->args[3], __entry->args[4], __entry->args[5])
48 )
49
50 LTTNG_TRACEPOINT_EVENT(sys_exit,
51
52 TP_PROTO(struct pt_regs *regs, long ret),
53
54 TP_ARGS(regs, ret),
55
56 TP_STRUCT__entry(
57 __field( long, id )
58 __field( long, ret )
59 ),
60
61 TP_fast_assign(
62 tp_assign(id, syscall_get_nr(current, regs))
63 tp_assign(ret, ret)
64 ),
65
66 TP_printk("NR %ld = %ld",
67 __entry->id, __entry->ret)
68 )
69
70 #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */
71
72 #endif /* LTTNG_TRACE_EVENTS_SYSCALLS_H */
73
74 /* This part must be outside protection */
75 #include "../../../probes/define_trace.h"
76
This page took 0.029813 seconds and 4 git commands to generate.