| 1 | #define OVERRIDE_32_execve |
| 2 | #define OVERRIDE_64_execve |
| 3 | |
| 4 | #ifndef CREATE_SYSCALL_TABLE |
| 5 | |
| 6 | SC_TRACE_EVENT(execve, |
| 7 | TP_PROTO(sc_exit(long ret,) const char *filename, char *const *argv, char *const *envp), |
| 8 | TP_ARGS(sc_exit(ret,) filename, argv, envp), |
| 9 | TP_STRUCT__entry(sc_exit(__field(long, ret)) |
| 10 | sc_in(__string_from_user(filename, filename)) |
| 11 | sc_in(__field_hex(char *const *, argv)) |
| 12 | sc_in(__field_hex(char *const *, envp))), |
| 13 | TP_fast_assign(sc_exit(tp_assign(ret, ret)) |
| 14 | sc_in(tp_copy_string_from_user(filename, filename)) |
| 15 | sc_in(tp_assign(argv, argv)) |
| 16 | sc_in(tp_assign(envp, envp))), |
| 17 | TP_printk() |
| 18 | ) |
| 19 | |
| 20 | SC_TRACE_EVENT(clone, |
| 21 | TP_PROTO(sc_exit(long ret,) unsigned long clone_flags, unsigned long newsp, |
| 22 | void __user *parent_tid, |
| 23 | void __user *child_tid), |
| 24 | TP_ARGS(sc_exit(ret,) clone_flags, newsp, parent_tid, child_tid), |
| 25 | TP_STRUCT__entry( |
| 26 | sc_exit(__field(long, ret)) |
| 27 | sc_in(__field_hex(unsigned long, clone_flags)) |
| 28 | sc_in(__field_hex(unsigned long, newsp)) |
| 29 | sc_in(__field_hex(void *, parent_tid)) |
| 30 | sc_in(__field_hex(void *, child_tid))), |
| 31 | TP_fast_assign( |
| 32 | sc_exit(tp_assign(ret, ret)) |
| 33 | sc_in(tp_assign(clone_flags, clone_flags)) |
| 34 | sc_in(tp_assign(newsp, newsp)) |
| 35 | sc_in(tp_assign(parent_tid, parent_tid)) |
| 36 | sc_in(tp_assign(child_tid, child_tid))), |
| 37 | TP_printk() |
| 38 | ) |
| 39 | |
| 40 | /* present in 32, missing in 64 due to old kernel headers */ |
| 41 | #define OVERRIDE_32_getcpu |
| 42 | #define OVERRIDE_64_getcpu |
| 43 | SC_TRACE_EVENT(getcpu, |
| 44 | TP_PROTO(sc_exit(long ret,) unsigned __user *cpup, unsigned __user *nodep, void *tcache), |
| 45 | TP_ARGS(sc_exit(ret,) cpup, nodep, tcache), |
| 46 | TP_STRUCT__entry( |
| 47 | sc_exit(__field(long, ret)) |
| 48 | sc_out(__field_hex(unsigned *, cpup)) |
| 49 | sc_out(__field_hex(unsigned *, nodep)) |
| 50 | sc_inout(__field_hex(void *, tcache))), |
| 51 | TP_fast_assign( |
| 52 | sc_exit(tp_assign(ret, ret)) |
| 53 | sc_out(tp_assign(cpup, cpup)) |
| 54 | sc_out(tp_assign(nodep, nodep)) |
| 55 | sc_inout(tp_assign(tcache, tcache))), |
| 56 | TP_printk() |
| 57 | ) |
| 58 | |
| 59 | #define OVERRIDE_32_pipe |
| 60 | #define OVERRIDE_64_pipe |
| 61 | SC_TRACE_EVENT(pipe, |
| 62 | TP_PROTO(sc_exit(long ret,) int * fildes), |
| 63 | TP_ARGS(sc_exit(ret,) fildes), |
| 64 | TP_STRUCT__entry(sc_exit(__field(long, ret)) |
| 65 | sc_out(__array(int, fildes, 2)) |
| 66 | ), |
| 67 | TP_fast_assign(sc_exit(tp_assign(ret, ret)) |
| 68 | sc_out(tp_memcpy_from_user(fildes, fildes, 2)) |
| 69 | ), |
| 70 | TP_printk() |
| 71 | ) |
| 72 | |
| 73 | #define OVERRIDE_32_pipe2 |
| 74 | #define OVERRIDE_64_pipe2 |
| 75 | SC_TRACE_EVENT(pipe2, |
| 76 | TP_PROTO(sc_exit(long ret,) int * fildes, int flags), |
| 77 | TP_ARGS(sc_exit(ret,) fildes, flags), |
| 78 | TP_STRUCT__entry(sc_exit(__field(long, ret)) |
| 79 | sc_out(__array(int, fildes, 2)) |
| 80 | sc_in(__field(int, flags)) |
| 81 | ), |
| 82 | TP_fast_assign(sc_exit(tp_assign(ret, ret)) |
| 83 | sc_out(tp_memcpy_from_user(fildes, fildes, 2)) |
| 84 | sc_in(tp_assign(flags, flags)) |
| 85 | ), |
| 86 | TP_printk() |
| 87 | ) |
| 88 | |
| 89 | #endif /* CREATE_SYSCALL_TABLE */ |