2 * ltt/probes/syscall-trace.c
4 * System call tracepoint probes.
6 * (C) Copyright 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
7 * Dual LGPL v2.1/GPL v2 license.
10 #include <linux/module.h>
11 #include <trace/syscall.h>
13 #include "../ltt-type-serializer.h"
16 /* kernel_syscall_entry specialized tracepoint probe */
18 void probe_syscall_entry(void *_data
, struct pt_regs
*regs
, long id
);
20 DEFINE_MARKER_TP(kernel
, syscall_entry
, syscall_entry
,
21 probe_syscall_entry
, "ip #p%ld syscall_id #2u%u");
23 notrace
void probe_syscall_entry(void *_data
, struct pt_regs
*regs
, long id
)
25 struct marker
*marker
;
26 struct serialize_long_short data
;
28 data
.f1
= instruction_pointer(regs
);
29 data
.f2
= (unsigned short)id
;
31 marker
= &GET_MARKER(kernel
, syscall_entry
);
32 ltt_specialized_trace(marker
, marker
->single
.probe_private
,
33 &data
, serialize_sizeof(data
), sizeof(long));
36 /* kernel_syscall_exit specialized tracepoint probe */
38 void probe_syscall_exit(void *_data
, long ret
);
40 DEFINE_MARKER_TP(kernel
, syscall_exit
, syscall_exit
,
41 probe_syscall_exit
, "ret %ld");
43 notrace
void probe_syscall_exit(void *_data
, long ret
)
45 struct marker
*marker
;
47 marker
= &GET_MARKER(kernel
, syscall_exit
);
48 ltt_specialized_trace(marker
, marker
->single
.probe_private
,
49 &ret
, sizeof(ret
), sizeof(ret
));
52 MODULE_LICENSE("GPL and additional rights");
53 MODULE_AUTHOR("Mathieu Desnoyers");
54 MODULE_DESCRIPTION("syscall Tracepoint Probes");