Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com> |
| 4 | */ |
| 5 | #undef TRACE_SYSTEM |
| 6 | #define TRACE_SYSTEM nfs |
| 7 | |
| 8 | #if !defined(_TRACE_NFS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 9 | #define _TRACE_NFS_H |
| 10 | |
| 11 | #include <linux/tracepoint.h> |
Jeff Layton | 1eb5d98 | 2018-01-09 08:21:17 -0500 | [diff] [blame] | 12 | #include <linux/iversion.h> |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 13 | |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 14 | #include <trace/events/fs.h> |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 15 | #include <trace/events/nfs.h> |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 16 | #include <trace/events/sunrpc_base.h> |
| 17 | |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 18 | #define nfs_show_cache_validity(v) \ |
| 19 | __print_flags(v, "|", \ |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 20 | { NFS_INO_INVALID_DATA, "INVALID_DATA" }, \ |
| 21 | { NFS_INO_INVALID_ATIME, "INVALID_ATIME" }, \ |
| 22 | { NFS_INO_INVALID_ACCESS, "INVALID_ACCESS" }, \ |
| 23 | { NFS_INO_INVALID_ACL, "INVALID_ACL" }, \ |
| 24 | { NFS_INO_REVAL_PAGECACHE, "REVAL_PAGECACHE" }, \ |
| 25 | { NFS_INO_REVAL_FORCED, "REVAL_FORCED" }, \ |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 26 | { NFS_INO_INVALID_LABEL, "INVALID_LABEL" }, \ |
| 27 | { NFS_INO_INVALID_CHANGE, "INVALID_CHANGE" }, \ |
| 28 | { NFS_INO_INVALID_CTIME, "INVALID_CTIME" }, \ |
| 29 | { NFS_INO_INVALID_MTIME, "INVALID_MTIME" }, \ |
| 30 | { NFS_INO_INVALID_SIZE, "INVALID_SIZE" }, \ |
Frank van der Linden | 0f44da5 | 2020-06-23 22:39:00 +0000 | [diff] [blame] | 31 | { NFS_INO_INVALID_OTHER, "INVALID_OTHER" }, \ |
Trond Myklebust | 8a27c7cc | 2021-03-25 15:45:09 -0400 | [diff] [blame] | 32 | { NFS_INO_DATA_INVAL_DEFER, "DATA_INVAL_DEFER" }, \ |
| 33 | { NFS_INO_INVALID_BLOCKS, "INVALID_BLOCKS" }, \ |
Trond Myklebust | fabf2b3 | 2021-03-25 13:14:42 -0400 | [diff] [blame] | 34 | { NFS_INO_INVALID_XATTR, "INVALID_XATTR" }, \ |
Trond Myklebust | 720869e | 2021-04-13 09:41:16 -0400 | [diff] [blame] | 35 | { NFS_INO_INVALID_NLINK, "INVALID_NLINK" }, \ |
| 36 | { NFS_INO_INVALID_MODE, "INVALID_MODE" }) |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 37 | |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 38 | #define nfs_show_nfsi_flags(v) \ |
| 39 | __print_flags(v, "|", \ |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 40 | { BIT(NFS_INO_ADVISE_RDPLUS), "ADVISE_RDPLUS" }, \ |
| 41 | { BIT(NFS_INO_STALE), "STALE" }, \ |
| 42 | { BIT(NFS_INO_ACL_LRU_SET), "ACL_LRU_SET" }, \ |
| 43 | { BIT(NFS_INO_INVALIDATING), "INVALIDATING" }, \ |
| 44 | { BIT(NFS_INO_FSCACHE), "FSCACHE" }, \ |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 45 | { BIT(NFS_INO_LAYOUTCOMMIT), "NEED_LAYOUTCOMMIT" }, \ |
| 46 | { BIT(NFS_INO_LAYOUTCOMMITTING), "LAYOUTCOMMIT" }, \ |
| 47 | { BIT(NFS_INO_LAYOUTSTATS), "LAYOUTSTATS" }, \ |
| 48 | { BIT(NFS_INO_ODIRECT), "ODIRECT" }) |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 49 | |
| 50 | DECLARE_EVENT_CLASS(nfs_inode_event, |
| 51 | TP_PROTO( |
| 52 | const struct inode *inode |
| 53 | ), |
| 54 | |
| 55 | TP_ARGS(inode), |
| 56 | |
| 57 | TP_STRUCT__entry( |
| 58 | __field(dev_t, dev) |
| 59 | __field(u32, fhandle) |
| 60 | __field(u64, fileid) |
| 61 | __field(u64, version) |
| 62 | ), |
| 63 | |
| 64 | TP_fast_assign( |
| 65 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 66 | __entry->dev = inode->i_sb->s_dev; |
| 67 | __entry->fileid = nfsi->fileid; |
| 68 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
Jeff Layton | 1eb5d98 | 2018-01-09 08:21:17 -0500 | [diff] [blame] | 69 | __entry->version = inode_peek_iversion_raw(inode); |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 70 | ), |
| 71 | |
| 72 | TP_printk( |
| 73 | "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ", |
| 74 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 75 | (unsigned long long)__entry->fileid, |
| 76 | __entry->fhandle, |
| 77 | (unsigned long long)__entry->version |
| 78 | ) |
| 79 | ); |
| 80 | |
| 81 | DECLARE_EVENT_CLASS(nfs_inode_event_done, |
| 82 | TP_PROTO( |
| 83 | const struct inode *inode, |
| 84 | int error |
| 85 | ), |
| 86 | |
| 87 | TP_ARGS(inode, error), |
| 88 | |
| 89 | TP_STRUCT__entry( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 90 | __field(unsigned long, error) |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 91 | __field(dev_t, dev) |
| 92 | __field(u32, fhandle) |
| 93 | __field(unsigned char, type) |
| 94 | __field(u64, fileid) |
| 95 | __field(u64, version) |
| 96 | __field(loff_t, size) |
| 97 | __field(unsigned long, nfsi_flags) |
| 98 | __field(unsigned long, cache_validity) |
| 99 | ), |
| 100 | |
| 101 | TP_fast_assign( |
| 102 | const struct nfs_inode *nfsi = NFS_I(inode); |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 103 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 104 | __entry->dev = inode->i_sb->s_dev; |
| 105 | __entry->fileid = nfsi->fileid; |
| 106 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
| 107 | __entry->type = nfs_umode_to_dtype(inode->i_mode); |
Jeff Layton | 1eb5d98 | 2018-01-09 08:21:17 -0500 | [diff] [blame] | 108 | __entry->version = inode_peek_iversion_raw(inode); |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 109 | __entry->size = i_size_read(inode); |
| 110 | __entry->nfsi_flags = nfsi->flags; |
| 111 | __entry->cache_validity = nfsi->cache_validity; |
| 112 | ), |
| 113 | |
| 114 | TP_printk( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 115 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 116 | "type=%u (%s) version=%llu size=%lld " |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 117 | "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s)", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 118 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 119 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 120 | (unsigned long long)__entry->fileid, |
| 121 | __entry->fhandle, |
| 122 | __entry->type, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 123 | show_fs_dirent_type(__entry->type), |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 124 | (unsigned long long)__entry->version, |
| 125 | (long long)__entry->size, |
| 126 | __entry->cache_validity, |
| 127 | nfs_show_cache_validity(__entry->cache_validity), |
| 128 | __entry->nfsi_flags, |
| 129 | nfs_show_nfsi_flags(__entry->nfsi_flags) |
| 130 | ) |
| 131 | ); |
| 132 | |
| 133 | #define DEFINE_NFS_INODE_EVENT(name) \ |
| 134 | DEFINE_EVENT(nfs_inode_event, name, \ |
| 135 | TP_PROTO( \ |
| 136 | const struct inode *inode \ |
| 137 | ), \ |
| 138 | TP_ARGS(inode)) |
| 139 | #define DEFINE_NFS_INODE_EVENT_DONE(name) \ |
| 140 | DEFINE_EVENT(nfs_inode_event_done, name, \ |
| 141 | TP_PROTO( \ |
| 142 | const struct inode *inode, \ |
| 143 | int error \ |
| 144 | ), \ |
| 145 | TP_ARGS(inode, error)) |
Trond Myklebust | 93ce4af | 2020-04-06 13:39:29 -0400 | [diff] [blame] | 146 | DEFINE_NFS_INODE_EVENT(nfs_set_inode_stale); |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 147 | DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter); |
| 148 | DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit); |
| 149 | DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter); |
| 150 | DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit); |
| 151 | DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter); |
| 152 | DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit); |
| 153 | DEFINE_NFS_INODE_EVENT(nfs_getattr_enter); |
| 154 | DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit); |
| 155 | DEFINE_NFS_INODE_EVENT(nfs_setattr_enter); |
| 156 | DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit); |
| 157 | DEFINE_NFS_INODE_EVENT(nfs_writeback_page_enter); |
| 158 | DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_page_exit); |
| 159 | DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter); |
| 160 | DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit); |
| 161 | DEFINE_NFS_INODE_EVENT(nfs_fsync_enter); |
| 162 | DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit); |
| 163 | DEFINE_NFS_INODE_EVENT(nfs_access_enter); |
Benjamin Coddington | 93c2e5e | 2021-11-16 08:49:24 -0500 | [diff] [blame] | 164 | DEFINE_NFS_INODE_EVENT_DONE(nfs_set_cache_invalid); |
Trond Myklebust | e8194b7 | 2020-01-06 15:25:12 -0500 | [diff] [blame] | 165 | |
| 166 | TRACE_EVENT(nfs_access_exit, |
| 167 | TP_PROTO( |
| 168 | const struct inode *inode, |
| 169 | unsigned int mask, |
| 170 | unsigned int permitted, |
| 171 | int error |
| 172 | ), |
| 173 | |
| 174 | TP_ARGS(inode, mask, permitted, error), |
| 175 | |
| 176 | TP_STRUCT__entry( |
| 177 | __field(unsigned long, error) |
| 178 | __field(dev_t, dev) |
| 179 | __field(u32, fhandle) |
| 180 | __field(unsigned char, type) |
| 181 | __field(u64, fileid) |
| 182 | __field(u64, version) |
| 183 | __field(loff_t, size) |
| 184 | __field(unsigned long, nfsi_flags) |
| 185 | __field(unsigned long, cache_validity) |
| 186 | __field(unsigned int, mask) |
| 187 | __field(unsigned int, permitted) |
| 188 | ), |
| 189 | |
| 190 | TP_fast_assign( |
| 191 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 192 | __entry->error = error < 0 ? -error : 0; |
| 193 | __entry->dev = inode->i_sb->s_dev; |
| 194 | __entry->fileid = nfsi->fileid; |
| 195 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
| 196 | __entry->type = nfs_umode_to_dtype(inode->i_mode); |
| 197 | __entry->version = inode_peek_iversion_raw(inode); |
| 198 | __entry->size = i_size_read(inode); |
| 199 | __entry->nfsi_flags = nfsi->flags; |
| 200 | __entry->cache_validity = nfsi->cache_validity; |
| 201 | __entry->mask = mask; |
| 202 | __entry->permitted = permitted; |
| 203 | ), |
| 204 | |
| 205 | TP_printk( |
| 206 | "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 207 | "type=%u (%s) version=%llu size=%lld " |
| 208 | "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s) " |
| 209 | "mask=0x%x permitted=0x%x", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 210 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | e8194b7 | 2020-01-06 15:25:12 -0500 | [diff] [blame] | 211 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 212 | (unsigned long long)__entry->fileid, |
| 213 | __entry->fhandle, |
| 214 | __entry->type, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 215 | show_fs_dirent_type(__entry->type), |
Trond Myklebust | e8194b7 | 2020-01-06 15:25:12 -0500 | [diff] [blame] | 216 | (unsigned long long)__entry->version, |
| 217 | (long long)__entry->size, |
| 218 | __entry->cache_validity, |
| 219 | nfs_show_cache_validity(__entry->cache_validity), |
| 220 | __entry->nfsi_flags, |
| 221 | nfs_show_nfsi_flags(__entry->nfsi_flags), |
| 222 | __entry->mask, __entry->permitted |
| 223 | ) |
| 224 | ); |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 225 | |
Chuck Lever | 110cb2d | 2021-10-04 10:10:16 -0400 | [diff] [blame] | 226 | DECLARE_EVENT_CLASS(nfs_update_size_class, |
| 227 | TP_PROTO( |
| 228 | const struct inode *inode, |
| 229 | loff_t new_size |
| 230 | ), |
| 231 | |
| 232 | TP_ARGS(inode, new_size), |
| 233 | |
| 234 | TP_STRUCT__entry( |
| 235 | __field(dev_t, dev) |
| 236 | __field(u32, fhandle) |
| 237 | __field(u64, fileid) |
| 238 | __field(u64, version) |
| 239 | __field(loff_t, cur_size) |
| 240 | __field(loff_t, new_size) |
| 241 | ), |
| 242 | |
| 243 | TP_fast_assign( |
| 244 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 245 | |
| 246 | __entry->dev = inode->i_sb->s_dev; |
| 247 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
| 248 | __entry->fileid = nfsi->fileid; |
| 249 | __entry->version = inode_peek_iversion_raw(inode); |
| 250 | __entry->cur_size = i_size_read(inode); |
| 251 | __entry->new_size = new_size; |
| 252 | ), |
| 253 | |
| 254 | TP_printk( |
| 255 | "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu cursize=%lld newsize=%lld", |
| 256 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 257 | (unsigned long long)__entry->fileid, |
| 258 | __entry->fhandle, __entry->version, |
| 259 | __entry->cur_size, __entry->new_size |
| 260 | ) |
| 261 | ); |
| 262 | |
| 263 | #define DEFINE_NFS_UPDATE_SIZE_EVENT(name) \ |
| 264 | DEFINE_EVENT(nfs_update_size_class, nfs_size_##name, \ |
| 265 | TP_PROTO( \ |
| 266 | const struct inode *inode, \ |
| 267 | loff_t new_size \ |
| 268 | ), \ |
| 269 | TP_ARGS(inode, new_size)) |
| 270 | |
| 271 | DEFINE_NFS_UPDATE_SIZE_EVENT(truncate); |
| 272 | DEFINE_NFS_UPDATE_SIZE_EVENT(wcc); |
| 273 | DEFINE_NFS_UPDATE_SIZE_EVENT(update); |
| 274 | DEFINE_NFS_UPDATE_SIZE_EVENT(grow); |
| 275 | |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 276 | DECLARE_EVENT_CLASS(nfs_lookup_event, |
| 277 | TP_PROTO( |
| 278 | const struct inode *dir, |
| 279 | const struct dentry *dentry, |
| 280 | unsigned int flags |
| 281 | ), |
| 282 | |
| 283 | TP_ARGS(dir, dentry, flags), |
| 284 | |
| 285 | TP_STRUCT__entry( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 286 | __field(unsigned long, flags) |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 287 | __field(dev_t, dev) |
| 288 | __field(u64, dir) |
| 289 | __string(name, dentry->d_name.name) |
| 290 | ), |
| 291 | |
| 292 | TP_fast_assign( |
| 293 | __entry->dev = dir->i_sb->s_dev; |
| 294 | __entry->dir = NFS_FILEID(dir); |
| 295 | __entry->flags = flags; |
| 296 | __assign_str(name, dentry->d_name.name); |
| 297 | ), |
| 298 | |
| 299 | TP_printk( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 300 | "flags=0x%lx (%s) name=%02x:%02x:%llu/%s", |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 301 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 302 | show_fs_lookup_flags(__entry->flags), |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 303 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 304 | (unsigned long long)__entry->dir, |
| 305 | __get_str(name) |
| 306 | ) |
| 307 | ); |
| 308 | |
| 309 | #define DEFINE_NFS_LOOKUP_EVENT(name) \ |
| 310 | DEFINE_EVENT(nfs_lookup_event, name, \ |
| 311 | TP_PROTO( \ |
| 312 | const struct inode *dir, \ |
| 313 | const struct dentry *dentry, \ |
| 314 | unsigned int flags \ |
| 315 | ), \ |
| 316 | TP_ARGS(dir, dentry, flags)) |
| 317 | |
| 318 | DECLARE_EVENT_CLASS(nfs_lookup_event_done, |
| 319 | TP_PROTO( |
| 320 | const struct inode *dir, |
| 321 | const struct dentry *dentry, |
| 322 | unsigned int flags, |
| 323 | int error |
| 324 | ), |
| 325 | |
| 326 | TP_ARGS(dir, dentry, flags, error), |
| 327 | |
| 328 | TP_STRUCT__entry( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 329 | __field(unsigned long, error) |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 330 | __field(unsigned long, flags) |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 331 | __field(dev_t, dev) |
| 332 | __field(u64, dir) |
| 333 | __string(name, dentry->d_name.name) |
| 334 | ), |
| 335 | |
| 336 | TP_fast_assign( |
| 337 | __entry->dev = dir->i_sb->s_dev; |
| 338 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 339 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 340 | __entry->flags = flags; |
| 341 | __assign_str(name, dentry->d_name.name); |
| 342 | ), |
| 343 | |
| 344 | TP_printk( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 345 | "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 346 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 347 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 348 | show_fs_lookup_flags(__entry->flags), |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 349 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 350 | (unsigned long long)__entry->dir, |
| 351 | __get_str(name) |
| 352 | ) |
| 353 | ); |
| 354 | |
| 355 | #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \ |
| 356 | DEFINE_EVENT(nfs_lookup_event_done, name, \ |
| 357 | TP_PROTO( \ |
| 358 | const struct inode *dir, \ |
| 359 | const struct dentry *dentry, \ |
| 360 | unsigned int flags, \ |
| 361 | int error \ |
| 362 | ), \ |
| 363 | TP_ARGS(dir, dentry, flags, error)) |
| 364 | |
| 365 | DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter); |
| 366 | DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit); |
| 367 | DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter); |
| 368 | DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit); |
| 369 | |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 370 | TRACE_EVENT(nfs_atomic_open_enter, |
| 371 | TP_PROTO( |
| 372 | const struct inode *dir, |
| 373 | const struct nfs_open_context *ctx, |
| 374 | unsigned int flags |
| 375 | ), |
| 376 | |
| 377 | TP_ARGS(dir, ctx, flags), |
| 378 | |
| 379 | TP_STRUCT__entry( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 380 | __field(unsigned long, flags) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 381 | __field(unsigned long, fmode) |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 382 | __field(dev_t, dev) |
| 383 | __field(u64, dir) |
| 384 | __string(name, ctx->dentry->d_name.name) |
| 385 | ), |
| 386 | |
| 387 | TP_fast_assign( |
| 388 | __entry->dev = dir->i_sb->s_dev; |
| 389 | __entry->dir = NFS_FILEID(dir); |
| 390 | __entry->flags = flags; |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 391 | __entry->fmode = (__force unsigned long)ctx->mode; |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 392 | __assign_str(name, ctx->dentry->d_name.name); |
| 393 | ), |
| 394 | |
| 395 | TP_printk( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 396 | "flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s", |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 397 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 398 | show_fs_fcntl_open_flags(__entry->flags), |
| 399 | show_fs_fmode_flags(__entry->fmode), |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 400 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 401 | (unsigned long long)__entry->dir, |
| 402 | __get_str(name) |
| 403 | ) |
| 404 | ); |
| 405 | |
| 406 | TRACE_EVENT(nfs_atomic_open_exit, |
| 407 | TP_PROTO( |
| 408 | const struct inode *dir, |
| 409 | const struct nfs_open_context *ctx, |
| 410 | unsigned int flags, |
| 411 | int error |
| 412 | ), |
| 413 | |
| 414 | TP_ARGS(dir, ctx, flags, error), |
| 415 | |
| 416 | TP_STRUCT__entry( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 417 | __field(unsigned long, error) |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 418 | __field(unsigned long, flags) |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 419 | __field(unsigned long, fmode) |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 420 | __field(dev_t, dev) |
| 421 | __field(u64, dir) |
| 422 | __string(name, ctx->dentry->d_name.name) |
| 423 | ), |
| 424 | |
| 425 | TP_fast_assign( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 426 | __entry->error = -error; |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 427 | __entry->dev = dir->i_sb->s_dev; |
| 428 | __entry->dir = NFS_FILEID(dir); |
| 429 | __entry->flags = flags; |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 430 | __entry->fmode = (__force unsigned long)ctx->mode; |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 431 | __assign_str(name, ctx->dentry->d_name.name); |
| 432 | ), |
| 433 | |
| 434 | TP_printk( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 435 | "error=%ld (%s) flags=0x%lx (%s) fmode=%s " |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 436 | "name=%02x:%02x:%llu/%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 437 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 438 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 439 | show_fs_fcntl_open_flags(__entry->flags), |
| 440 | show_fs_fmode_flags(__entry->fmode), |
Trond Myklebust | 6e0d0be | 2013-08-20 11:26:17 -0400 | [diff] [blame] | 441 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 442 | (unsigned long long)__entry->dir, |
| 443 | __get_str(name) |
| 444 | ) |
| 445 | ); |
| 446 | |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 447 | TRACE_EVENT(nfs_create_enter, |
| 448 | TP_PROTO( |
| 449 | const struct inode *dir, |
| 450 | const struct dentry *dentry, |
| 451 | unsigned int flags |
| 452 | ), |
| 453 | |
| 454 | TP_ARGS(dir, dentry, flags), |
| 455 | |
| 456 | TP_STRUCT__entry( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 457 | __field(unsigned long, flags) |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 458 | __field(dev_t, dev) |
| 459 | __field(u64, dir) |
| 460 | __string(name, dentry->d_name.name) |
| 461 | ), |
| 462 | |
| 463 | TP_fast_assign( |
| 464 | __entry->dev = dir->i_sb->s_dev; |
| 465 | __entry->dir = NFS_FILEID(dir); |
| 466 | __entry->flags = flags; |
| 467 | __assign_str(name, dentry->d_name.name); |
| 468 | ), |
| 469 | |
| 470 | TP_printk( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 471 | "flags=0x%lx (%s) name=%02x:%02x:%llu/%s", |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 472 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 473 | show_fs_fcntl_open_flags(__entry->flags), |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 474 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 475 | (unsigned long long)__entry->dir, |
| 476 | __get_str(name) |
| 477 | ) |
| 478 | ); |
| 479 | |
| 480 | TRACE_EVENT(nfs_create_exit, |
| 481 | TP_PROTO( |
| 482 | const struct inode *dir, |
| 483 | const struct dentry *dentry, |
| 484 | unsigned int flags, |
| 485 | int error |
| 486 | ), |
| 487 | |
| 488 | TP_ARGS(dir, dentry, flags, error), |
| 489 | |
| 490 | TP_STRUCT__entry( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 491 | __field(unsigned long, error) |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 492 | __field(unsigned long, flags) |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 493 | __field(dev_t, dev) |
| 494 | __field(u64, dir) |
| 495 | __string(name, dentry->d_name.name) |
| 496 | ), |
| 497 | |
| 498 | TP_fast_assign( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 499 | __entry->error = -error; |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 500 | __entry->dev = dir->i_sb->s_dev; |
| 501 | __entry->dir = NFS_FILEID(dir); |
| 502 | __entry->flags = flags; |
| 503 | __assign_str(name, dentry->d_name.name); |
| 504 | ), |
| 505 | |
| 506 | TP_printk( |
Chuck Lever | 7d4006c | 2019-06-19 10:34:03 -0400 | [diff] [blame] | 507 | "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 508 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 509 | __entry->flags, |
Chuck Lever | 9d2d48b | 2021-10-22 16:16:56 -0400 | [diff] [blame] | 510 | show_fs_fcntl_open_flags(__entry->flags), |
Trond Myklebust | 8b0ad3d | 2013-08-21 10:53:09 -0400 | [diff] [blame] | 511 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 512 | (unsigned long long)__entry->dir, |
| 513 | __get_str(name) |
| 514 | ) |
| 515 | ); |
| 516 | |
Trond Myklebust | 1ca4238 | 2013-08-21 12:36:04 -0400 | [diff] [blame] | 517 | DECLARE_EVENT_CLASS(nfs_directory_event, |
| 518 | TP_PROTO( |
| 519 | const struct inode *dir, |
| 520 | const struct dentry *dentry |
| 521 | ), |
| 522 | |
| 523 | TP_ARGS(dir, dentry), |
| 524 | |
| 525 | TP_STRUCT__entry( |
| 526 | __field(dev_t, dev) |
| 527 | __field(u64, dir) |
| 528 | __string(name, dentry->d_name.name) |
| 529 | ), |
| 530 | |
| 531 | TP_fast_assign( |
| 532 | __entry->dev = dir->i_sb->s_dev; |
| 533 | __entry->dir = NFS_FILEID(dir); |
| 534 | __assign_str(name, dentry->d_name.name); |
| 535 | ), |
| 536 | |
| 537 | TP_printk( |
| 538 | "name=%02x:%02x:%llu/%s", |
| 539 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 540 | (unsigned long long)__entry->dir, |
| 541 | __get_str(name) |
| 542 | ) |
| 543 | ); |
| 544 | |
| 545 | #define DEFINE_NFS_DIRECTORY_EVENT(name) \ |
| 546 | DEFINE_EVENT(nfs_directory_event, name, \ |
| 547 | TP_PROTO( \ |
| 548 | const struct inode *dir, \ |
| 549 | const struct dentry *dentry \ |
| 550 | ), \ |
| 551 | TP_ARGS(dir, dentry)) |
| 552 | |
| 553 | DECLARE_EVENT_CLASS(nfs_directory_event_done, |
| 554 | TP_PROTO( |
| 555 | const struct inode *dir, |
| 556 | const struct dentry *dentry, |
| 557 | int error |
| 558 | ), |
| 559 | |
| 560 | TP_ARGS(dir, dentry, error), |
| 561 | |
| 562 | TP_STRUCT__entry( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 563 | __field(unsigned long, error) |
Trond Myklebust | 1ca4238 | 2013-08-21 12:36:04 -0400 | [diff] [blame] | 564 | __field(dev_t, dev) |
| 565 | __field(u64, dir) |
| 566 | __string(name, dentry->d_name.name) |
| 567 | ), |
| 568 | |
| 569 | TP_fast_assign( |
| 570 | __entry->dev = dir->i_sb->s_dev; |
| 571 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 572 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 1ca4238 | 2013-08-21 12:36:04 -0400 | [diff] [blame] | 573 | __assign_str(name, dentry->d_name.name); |
| 574 | ), |
| 575 | |
| 576 | TP_printk( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 577 | "error=%ld (%s) name=%02x:%02x:%llu/%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 578 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | 1ca4238 | 2013-08-21 12:36:04 -0400 | [diff] [blame] | 579 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 580 | (unsigned long long)__entry->dir, |
| 581 | __get_str(name) |
| 582 | ) |
| 583 | ); |
| 584 | |
| 585 | #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \ |
| 586 | DEFINE_EVENT(nfs_directory_event_done, name, \ |
| 587 | TP_PROTO( \ |
| 588 | const struct inode *dir, \ |
| 589 | const struct dentry *dentry, \ |
| 590 | int error \ |
| 591 | ), \ |
| 592 | TP_ARGS(dir, dentry, error)) |
| 593 | |
| 594 | DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter); |
| 595 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit); |
| 596 | DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter); |
| 597 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit); |
| 598 | DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter); |
| 599 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit); |
| 600 | DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter); |
| 601 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit); |
| 602 | DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter); |
| 603 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit); |
| 604 | DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter); |
| 605 | DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit); |
| 606 | |
Trond Myklebust | 1fd1085 | 2013-08-21 13:54:44 -0400 | [diff] [blame] | 607 | TRACE_EVENT(nfs_link_enter, |
| 608 | TP_PROTO( |
| 609 | const struct inode *inode, |
| 610 | const struct inode *dir, |
| 611 | const struct dentry *dentry |
| 612 | ), |
| 613 | |
| 614 | TP_ARGS(inode, dir, dentry), |
| 615 | |
| 616 | TP_STRUCT__entry( |
| 617 | __field(dev_t, dev) |
| 618 | __field(u64, fileid) |
| 619 | __field(u64, dir) |
| 620 | __string(name, dentry->d_name.name) |
| 621 | ), |
| 622 | |
| 623 | TP_fast_assign( |
| 624 | __entry->dev = inode->i_sb->s_dev; |
| 625 | __entry->fileid = NFS_FILEID(inode); |
| 626 | __entry->dir = NFS_FILEID(dir); |
| 627 | __assign_str(name, dentry->d_name.name); |
| 628 | ), |
| 629 | |
| 630 | TP_printk( |
| 631 | "fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s", |
| 632 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 633 | __entry->fileid, |
| 634 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 635 | (unsigned long long)__entry->dir, |
| 636 | __get_str(name) |
| 637 | ) |
| 638 | ); |
| 639 | |
| 640 | TRACE_EVENT(nfs_link_exit, |
| 641 | TP_PROTO( |
| 642 | const struct inode *inode, |
| 643 | const struct inode *dir, |
| 644 | const struct dentry *dentry, |
| 645 | int error |
| 646 | ), |
| 647 | |
| 648 | TP_ARGS(inode, dir, dentry, error), |
| 649 | |
| 650 | TP_STRUCT__entry( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 651 | __field(unsigned long, error) |
Trond Myklebust | 1fd1085 | 2013-08-21 13:54:44 -0400 | [diff] [blame] | 652 | __field(dev_t, dev) |
| 653 | __field(u64, fileid) |
| 654 | __field(u64, dir) |
| 655 | __string(name, dentry->d_name.name) |
| 656 | ), |
| 657 | |
| 658 | TP_fast_assign( |
| 659 | __entry->dev = inode->i_sb->s_dev; |
| 660 | __entry->fileid = NFS_FILEID(inode); |
| 661 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 662 | __entry->error = error < 0 ? -error : 0; |
Trond Myklebust | 1fd1085 | 2013-08-21 13:54:44 -0400 | [diff] [blame] | 663 | __assign_str(name, dentry->d_name.name); |
| 664 | ), |
| 665 | |
| 666 | TP_printk( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 667 | "error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 668 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | 1fd1085 | 2013-08-21 13:54:44 -0400 | [diff] [blame] | 669 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 670 | __entry->fileid, |
| 671 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 672 | (unsigned long long)__entry->dir, |
| 673 | __get_str(name) |
| 674 | ) |
| 675 | ); |
| 676 | |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 677 | DECLARE_EVENT_CLASS(nfs_rename_event, |
| 678 | TP_PROTO( |
| 679 | const struct inode *old_dir, |
| 680 | const struct dentry *old_dentry, |
| 681 | const struct inode *new_dir, |
| 682 | const struct dentry *new_dentry |
| 683 | ), |
| 684 | |
| 685 | TP_ARGS(old_dir, old_dentry, new_dir, new_dentry), |
| 686 | |
| 687 | TP_STRUCT__entry( |
| 688 | __field(dev_t, dev) |
| 689 | __field(u64, old_dir) |
| 690 | __field(u64, new_dir) |
| 691 | __string(old_name, old_dentry->d_name.name) |
| 692 | __string(new_name, new_dentry->d_name.name) |
| 693 | ), |
| 694 | |
| 695 | TP_fast_assign( |
| 696 | __entry->dev = old_dir->i_sb->s_dev; |
| 697 | __entry->old_dir = NFS_FILEID(old_dir); |
| 698 | __entry->new_dir = NFS_FILEID(new_dir); |
| 699 | __assign_str(old_name, old_dentry->d_name.name); |
| 700 | __assign_str(new_name, new_dentry->d_name.name); |
| 701 | ), |
| 702 | |
| 703 | TP_printk( |
| 704 | "old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s", |
| 705 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 706 | (unsigned long long)__entry->old_dir, |
| 707 | __get_str(old_name), |
| 708 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 709 | (unsigned long long)__entry->new_dir, |
| 710 | __get_str(new_name) |
| 711 | ) |
| 712 | ); |
| 713 | #define DEFINE_NFS_RENAME_EVENT(name) \ |
| 714 | DEFINE_EVENT(nfs_rename_event, name, \ |
| 715 | TP_PROTO( \ |
| 716 | const struct inode *old_dir, \ |
| 717 | const struct dentry *old_dentry, \ |
| 718 | const struct inode *new_dir, \ |
| 719 | const struct dentry *new_dentry \ |
| 720 | ), \ |
| 721 | TP_ARGS(old_dir, old_dentry, new_dir, new_dentry)) |
| 722 | |
| 723 | DECLARE_EVENT_CLASS(nfs_rename_event_done, |
| 724 | TP_PROTO( |
| 725 | const struct inode *old_dir, |
| 726 | const struct dentry *old_dentry, |
| 727 | const struct inode *new_dir, |
| 728 | const struct dentry *new_dentry, |
| 729 | int error |
| 730 | ), |
| 731 | |
| 732 | TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, error), |
| 733 | |
| 734 | TP_STRUCT__entry( |
| 735 | __field(dev_t, dev) |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 736 | __field(unsigned long, error) |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 737 | __field(u64, old_dir) |
| 738 | __string(old_name, old_dentry->d_name.name) |
| 739 | __field(u64, new_dir) |
| 740 | __string(new_name, new_dentry->d_name.name) |
| 741 | ), |
| 742 | |
| 743 | TP_fast_assign( |
| 744 | __entry->dev = old_dir->i_sb->s_dev; |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 745 | __entry->error = -error; |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 746 | __entry->old_dir = NFS_FILEID(old_dir); |
| 747 | __entry->new_dir = NFS_FILEID(new_dir); |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 748 | __assign_str(old_name, old_dentry->d_name.name); |
| 749 | __assign_str(new_name, new_dentry->d_name.name); |
| 750 | ), |
| 751 | |
| 752 | TP_printk( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 753 | "error=%ld (%s) old_name=%02x:%02x:%llu/%s " |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 754 | "new_name=%02x:%02x:%llu/%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 755 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 756 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 757 | (unsigned long long)__entry->old_dir, |
| 758 | __get_str(old_name), |
| 759 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 760 | (unsigned long long)__entry->new_dir, |
| 761 | __get_str(new_name) |
| 762 | ) |
| 763 | ); |
| 764 | #define DEFINE_NFS_RENAME_EVENT_DONE(name) \ |
| 765 | DEFINE_EVENT(nfs_rename_event_done, name, \ |
| 766 | TP_PROTO( \ |
| 767 | const struct inode *old_dir, \ |
| 768 | const struct dentry *old_dentry, \ |
| 769 | const struct inode *new_dir, \ |
| 770 | const struct dentry *new_dentry, \ |
| 771 | int error \ |
| 772 | ), \ |
| 773 | TP_ARGS(old_dir, old_dentry, new_dir, \ |
| 774 | new_dentry, error)) |
| 775 | |
| 776 | DEFINE_NFS_RENAME_EVENT(nfs_rename_enter); |
| 777 | DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit); |
| 778 | |
| 779 | DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename); |
| 780 | |
| 781 | TRACE_EVENT(nfs_sillyrename_unlink, |
| 782 | TP_PROTO( |
| 783 | const struct nfs_unlinkdata *data, |
| 784 | int error |
| 785 | ), |
| 786 | |
| 787 | TP_ARGS(data, error), |
| 788 | |
| 789 | TP_STRUCT__entry( |
| 790 | __field(dev_t, dev) |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 791 | __field(unsigned long, error) |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 792 | __field(u64, dir) |
| 793 | __dynamic_array(char, name, data->args.name.len + 1) |
| 794 | ), |
| 795 | |
| 796 | TP_fast_assign( |
Al Viro | 884be17 | 2016-04-28 23:56:31 -0400 | [diff] [blame] | 797 | struct inode *dir = d_inode(data->dentry->d_parent); |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 798 | size_t len = data->args.name.len; |
| 799 | __entry->dev = dir->i_sb->s_dev; |
| 800 | __entry->dir = NFS_FILEID(dir); |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 801 | __entry->error = -error; |
Daniel Bristot de Oliveira | 752d596 | 2016-07-01 20:44:36 -0300 | [diff] [blame] | 802 | memcpy(__get_str(name), |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 803 | data->args.name.name, len); |
Daniel Bristot de Oliveira | 752d596 | 2016-07-01 20:44:36 -0300 | [diff] [blame] | 804 | __get_str(name)[len] = 0; |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 805 | ), |
| 806 | |
| 807 | TP_printk( |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 808 | "error=%ld (%s) name=%02x:%02x:%llu/%s", |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 809 | -__entry->error, show_nfs_status(__entry->error), |
Trond Myklebust | 70ded20 | 2013-08-21 12:08:45 -0400 | [diff] [blame] | 810 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 811 | (unsigned long long)__entry->dir, |
| 812 | __get_str(name) |
| 813 | ) |
| 814 | ); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 815 | |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 816 | TRACE_EVENT(nfs_aop_readpage, |
| 817 | TP_PROTO( |
| 818 | const struct inode *inode, |
| 819 | struct page *page |
| 820 | ), |
| 821 | |
| 822 | TP_ARGS(inode, page), |
| 823 | |
| 824 | TP_STRUCT__entry( |
| 825 | __field(dev_t, dev) |
| 826 | __field(u32, fhandle) |
| 827 | __field(u64, fileid) |
| 828 | __field(u64, version) |
| 829 | __field(loff_t, offset) |
| 830 | ), |
| 831 | |
| 832 | TP_fast_assign( |
| 833 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 834 | |
| 835 | __entry->dev = inode->i_sb->s_dev; |
| 836 | __entry->fileid = nfsi->fileid; |
| 837 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
| 838 | __entry->version = inode_peek_iversion_raw(inode); |
| 839 | __entry->offset = page_index(page) << PAGE_SHIFT; |
| 840 | ), |
| 841 | |
| 842 | TP_printk( |
| 843 | "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu offset=%lld", |
| 844 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 845 | (unsigned long long)__entry->fileid, |
| 846 | __entry->fhandle, __entry->version, |
| 847 | __entry->offset |
| 848 | ) |
| 849 | ); |
| 850 | |
| 851 | TRACE_EVENT(nfs_aop_readpage_done, |
| 852 | TP_PROTO( |
| 853 | const struct inode *inode, |
| 854 | struct page *page, |
| 855 | int ret |
| 856 | ), |
| 857 | |
| 858 | TP_ARGS(inode, page, ret), |
| 859 | |
| 860 | TP_STRUCT__entry( |
| 861 | __field(dev_t, dev) |
| 862 | __field(u32, fhandle) |
| 863 | __field(int, ret) |
| 864 | __field(u64, fileid) |
| 865 | __field(u64, version) |
| 866 | __field(loff_t, offset) |
| 867 | ), |
| 868 | |
| 869 | TP_fast_assign( |
| 870 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 871 | |
| 872 | __entry->dev = inode->i_sb->s_dev; |
| 873 | __entry->fileid = nfsi->fileid; |
| 874 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
| 875 | __entry->version = inode_peek_iversion_raw(inode); |
| 876 | __entry->offset = page_index(page) << PAGE_SHIFT; |
| 877 | __entry->ret = ret; |
| 878 | ), |
| 879 | |
| 880 | TP_printk( |
| 881 | "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu offset=%lld ret=%d", |
| 882 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 883 | (unsigned long long)__entry->fileid, |
| 884 | __entry->fhandle, __entry->version, |
| 885 | __entry->offset, __entry->ret |
| 886 | ) |
| 887 | ); |
| 888 | |
| 889 | TRACE_EVENT(nfs_aop_readahead, |
| 890 | TP_PROTO( |
| 891 | const struct inode *inode, |
Dave Wysochanski | edfa0b1 | 2021-11-02 15:51:55 -0400 | [diff] [blame] | 892 | struct page *page, |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 893 | unsigned int nr_pages |
| 894 | ), |
| 895 | |
Dave Wysochanski | edfa0b1 | 2021-11-02 15:51:55 -0400 | [diff] [blame] | 896 | TP_ARGS(inode, page, nr_pages), |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 897 | |
| 898 | TP_STRUCT__entry( |
| 899 | __field(dev_t, dev) |
| 900 | __field(u32, fhandle) |
| 901 | __field(u64, fileid) |
| 902 | __field(u64, version) |
Dave Wysochanski | edfa0b1 | 2021-11-02 15:51:55 -0400 | [diff] [blame] | 903 | __field(loff_t, offset) |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 904 | __field(unsigned int, nr_pages) |
| 905 | ), |
| 906 | |
| 907 | TP_fast_assign( |
| 908 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 909 | |
| 910 | __entry->dev = inode->i_sb->s_dev; |
| 911 | __entry->fileid = nfsi->fileid; |
| 912 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
| 913 | __entry->version = inode_peek_iversion_raw(inode); |
Dave Wysochanski | edfa0b1 | 2021-11-02 15:51:55 -0400 | [diff] [blame] | 914 | __entry->offset = page_index(page) << PAGE_SHIFT; |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 915 | __entry->nr_pages = nr_pages; |
| 916 | ), |
| 917 | |
| 918 | TP_printk( |
Dave Wysochanski | edfa0b1 | 2021-11-02 15:51:55 -0400 | [diff] [blame] | 919 | "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu offset=%lld nr_pages=%u", |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 920 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 921 | (unsigned long long)__entry->fileid, |
| 922 | __entry->fhandle, __entry->version, |
Dave Wysochanski | edfa0b1 | 2021-11-02 15:51:55 -0400 | [diff] [blame] | 923 | __entry->offset, __entry->nr_pages |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 924 | ) |
| 925 | ); |
| 926 | |
| 927 | TRACE_EVENT(nfs_aop_readahead_done, |
| 928 | TP_PROTO( |
| 929 | const struct inode *inode, |
| 930 | unsigned int nr_pages, |
| 931 | int ret |
| 932 | ), |
| 933 | |
| 934 | TP_ARGS(inode, nr_pages, ret), |
| 935 | |
| 936 | TP_STRUCT__entry( |
| 937 | __field(dev_t, dev) |
| 938 | __field(u32, fhandle) |
| 939 | __field(int, ret) |
| 940 | __field(u64, fileid) |
| 941 | __field(u64, version) |
Dave Wysochanski | edfa0b1 | 2021-11-02 15:51:55 -0400 | [diff] [blame] | 942 | __field(loff_t, offset) |
Chuck Lever | d9f8774 | 2021-10-16 18:02:51 -0400 | [diff] [blame] | 943 | __field(unsigned int, nr_pages) |
| 944 | ), |
| 945 | |
| 946 | TP_fast_assign( |
| 947 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 948 | |
| 949 | __entry->dev = inode->i_sb->s_dev; |
| 950 | __entry->fileid = nfsi->fileid; |
| 951 | __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); |
| 952 | __entry->version = inode_peek_iversion_raw(inode); |
| 953 | __entry->nr_pages = nr_pages; |
| 954 | __entry->ret = ret; |
| 955 | ), |
| 956 | |
| 957 | TP_printk( |
| 958 | "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu nr_pages=%u ret=%d", |
| 959 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 960 | (unsigned long long)__entry->fileid, |
| 961 | __entry->fhandle, __entry->version, |
| 962 | __entry->nr_pages, __entry->ret |
| 963 | ) |
| 964 | ); |
| 965 | |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 966 | TRACE_EVENT(nfs_initiate_read, |
| 967 | TP_PROTO( |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 968 | const struct nfs_pgio_header *hdr |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 969 | ), |
| 970 | |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 971 | TP_ARGS(hdr), |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 972 | |
| 973 | TP_STRUCT__entry( |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 974 | __field(dev_t, dev) |
| 975 | __field(u32, fhandle) |
| 976 | __field(u64, fileid) |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 977 | __field(loff_t, offset) |
| 978 | __field(u32, count) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 979 | ), |
| 980 | |
| 981 | TP_fast_assign( |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 982 | const struct inode *inode = hdr->inode; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 983 | const struct nfs_inode *nfsi = NFS_I(inode); |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 984 | const struct nfs_fh *fh = hdr->args.fh ? |
| 985 | hdr->args.fh : &nfsi->fh; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 986 | |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 987 | __entry->offset = hdr->args.offset; |
| 988 | __entry->count = hdr->args.count; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 989 | __entry->dev = inode->i_sb->s_dev; |
| 990 | __entry->fileid = nfsi->fileid; |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 991 | __entry->fhandle = nfs_fhandle_hash(fh); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 992 | ), |
| 993 | |
| 994 | TP_printk( |
| 995 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 996 | "offset=%lld count=%u", |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 997 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 998 | (unsigned long long)__entry->fileid, |
| 999 | __entry->fhandle, |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1000 | (long long)__entry->offset, __entry->count |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1001 | ) |
| 1002 | ); |
| 1003 | |
| 1004 | TRACE_EVENT(nfs_readpage_done, |
| 1005 | TP_PROTO( |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1006 | const struct rpc_task *task, |
| 1007 | const struct nfs_pgio_header *hdr |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1008 | ), |
| 1009 | |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1010 | TP_ARGS(task, hdr), |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1011 | |
| 1012 | TP_STRUCT__entry( |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1013 | __field(dev_t, dev) |
| 1014 | __field(u32, fhandle) |
| 1015 | __field(u64, fileid) |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1016 | __field(loff_t, offset) |
| 1017 | __field(u32, arg_count) |
| 1018 | __field(u32, res_count) |
| 1019 | __field(bool, eof) |
| 1020 | __field(int, status) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1021 | ), |
| 1022 | |
| 1023 | TP_fast_assign( |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1024 | const struct inode *inode = hdr->inode; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1025 | const struct nfs_inode *nfsi = NFS_I(inode); |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1026 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1027 | hdr->args.fh : &nfsi->fh; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1028 | |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1029 | __entry->status = task->tk_status; |
| 1030 | __entry->offset = hdr->args.offset; |
| 1031 | __entry->arg_count = hdr->args.count; |
| 1032 | __entry->res_count = hdr->res.count; |
| 1033 | __entry->eof = hdr->res.eof; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1034 | __entry->dev = inode->i_sb->s_dev; |
| 1035 | __entry->fileid = nfsi->fileid; |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1036 | __entry->fhandle = nfs_fhandle_hash(fh); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1037 | ), |
| 1038 | |
| 1039 | TP_printk( |
| 1040 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1041 | "offset=%lld count=%u res=%u status=%d%s", |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1042 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1043 | (unsigned long long)__entry->fileid, |
| 1044 | __entry->fhandle, |
Trond Myklebust | 2343172 | 2020-01-06 15:25:08 -0500 | [diff] [blame] | 1045 | (long long)__entry->offset, __entry->arg_count, |
| 1046 | __entry->res_count, __entry->status, |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1047 | __entry->eof ? " eof" : "" |
| 1048 | ) |
| 1049 | ); |
| 1050 | |
Chuck Lever | fd2b612 | 2020-05-12 17:14:05 -0400 | [diff] [blame] | 1051 | TRACE_EVENT(nfs_readpage_short, |
| 1052 | TP_PROTO( |
| 1053 | const struct rpc_task *task, |
| 1054 | const struct nfs_pgio_header *hdr |
| 1055 | ), |
| 1056 | |
| 1057 | TP_ARGS(task, hdr), |
| 1058 | |
| 1059 | TP_STRUCT__entry( |
| 1060 | __field(dev_t, dev) |
| 1061 | __field(u32, fhandle) |
| 1062 | __field(u64, fileid) |
| 1063 | __field(loff_t, offset) |
| 1064 | __field(u32, arg_count) |
| 1065 | __field(u32, res_count) |
| 1066 | __field(bool, eof) |
| 1067 | __field(int, status) |
| 1068 | ), |
| 1069 | |
| 1070 | TP_fast_assign( |
| 1071 | const struct inode *inode = hdr->inode; |
| 1072 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1073 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1074 | hdr->args.fh : &nfsi->fh; |
| 1075 | |
| 1076 | __entry->status = task->tk_status; |
| 1077 | __entry->offset = hdr->args.offset; |
| 1078 | __entry->arg_count = hdr->args.count; |
| 1079 | __entry->res_count = hdr->res.count; |
| 1080 | __entry->eof = hdr->res.eof; |
| 1081 | __entry->dev = inode->i_sb->s_dev; |
| 1082 | __entry->fileid = nfsi->fileid; |
| 1083 | __entry->fhandle = nfs_fhandle_hash(fh); |
| 1084 | ), |
| 1085 | |
| 1086 | TP_printk( |
| 1087 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1088 | "offset=%lld count=%u res=%u status=%d%s", |
| 1089 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1090 | (unsigned long long)__entry->fileid, |
| 1091 | __entry->fhandle, |
| 1092 | (long long)__entry->offset, __entry->arg_count, |
| 1093 | __entry->res_count, __entry->status, |
| 1094 | __entry->eof ? " eof" : "" |
| 1095 | ) |
| 1096 | ); |
| 1097 | |
Chuck Lever | cd2ed9b | 2020-05-12 17:14:11 -0400 | [diff] [blame] | 1098 | TRACE_EVENT(nfs_pgio_error, |
| 1099 | TP_PROTO( |
| 1100 | const struct nfs_pgio_header *hdr, |
| 1101 | int error, |
| 1102 | loff_t pos |
| 1103 | ), |
| 1104 | |
| 1105 | TP_ARGS(hdr, error, pos), |
| 1106 | |
| 1107 | TP_STRUCT__entry( |
| 1108 | __field(dev_t, dev) |
| 1109 | __field(u32, fhandle) |
| 1110 | __field(u64, fileid) |
| 1111 | __field(loff_t, offset) |
| 1112 | __field(u32, arg_count) |
| 1113 | __field(u32, res_count) |
| 1114 | __field(loff_t, pos) |
| 1115 | __field(int, status) |
| 1116 | ), |
| 1117 | |
| 1118 | TP_fast_assign( |
| 1119 | const struct inode *inode = hdr->inode; |
| 1120 | const struct nfs_inode *nfsi = NFS_I(inode); |
| 1121 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1122 | hdr->args.fh : &nfsi->fh; |
| 1123 | |
| 1124 | __entry->status = error; |
| 1125 | __entry->offset = hdr->args.offset; |
| 1126 | __entry->arg_count = hdr->args.count; |
| 1127 | __entry->res_count = hdr->res.count; |
| 1128 | __entry->dev = inode->i_sb->s_dev; |
| 1129 | __entry->fileid = nfsi->fileid; |
| 1130 | __entry->fhandle = nfs_fhandle_hash(fh); |
| 1131 | ), |
| 1132 | |
| 1133 | TP_printk("fileid=%02x:%02x:%llu fhandle=0x%08x " |
| 1134 | "offset=%lld count=%u res=%u pos=%llu status=%d", |
| 1135 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1136 | (unsigned long long)__entry->fileid, __entry->fhandle, |
| 1137 | (long long)__entry->offset, __entry->arg_count, __entry->res_count, |
| 1138 | __entry->pos, __entry->status |
| 1139 | ) |
| 1140 | ); |
| 1141 | |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1142 | TRACE_EVENT(nfs_initiate_write, |
| 1143 | TP_PROTO( |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1144 | const struct nfs_pgio_header *hdr |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1145 | ), |
| 1146 | |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1147 | TP_ARGS(hdr), |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1148 | |
| 1149 | TP_STRUCT__entry( |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1150 | __field(dev_t, dev) |
| 1151 | __field(u32, fhandle) |
| 1152 | __field(u64, fileid) |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1153 | __field(loff_t, offset) |
| 1154 | __field(u32, count) |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1155 | __field(unsigned long, stable) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1156 | ), |
| 1157 | |
| 1158 | TP_fast_assign( |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1159 | const struct inode *inode = hdr->inode; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1160 | const struct nfs_inode *nfsi = NFS_I(inode); |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1161 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1162 | hdr->args.fh : &nfsi->fh; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1163 | |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1164 | __entry->offset = hdr->args.offset; |
| 1165 | __entry->count = hdr->args.count; |
| 1166 | __entry->stable = hdr->args.stable; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1167 | __entry->dev = inode->i_sb->s_dev; |
| 1168 | __entry->fileid = nfsi->fileid; |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1169 | __entry->fhandle = nfs_fhandle_hash(fh); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1170 | ), |
| 1171 | |
| 1172 | TP_printk( |
| 1173 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1174 | "offset=%lld count=%u stable=%s", |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1175 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1176 | (unsigned long long)__entry->fileid, |
| 1177 | __entry->fhandle, |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1178 | (long long)__entry->offset, __entry->count, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1179 | show_nfs_stable_how(__entry->stable) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1180 | ) |
| 1181 | ); |
| 1182 | |
| 1183 | TRACE_EVENT(nfs_writeback_done, |
| 1184 | TP_PROTO( |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1185 | const struct rpc_task *task, |
| 1186 | const struct nfs_pgio_header *hdr |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1187 | ), |
| 1188 | |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1189 | TP_ARGS(task, hdr), |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1190 | |
| 1191 | TP_STRUCT__entry( |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1192 | __field(dev_t, dev) |
| 1193 | __field(u32, fhandle) |
| 1194 | __field(u64, fileid) |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1195 | __field(loff_t, offset) |
| 1196 | __field(u32, arg_count) |
| 1197 | __field(u32, res_count) |
| 1198 | __field(int, status) |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1199 | __field(unsigned long, stable) |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1200 | __array(char, verifier, NFS4_VERIFIER_SIZE) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1201 | ), |
| 1202 | |
| 1203 | TP_fast_assign( |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1204 | const struct inode *inode = hdr->inode; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1205 | const struct nfs_inode *nfsi = NFS_I(inode); |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1206 | const struct nfs_fh *fh = hdr->args.fh ? |
| 1207 | hdr->args.fh : &nfsi->fh; |
| 1208 | const struct nfs_writeverf *verf = hdr->res.verf; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1209 | |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1210 | __entry->status = task->tk_status; |
| 1211 | __entry->offset = hdr->args.offset; |
| 1212 | __entry->arg_count = hdr->args.count; |
| 1213 | __entry->res_count = hdr->res.count; |
| 1214 | __entry->stable = verf->committed; |
| 1215 | memcpy(__entry->verifier, |
| 1216 | &verf->verifier, |
| 1217 | NFS4_VERIFIER_SIZE); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1218 | __entry->dev = inode->i_sb->s_dev; |
| 1219 | __entry->fileid = nfsi->fileid; |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1220 | __entry->fhandle = nfs_fhandle_hash(fh); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1221 | ), |
| 1222 | |
| 1223 | TP_printk( |
| 1224 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1225 | "offset=%lld count=%u res=%u status=%d stable=%s " |
| 1226 | "verifier=%s", |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1227 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1228 | (unsigned long long)__entry->fileid, |
| 1229 | __entry->fhandle, |
Trond Myklebust | 5bb2a7c | 2020-01-06 15:25:09 -0500 | [diff] [blame] | 1230 | (long long)__entry->offset, __entry->arg_count, |
| 1231 | __entry->res_count, __entry->status, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1232 | show_nfs_stable_how(__entry->stable), |
| 1233 | show_nfs4_verifier(__entry->verifier) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1234 | ) |
| 1235 | ); |
| 1236 | |
Chuck Lever | 861e167 | 2019-12-23 10:28:33 -0500 | [diff] [blame] | 1237 | DECLARE_EVENT_CLASS(nfs_page_error_class, |
| 1238 | TP_PROTO( |
| 1239 | const struct nfs_page *req, |
| 1240 | int error |
| 1241 | ), |
| 1242 | |
| 1243 | TP_ARGS(req, error), |
| 1244 | |
| 1245 | TP_STRUCT__entry( |
| 1246 | __field(const void *, req) |
| 1247 | __field(pgoff_t, index) |
| 1248 | __field(unsigned int, offset) |
| 1249 | __field(unsigned int, pgbase) |
| 1250 | __field(unsigned int, bytes) |
| 1251 | __field(int, error) |
| 1252 | ), |
| 1253 | |
| 1254 | TP_fast_assign( |
| 1255 | __entry->req = req; |
| 1256 | __entry->index = req->wb_index; |
| 1257 | __entry->offset = req->wb_offset; |
| 1258 | __entry->pgbase = req->wb_pgbase; |
| 1259 | __entry->bytes = req->wb_bytes; |
| 1260 | __entry->error = error; |
| 1261 | ), |
| 1262 | |
| 1263 | TP_printk( |
| 1264 | "req=%p index=%lu offset=%u pgbase=%u bytes=%u error=%d", |
| 1265 | __entry->req, __entry->index, __entry->offset, |
| 1266 | __entry->pgbase, __entry->bytes, __entry->error |
| 1267 | ) |
| 1268 | ); |
| 1269 | |
| 1270 | #define DEFINE_NFS_PAGEERR_EVENT(name) \ |
| 1271 | DEFINE_EVENT(nfs_page_error_class, name, \ |
| 1272 | TP_PROTO( \ |
| 1273 | const struct nfs_page *req, \ |
| 1274 | int error \ |
| 1275 | ), \ |
| 1276 | TP_ARGS(req, error)) |
| 1277 | |
| 1278 | DEFINE_NFS_PAGEERR_EVENT(nfs_write_error); |
| 1279 | DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error); |
| 1280 | DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error); |
| 1281 | |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1282 | TRACE_EVENT(nfs_initiate_commit, |
| 1283 | TP_PROTO( |
| 1284 | const struct nfs_commit_data *data |
| 1285 | ), |
| 1286 | |
| 1287 | TP_ARGS(data), |
| 1288 | |
| 1289 | TP_STRUCT__entry( |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1290 | __field(dev_t, dev) |
| 1291 | __field(u32, fhandle) |
| 1292 | __field(u64, fileid) |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1293 | __field(loff_t, offset) |
| 1294 | __field(u32, count) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1295 | ), |
| 1296 | |
| 1297 | TP_fast_assign( |
| 1298 | const struct inode *inode = data->inode; |
| 1299 | const struct nfs_inode *nfsi = NFS_I(inode); |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1300 | const struct nfs_fh *fh = data->args.fh ? |
| 1301 | data->args.fh : &nfsi->fh; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1302 | |
| 1303 | __entry->offset = data->args.offset; |
| 1304 | __entry->count = data->args.count; |
| 1305 | __entry->dev = inode->i_sb->s_dev; |
| 1306 | __entry->fileid = nfsi->fileid; |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1307 | __entry->fhandle = nfs_fhandle_hash(fh); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1308 | ), |
| 1309 | |
| 1310 | TP_printk( |
| 1311 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1312 | "offset=%lld count=%u", |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1313 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1314 | (unsigned long long)__entry->fileid, |
| 1315 | __entry->fhandle, |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1316 | (long long)__entry->offset, __entry->count |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1317 | ) |
| 1318 | ); |
| 1319 | |
| 1320 | TRACE_EVENT(nfs_commit_done, |
| 1321 | TP_PROTO( |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1322 | const struct rpc_task *task, |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1323 | const struct nfs_commit_data *data |
| 1324 | ), |
| 1325 | |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1326 | TP_ARGS(task, data), |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1327 | |
| 1328 | TP_STRUCT__entry( |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1329 | __field(dev_t, dev) |
| 1330 | __field(u32, fhandle) |
| 1331 | __field(u64, fileid) |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1332 | __field(loff_t, offset) |
| 1333 | __field(int, status) |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1334 | __field(unsigned long, stable) |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1335 | __array(char, verifier, NFS4_VERIFIER_SIZE) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1336 | ), |
| 1337 | |
| 1338 | TP_fast_assign( |
| 1339 | const struct inode *inode = data->inode; |
| 1340 | const struct nfs_inode *nfsi = NFS_I(inode); |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1341 | const struct nfs_fh *fh = data->args.fh ? |
| 1342 | data->args.fh : &nfsi->fh; |
| 1343 | const struct nfs_writeverf *verf = data->res.verf; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1344 | |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1345 | __entry->status = task->tk_status; |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1346 | __entry->offset = data->args.offset; |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1347 | __entry->stable = verf->committed; |
| 1348 | memcpy(__entry->verifier, |
| 1349 | &verf->verifier, |
| 1350 | NFS4_VERIFIER_SIZE); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1351 | __entry->dev = inode->i_sb->s_dev; |
| 1352 | __entry->fileid = nfsi->fileid; |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1353 | __entry->fhandle = nfs_fhandle_hash(fh); |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1354 | ), |
| 1355 | |
| 1356 | TP_printk( |
| 1357 | "fileid=%02x:%02x:%llu fhandle=0x%08x " |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1358 | "offset=%lld status=%d stable=%s verifier=%s", |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1359 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1360 | (unsigned long long)__entry->fileid, |
| 1361 | __entry->fhandle, |
Trond Myklebust | 7bdd297 | 2020-01-06 15:25:10 -0500 | [diff] [blame] | 1362 | (long long)__entry->offset, __entry->status, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1363 | show_nfs_stable_how(__entry->stable), |
| 1364 | show_nfs4_verifier(__entry->verifier) |
Chuck Lever | 8224b27 | 2017-08-21 15:00:49 -0400 | [diff] [blame] | 1365 | ) |
| 1366 | ); |
| 1367 | |
Trond Myklebust | 43622ea | 2019-11-01 15:33:55 -0400 | [diff] [blame] | 1368 | TRACE_EVENT(nfs_fh_to_dentry, |
| 1369 | TP_PROTO( |
| 1370 | const struct super_block *sb, |
| 1371 | const struct nfs_fh *fh, |
| 1372 | u64 fileid, |
| 1373 | int error |
| 1374 | ), |
| 1375 | |
| 1376 | TP_ARGS(sb, fh, fileid, error), |
| 1377 | |
| 1378 | TP_STRUCT__entry( |
| 1379 | __field(int, error) |
| 1380 | __field(dev_t, dev) |
| 1381 | __field(u32, fhandle) |
| 1382 | __field(u64, fileid) |
| 1383 | ), |
| 1384 | |
| 1385 | TP_fast_assign( |
| 1386 | __entry->error = error; |
| 1387 | __entry->dev = sb->s_dev; |
| 1388 | __entry->fileid = fileid; |
| 1389 | __entry->fhandle = nfs_fhandle_hash(fh); |
| 1390 | ), |
| 1391 | |
| 1392 | TP_printk( |
| 1393 | "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ", |
| 1394 | __entry->error, |
| 1395 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1396 | (unsigned long long)__entry->fileid, |
| 1397 | __entry->fhandle |
| 1398 | ) |
| 1399 | ); |
| 1400 | |
Trond Myklebust | 3d66bae | 2021-04-01 13:54:19 -0400 | [diff] [blame] | 1401 | DECLARE_EVENT_CLASS(nfs_xdr_event, |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1402 | TP_PROTO( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 1403 | const struct xdr_stream *xdr, |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1404 | int error |
| 1405 | ), |
| 1406 | |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 1407 | TP_ARGS(xdr, error), |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1408 | |
| 1409 | TP_STRUCT__entry( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 1410 | __field(unsigned int, task_id) |
| 1411 | __field(unsigned int, client_id) |
| 1412 | __field(u32, xid) |
Chuck Lever | 5be5945 | 2020-05-12 17:14:00 -0400 | [diff] [blame] | 1413 | __field(int, version) |
Chuck Lever | 38a638a | 2019-06-19 10:33:58 -0400 | [diff] [blame] | 1414 | __field(unsigned long, error) |
Chuck Lever | 5be5945 | 2020-05-12 17:14:00 -0400 | [diff] [blame] | 1415 | __string(program, |
| 1416 | xdr->rqst->rq_task->tk_client->cl_program->name) |
| 1417 | __string(procedure, |
| 1418 | xdr->rqst->rq_task->tk_msg.rpc_proc->p_name) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1419 | ), |
| 1420 | |
| 1421 | TP_fast_assign( |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 1422 | const struct rpc_rqst *rqstp = xdr->rqst; |
| 1423 | const struct rpc_task *task = rqstp->rq_task; |
| 1424 | |
| 1425 | __entry->task_id = task->tk_pid; |
| 1426 | __entry->client_id = task->tk_client->cl_clid; |
| 1427 | __entry->xid = be32_to_cpu(rqstp->rq_xid); |
Chuck Lever | 5be5945 | 2020-05-12 17:14:00 -0400 | [diff] [blame] | 1428 | __entry->version = task->tk_client->cl_vers; |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1429 | __entry->error = error; |
Chuck Lever | 5be5945 | 2020-05-12 17:14:00 -0400 | [diff] [blame] | 1430 | __assign_str(program, |
Joe Perches | 78c14b3 | 2021-06-12 08:42:27 -0700 | [diff] [blame] | 1431 | task->tk_client->cl_program->name); |
| 1432 | __assign_str(procedure, task->tk_msg.rpc_proc->p_name); |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1433 | ), |
| 1434 | |
Chuck Lever | b4776a3 | 2021-10-16 18:02:24 -0400 | [diff] [blame] | 1435 | TP_printk(SUNRPC_TRACE_TASK_SPECIFIER |
| 1436 | " xid=0x%08x %sv%d %s error=%ld (%s)", |
Chuck Lever | 62a92ba | 2019-06-19 10:34:09 -0400 | [diff] [blame] | 1437 | __entry->task_id, __entry->client_id, __entry->xid, |
Chuck Lever | 5be5945 | 2020-05-12 17:14:00 -0400 | [diff] [blame] | 1438 | __get_str(program), __entry->version, |
| 1439 | __get_str(procedure), -__entry->error, |
Chuck Lever | 8791545 | 2021-10-22 16:17:03 -0400 | [diff] [blame] | 1440 | show_nfs_status(__entry->error) |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1441 | ) |
| 1442 | ); |
Trond Myklebust | 3d66bae | 2021-04-01 13:54:19 -0400 | [diff] [blame] | 1443 | #define DEFINE_NFS_XDR_EVENT(name) \ |
| 1444 | DEFINE_EVENT(nfs_xdr_event, name, \ |
| 1445 | TP_PROTO( \ |
| 1446 | const struct xdr_stream *xdr, \ |
| 1447 | int error \ |
| 1448 | ), \ |
| 1449 | TP_ARGS(xdr, error)) |
| 1450 | DEFINE_NFS_XDR_EVENT(nfs_xdr_status); |
Trond Myklebust | eb3d58c | 2021-04-01 14:03:26 -0400 | [diff] [blame] | 1451 | DEFINE_NFS_XDR_EVENT(nfs_xdr_bad_filehandle); |
Chuck Lever | f23f658 | 2019-02-11 11:24:26 -0500 | [diff] [blame] | 1452 | |
Trond Myklebust | f4ce129 | 2013-08-19 18:59:33 -0400 | [diff] [blame] | 1453 | #endif /* _TRACE_NFS_H */ |
| 1454 | |
| 1455 | #undef TRACE_INCLUDE_PATH |
| 1456 | #define TRACE_INCLUDE_PATH . |
| 1457 | #define TRACE_INCLUDE_FILE nfstrace |
| 1458 | /* This part must be outside protection */ |
| 1459 | #include <trace/define_trace.h> |