| 1 | /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) */ |
| 2 | |
| 3 | #ifndef CREATE_SYSCALL_TABLE |
| 4 | |
| 5 | #define OVERRIDE_32_mmap |
| 6 | #define OVERRIDE_64_mmap |
| 7 | SC_LTTNG_TRACEPOINT_EVENT(mmap, |
| 8 | TP_PROTO(sc_exit(unsigned long ret,) |
| 9 | unsigned long addr, unsigned long len, |
| 10 | unsigned long prot, unsigned long flags, |
| 11 | unsigned long fd, unsigned long off), |
| 12 | TP_ARGS(sc_exit(ret,) addr, len, prot, flags, fd, off), |
| 13 | TP_FIELDS(sc_exit(ctf_integer_hex(unsigned long, ret, ret)) |
| 14 | sc_in(ctf_integer_hex(unsigned long, addr, addr)) |
| 15 | sc_in(ctf_integer(size_t, len, len)) |
| 16 | sc_in(ctf_integer(int, prot, prot)) |
| 17 | sc_in(ctf_integer(int, flags, flags)) |
| 18 | sc_in(ctf_integer(int, fd, fd)) |
| 19 | sc_in(ctf_integer(off_t, offset, off)) |
| 20 | ) |
| 21 | ) |
| 22 | |
| 23 | /* |
| 24 | * Enumeration of the open flags, as described in the 'open' |
| 25 | * system call man page. |
| 26 | */ |
| 27 | SC_LTTNG_TRACEPOINT_ENUM(lttng_fcntl_cmd_flags, |
| 28 | TP_ENUM_VALUES( |
| 29 | ctf_enum_value("F_DUPFD", F_DUPFD) |
| 30 | ctf_enum_value("F_GETFD", F_GETFD) |
| 31 | ctf_enum_value("F_SETFD", F_SETFD) |
| 32 | ctf_enum_value("F_GETFL", F_GETFL) |
| 33 | ctf_enum_value("F_SETFL", F_SETFL) |
| 34 | ctf_enum_value("F_GETLK", F_GETLK) |
| 35 | ctf_enum_value("F_SETLK", F_SETLK) |
| 36 | ctf_enum_value("F_SETLKW", F_SETLKW) |
| 37 | ctf_enum_value("F_SETOWN", F_SETOWN) |
| 38 | ctf_enum_value("F_GETOWN", F_GETOWN) |
| 39 | ctf_enum_value("F_SETSIG", F_SETSIG) |
| 40 | ctf_enum_value("F_GETSIG", F_GETSIG) |
| 41 | ctf_enum_value("F_GETLK64", F_GETLK64) |
| 42 | ctf_enum_value("F_SETLK64", F_SETLK64) |
| 43 | ctf_enum_value("F_SETLKW64", F_SETLKW64) |
| 44 | ctf_enum_value("F_SETOWN_EX", F_SETOWN_EX) |
| 45 | ctf_enum_value("F_GETOWN_EX", F_GETOWN_EX) |
| 46 | ctf_enum_value("F_GETOWNER_UIDS", F_GETOWNER_UIDS) |
| 47 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) |
| 48 | ctf_enum_value("F_OFD_GETLK", F_OFD_GETLK) |
| 49 | ctf_enum_value("F_OFD_SETLK", F_OFD_SETLK) |
| 50 | ctf_enum_value("F_OFD_SETLKW", F_OFD_SETLKW) |
| 51 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ |
| 52 | ctf_enum_value("F_SETLEASE", F_SETLEASE) |
| 53 | ctf_enum_value("F_GETLEASE", F_GETLEASE) |
| 54 | ctf_enum_value("F_NOTIFY", F_NOTIFY) |
| 55 | ctf_enum_value("F_CANCELLK", F_CANCELLK) |
| 56 | ctf_enum_value("F_DUPFD_CLOEXEC", F_DUPFD_CLOEXEC) |
| 57 | ctf_enum_value("F_SETPIPE_SZ", F_SETPIPE_SZ) |
| 58 | ctf_enum_value("F_GETPIPE_SZ", F_GETPIPE_SZ) |
| 59 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) |
| 60 | ctf_enum_value("F_ADD_SEALS", F_ADD_SEALS) |
| 61 | ctf_enum_value("F_GET_SEALS", F_GET_SEALS) |
| 62 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) */ |
| 63 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) |
| 64 | ctf_enum_value("F_GET_RW_HINT", F_GET_RW_HINT) |
| 65 | ctf_enum_value("F_SET_RW_HINT", F_SET_RW_HINT) |
| 66 | ctf_enum_value("F_GET_FILE_RW_HINT", F_GET_FILE_RW_HINT) |
| 67 | ctf_enum_value("F_SET_FILE_RW_HINT", F_SET_FILE_RW_HINT) |
| 68 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) */ |
| 69 | ) |
| 70 | ) |
| 71 | |
| 72 | #define OVERRIDE_32_fcntl |
| 73 | #define OVERRIDE_64_fcntl |
| 74 | SC_LTTNG_TRACEPOINT_EVENT(fcntl, |
| 75 | TP_PROTO(sc_exit(long ret,) unsigned int fd, unsigned int cmd, unsigned long arg), |
| 76 | TP_ARGS(sc_exit(ret,) fd, cmd, arg), |
| 77 | TP_FIELDS( |
| 78 | sc_exit(ctf_integer(long, ret, ret)) |
| 79 | sc_in(ctf_integer(unsigned int, fd, fd)) |
| 80 | sc_in(ctf_enum(lttng_fcntl_cmd_flags, unsigned int, cmd, cmd)) |
| 81 | sc_inout(ctf_integer(unsigned long, arg, arg))) |
| 82 | ) |
| 83 | |
| 84 | #endif /* CREATE_SYSCALL_TABLE */ |