1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 2 /* 3 * Copyright (c) 2013 Trond Myklebust <Trond.M 3 * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com> 4 */ 4 */ 5 #undef TRACE_SYSTEM 5 #undef TRACE_SYSTEM 6 #define TRACE_SYSTEM nfs 6 #define TRACE_SYSTEM nfs 7 7 8 #if !defined(_TRACE_NFS_H) || defined(TRACE_HE 8 #if !defined(_TRACE_NFS_H) || defined(TRACE_HEADER_MULTI_READ) 9 #define _TRACE_NFS_H 9 #define _TRACE_NFS_H 10 10 11 #include <linux/tracepoint.h> 11 #include <linux/tracepoint.h> 12 #include <linux/iversion.h> 12 #include <linux/iversion.h> 13 13 14 #include <trace/misc/fs.h> !! 14 TRACE_DEFINE_ENUM(DT_UNKNOWN); 15 #include <trace/misc/nfs.h> !! 15 TRACE_DEFINE_ENUM(DT_FIFO); 16 #include <trace/misc/sunrpc.h> !! 16 TRACE_DEFINE_ENUM(DT_CHR); >> 17 TRACE_DEFINE_ENUM(DT_DIR); >> 18 TRACE_DEFINE_ENUM(DT_BLK); >> 19 TRACE_DEFINE_ENUM(DT_REG); >> 20 TRACE_DEFINE_ENUM(DT_LNK); >> 21 TRACE_DEFINE_ENUM(DT_SOCK); >> 22 TRACE_DEFINE_ENUM(DT_WHT); >> 23 >> 24 #define nfs_show_file_type(ftype) \ >> 25 __print_symbolic(ftype, \ >> 26 { DT_UNKNOWN, "UNKNOWN" }, \ >> 27 { DT_FIFO, "FIFO" }, \ >> 28 { DT_CHR, "CHR" }, \ >> 29 { DT_DIR, "DIR" }, \ >> 30 { DT_BLK, "BLK" }, \ >> 31 { DT_REG, "REG" }, \ >> 32 { DT_LNK, "LNK" }, \ >> 33 { DT_SOCK, "SOCK" }, \ >> 34 { DT_WHT, "WHT" }) >> 35 >> 36 TRACE_DEFINE_ENUM(NFS_INO_INVALID_DATA); >> 37 TRACE_DEFINE_ENUM(NFS_INO_INVALID_ATIME); >> 38 TRACE_DEFINE_ENUM(NFS_INO_INVALID_ACCESS); >> 39 TRACE_DEFINE_ENUM(NFS_INO_INVALID_ACL); >> 40 TRACE_DEFINE_ENUM(NFS_INO_REVAL_PAGECACHE); >> 41 TRACE_DEFINE_ENUM(NFS_INO_REVAL_FORCED); >> 42 TRACE_DEFINE_ENUM(NFS_INO_INVALID_LABEL); >> 43 TRACE_DEFINE_ENUM(NFS_INO_INVALID_CHANGE); >> 44 TRACE_DEFINE_ENUM(NFS_INO_INVALID_CTIME); >> 45 TRACE_DEFINE_ENUM(NFS_INO_INVALID_MTIME); >> 46 TRACE_DEFINE_ENUM(NFS_INO_INVALID_SIZE); >> 47 TRACE_DEFINE_ENUM(NFS_INO_INVALID_OTHER); 17 48 18 #define nfs_show_cache_validity(v) \ 49 #define nfs_show_cache_validity(v) \ 19 __print_flags(v, "|", \ 50 __print_flags(v, "|", \ 20 { NFS_INO_INVALID_DATA 51 { NFS_INO_INVALID_DATA, "INVALID_DATA" }, \ 21 { NFS_INO_INVALID_ATIM 52 { NFS_INO_INVALID_ATIME, "INVALID_ATIME" }, \ 22 { NFS_INO_INVALID_ACCE 53 { NFS_INO_INVALID_ACCESS, "INVALID_ACCESS" }, \ 23 { NFS_INO_INVALID_ACL, 54 { NFS_INO_INVALID_ACL, "INVALID_ACL" }, \ >> 55 { NFS_INO_REVAL_PAGECACHE, "REVAL_PAGECACHE" }, \ 24 { NFS_INO_REVAL_FORCED 56 { NFS_INO_REVAL_FORCED, "REVAL_FORCED" }, \ 25 { NFS_INO_INVALID_LABE 57 { NFS_INO_INVALID_LABEL, "INVALID_LABEL" }, \ 26 { NFS_INO_INVALID_CHAN 58 { NFS_INO_INVALID_CHANGE, "INVALID_CHANGE" }, \ 27 { NFS_INO_INVALID_CTIM 59 { NFS_INO_INVALID_CTIME, "INVALID_CTIME" }, \ 28 { NFS_INO_INVALID_MTIM 60 { NFS_INO_INVALID_MTIME, "INVALID_MTIME" }, \ 29 { NFS_INO_INVALID_SIZE 61 { NFS_INO_INVALID_SIZE, "INVALID_SIZE" }, \ 30 { NFS_INO_INVALID_OTHE !! 62 { NFS_INO_INVALID_OTHER, "INVALID_OTHER" }) 31 { NFS_INO_DATA_INVAL_D !! 63 32 { NFS_INO_INVALID_BLOC !! 64 TRACE_DEFINE_ENUM(NFS_INO_ADVISE_RDPLUS); 33 { NFS_INO_INVALID_XATT !! 65 TRACE_DEFINE_ENUM(NFS_INO_STALE); 34 { NFS_INO_INVALID_NLIN !! 66 TRACE_DEFINE_ENUM(NFS_INO_ACL_LRU_SET); 35 { NFS_INO_INVALID_MODE !! 67 TRACE_DEFINE_ENUM(NFS_INO_INVALIDATING); >> 68 TRACE_DEFINE_ENUM(NFS_INO_FSCACHE); >> 69 TRACE_DEFINE_ENUM(NFS_INO_FSCACHE_LOCK); >> 70 TRACE_DEFINE_ENUM(NFS_INO_LAYOUTCOMMIT); >> 71 TRACE_DEFINE_ENUM(NFS_INO_LAYOUTCOMMITTING); >> 72 TRACE_DEFINE_ENUM(NFS_INO_LAYOUTSTATS); >> 73 TRACE_DEFINE_ENUM(NFS_INO_ODIRECT); 36 74 37 #define nfs_show_nfsi_flags(v) \ 75 #define nfs_show_nfsi_flags(v) \ 38 __print_flags(v, "|", \ 76 __print_flags(v, "|", \ >> 77 { BIT(NFS_INO_ADVISE_RDPLUS), "ADVISE_RDPLUS" }, \ 39 { BIT(NFS_INO_STALE), 78 { BIT(NFS_INO_STALE), "STALE" }, \ 40 { BIT(NFS_INO_ACL_LRU_ 79 { BIT(NFS_INO_ACL_LRU_SET), "ACL_LRU_SET" }, \ 41 { BIT(NFS_INO_INVALIDA 80 { BIT(NFS_INO_INVALIDATING), "INVALIDATING" }, \ >> 81 { BIT(NFS_INO_FSCACHE), "FSCACHE" }, \ >> 82 { BIT(NFS_INO_FSCACHE_LOCK), "FSCACHE_LOCK" }, \ 42 { BIT(NFS_INO_LAYOUTCO 83 { BIT(NFS_INO_LAYOUTCOMMIT), "NEED_LAYOUTCOMMIT" }, \ 43 { BIT(NFS_INO_LAYOUTCO 84 { BIT(NFS_INO_LAYOUTCOMMITTING), "LAYOUTCOMMIT" }, \ 44 { BIT(NFS_INO_LAYOUTST 85 { BIT(NFS_INO_LAYOUTSTATS), "LAYOUTSTATS" }, \ 45 { BIT(NFS_INO_ODIRECT) 86 { BIT(NFS_INO_ODIRECT), "ODIRECT" }) 46 87 47 DECLARE_EVENT_CLASS(nfs_inode_event, 88 DECLARE_EVENT_CLASS(nfs_inode_event, 48 TP_PROTO( 89 TP_PROTO( 49 const struct inode *in 90 const struct inode *inode 50 ), 91 ), 51 92 52 TP_ARGS(inode), 93 TP_ARGS(inode), 53 94 54 TP_STRUCT__entry( 95 TP_STRUCT__entry( 55 __field(dev_t, dev) 96 __field(dev_t, dev) 56 __field(u32, fhandle) 97 __field(u32, fhandle) 57 __field(u64, fileid) 98 __field(u64, fileid) 58 __field(u64, version) 99 __field(u64, version) 59 ), 100 ), 60 101 61 TP_fast_assign( 102 TP_fast_assign( 62 const struct nfs_inode 103 const struct nfs_inode *nfsi = NFS_I(inode); 63 __entry->dev = inode-> 104 __entry->dev = inode->i_sb->s_dev; 64 __entry->fileid = nfsi 105 __entry->fileid = nfsi->fileid; 65 __entry->fhandle = nfs 106 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); 66 __entry->version = ino 107 __entry->version = inode_peek_iversion_raw(inode); 67 ), 108 ), 68 109 69 TP_printk( 110 TP_printk( 70 "fileid=%02x:%02x:%llu 111 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ", 71 MAJOR(__entry->dev), M 112 MAJOR(__entry->dev), MINOR(__entry->dev), 72 (unsigned long long)__ 113 (unsigned long long)__entry->fileid, 73 __entry->fhandle, 114 __entry->fhandle, 74 (unsigned long long)__ 115 (unsigned long long)__entry->version 75 ) 116 ) 76 ); 117 ); 77 118 78 DECLARE_EVENT_CLASS(nfs_inode_event_done, 119 DECLARE_EVENT_CLASS(nfs_inode_event_done, 79 TP_PROTO( 120 TP_PROTO( 80 const struct inode *in 121 const struct inode *inode, 81 int error 122 int error 82 ), 123 ), 83 124 84 TP_ARGS(inode, error), 125 TP_ARGS(inode, error), 85 126 86 TP_STRUCT__entry( 127 TP_STRUCT__entry( 87 __field(unsigned long, 128 __field(unsigned long, error) 88 __field(dev_t, dev) 129 __field(dev_t, dev) 89 __field(u32, fhandle) 130 __field(u32, fhandle) 90 __field(unsigned char, 131 __field(unsigned char, type) 91 __field(u64, fileid) 132 __field(u64, fileid) 92 __field(u64, version) 133 __field(u64, version) 93 __field(loff_t, size) 134 __field(loff_t, size) 94 __field(unsigned long, 135 __field(unsigned long, nfsi_flags) 95 __field(unsigned long, 136 __field(unsigned long, cache_validity) 96 ), 137 ), 97 138 98 TP_fast_assign( 139 TP_fast_assign( 99 const struct nfs_inode 140 const struct nfs_inode *nfsi = NFS_I(inode); 100 __entry->error = error 141 __entry->error = error < 0 ? -error : 0; 101 __entry->dev = inode-> 142 __entry->dev = inode->i_sb->s_dev; 102 __entry->fileid = nfsi 143 __entry->fileid = nfsi->fileid; 103 __entry->fhandle = nfs 144 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); 104 __entry->type = nfs_um 145 __entry->type = nfs_umode_to_dtype(inode->i_mode); 105 __entry->version = ino 146 __entry->version = inode_peek_iversion_raw(inode); 106 __entry->size = i_size 147 __entry->size = i_size_read(inode); 107 __entry->nfsi_flags = 148 __entry->nfsi_flags = nfsi->flags; 108 __entry->cache_validit 149 __entry->cache_validity = nfsi->cache_validity; 109 ), 150 ), 110 151 111 TP_printk( 152 TP_printk( 112 "error=%ld (%s) fileid 153 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 113 "type=%u (%s) version= 154 "type=%u (%s) version=%llu size=%lld " 114 "cache_validity=0x%lx 155 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s)", 115 -__entry->error, show_ !! 156 -__entry->error, nfs_show_status(__entry->error), 116 MAJOR(__entry->dev), M 157 MAJOR(__entry->dev), MINOR(__entry->dev), 117 (unsigned long long)__ 158 (unsigned long long)__entry->fileid, 118 __entry->fhandle, 159 __entry->fhandle, 119 __entry->type, 160 __entry->type, 120 show_fs_dirent_type(__ !! 161 nfs_show_file_type(__entry->type), 121 (unsigned long long)__ 162 (unsigned long long)__entry->version, 122 (long long)__entry->si 163 (long long)__entry->size, 123 __entry->cache_validit 164 __entry->cache_validity, 124 nfs_show_cache_validit 165 nfs_show_cache_validity(__entry->cache_validity), 125 __entry->nfsi_flags, 166 __entry->nfsi_flags, 126 nfs_show_nfsi_flags(__ 167 nfs_show_nfsi_flags(__entry->nfsi_flags) 127 ) 168 ) 128 ); 169 ); 129 170 130 #define DEFINE_NFS_INODE_EVENT(name) \ 171 #define DEFINE_NFS_INODE_EVENT(name) \ 131 DEFINE_EVENT(nfs_inode_event, name, \ 172 DEFINE_EVENT(nfs_inode_event, name, \ 132 TP_PROTO( \ 173 TP_PROTO( \ 133 const struct i 174 const struct inode *inode \ 134 ), \ 175 ), \ 135 TP_ARGS(inode)) 176 TP_ARGS(inode)) 136 #define DEFINE_NFS_INODE_EVENT_DONE(name) \ 177 #define DEFINE_NFS_INODE_EVENT_DONE(name) \ 137 DEFINE_EVENT(nfs_inode_event_done, nam 178 DEFINE_EVENT(nfs_inode_event_done, name, \ 138 TP_PROTO( \ 179 TP_PROTO( \ 139 const struct i 180 const struct inode *inode, \ 140 int error \ 181 int error \ 141 ), \ 182 ), \ 142 TP_ARGS(inode, error)) 183 TP_ARGS(inode, error)) 143 DEFINE_NFS_INODE_EVENT(nfs_set_inode_stale); << 144 DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter 184 DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter); 145 DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_ 185 DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit); 146 DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_en 186 DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter); 147 DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_ino 187 DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit); 148 DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_ 188 DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter); 149 DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_map 189 DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit); 150 DEFINE_NFS_INODE_EVENT(nfs_getattr_enter); 190 DEFINE_NFS_INODE_EVENT(nfs_getattr_enter); 151 DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit); 191 DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit); 152 DEFINE_NFS_INODE_EVENT(nfs_setattr_enter); 192 DEFINE_NFS_INODE_EVENT(nfs_setattr_enter); 153 DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit); 193 DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit); >> 194 DEFINE_NFS_INODE_EVENT(nfs_writeback_page_enter); >> 195 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_page_exit); 154 DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_ent 196 DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter); 155 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inod 197 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit); 156 DEFINE_NFS_INODE_EVENT(nfs_fsync_enter); 198 DEFINE_NFS_INODE_EVENT(nfs_fsync_enter); 157 DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit); 199 DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit); 158 DEFINE_NFS_INODE_EVENT(nfs_access_enter); 200 DEFINE_NFS_INODE_EVENT(nfs_access_enter); 159 DEFINE_NFS_INODE_EVENT_DONE(nfs_set_cache_inva << 160 DEFINE_NFS_INODE_EVENT(nfs_readdir_force_readd << 161 DEFINE_NFS_INODE_EVENT_DONE(nfs_readdir_cache_ << 162 DEFINE_NFS_INODE_EVENT_DONE(nfs_readdir_uncach << 163 201 164 TRACE_EVENT(nfs_access_exit, 202 TRACE_EVENT(nfs_access_exit, 165 TP_PROTO( 203 TP_PROTO( 166 const struct inode *in 204 const struct inode *inode, 167 unsigned int mask, 205 unsigned int mask, 168 unsigned int permitted 206 unsigned int permitted, 169 int error 207 int error 170 ), 208 ), 171 209 172 TP_ARGS(inode, mask, permitted 210 TP_ARGS(inode, mask, permitted, error), 173 211 174 TP_STRUCT__entry( 212 TP_STRUCT__entry( 175 __field(unsigned long, 213 __field(unsigned long, error) 176 __field(dev_t, dev) 214 __field(dev_t, dev) 177 __field(u32, fhandle) 215 __field(u32, fhandle) 178 __field(unsigned char, 216 __field(unsigned char, type) 179 __field(u64, fileid) 217 __field(u64, fileid) 180 __field(u64, version) 218 __field(u64, version) 181 __field(loff_t, size) 219 __field(loff_t, size) 182 __field(unsigned long, 220 __field(unsigned long, nfsi_flags) 183 __field(unsigned long, 221 __field(unsigned long, cache_validity) 184 __field(unsigned int, 222 __field(unsigned int, mask) 185 __field(unsigned int, 223 __field(unsigned int, permitted) 186 ), 224 ), 187 225 188 TP_fast_assign( 226 TP_fast_assign( 189 const struct nfs_inode 227 const struct nfs_inode *nfsi = NFS_I(inode); 190 __entry->error = error 228 __entry->error = error < 0 ? -error : 0; 191 __entry->dev = inode-> 229 __entry->dev = inode->i_sb->s_dev; 192 __entry->fileid = nfsi 230 __entry->fileid = nfsi->fileid; 193 __entry->fhandle = nfs 231 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); 194 __entry->type = nfs_um 232 __entry->type = nfs_umode_to_dtype(inode->i_mode); 195 __entry->version = ino 233 __entry->version = inode_peek_iversion_raw(inode); 196 __entry->size = i_size 234 __entry->size = i_size_read(inode); 197 __entry->nfsi_flags = 235 __entry->nfsi_flags = nfsi->flags; 198 __entry->cache_validit 236 __entry->cache_validity = nfsi->cache_validity; 199 __entry->mask = mask; 237 __entry->mask = mask; 200 __entry->permitted = p 238 __entry->permitted = permitted; 201 ), 239 ), 202 240 203 TP_printk( 241 TP_printk( 204 "error=%ld (%s) fileid 242 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x " 205 "type=%u (%s) version= 243 "type=%u (%s) version=%llu size=%lld " 206 "cache_validity=0x%lx 244 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s) " 207 "mask=0x%x permitted=0 245 "mask=0x%x permitted=0x%x", 208 -__entry->error, show_ !! 246 -__entry->error, nfs_show_status(__entry->error), 209 MAJOR(__entry->dev), M 247 MAJOR(__entry->dev), MINOR(__entry->dev), 210 (unsigned long long)__ 248 (unsigned long long)__entry->fileid, 211 __entry->fhandle, 249 __entry->fhandle, 212 __entry->type, 250 __entry->type, 213 show_fs_dirent_type(__ !! 251 nfs_show_file_type(__entry->type), 214 (unsigned long long)__ 252 (unsigned long long)__entry->version, 215 (long long)__entry->si 253 (long long)__entry->size, 216 __entry->cache_validit 254 __entry->cache_validity, 217 nfs_show_cache_validit 255 nfs_show_cache_validity(__entry->cache_validity), 218 __entry->nfsi_flags, 256 __entry->nfsi_flags, 219 nfs_show_nfsi_flags(__ 257 nfs_show_nfsi_flags(__entry->nfsi_flags), 220 __entry->mask, __entry 258 __entry->mask, __entry->permitted 221 ) 259 ) 222 ); 260 ); 223 261 224 DECLARE_EVENT_CLASS(nfs_update_size_class, !! 262 TRACE_DEFINE_ENUM(LOOKUP_FOLLOW); 225 TP_PROTO( !! 263 TRACE_DEFINE_ENUM(LOOKUP_DIRECTORY); 226 const struct inode *in !! 264 TRACE_DEFINE_ENUM(LOOKUP_AUTOMOUNT); 227 loff_t new_size !! 265 TRACE_DEFINE_ENUM(LOOKUP_PARENT); 228 ), !! 266 TRACE_DEFINE_ENUM(LOOKUP_REVAL); 229 !! 267 TRACE_DEFINE_ENUM(LOOKUP_RCU); 230 TP_ARGS(inode, new_size), !! 268 TRACE_DEFINE_ENUM(LOOKUP_OPEN); 231 !! 269 TRACE_DEFINE_ENUM(LOOKUP_CREATE); 232 TP_STRUCT__entry( !! 270 TRACE_DEFINE_ENUM(LOOKUP_EXCL); 233 __field(dev_t, dev) !! 271 TRACE_DEFINE_ENUM(LOOKUP_RENAME_TARGET); 234 __field(u32, fhandle) !! 272 TRACE_DEFINE_ENUM(LOOKUP_JUMPED); 235 __field(u64, fileid) !! 273 TRACE_DEFINE_ENUM(LOOKUP_ROOT); 236 __field(u64, version) !! 274 TRACE_DEFINE_ENUM(LOOKUP_EMPTY); 237 __field(loff_t, cur_si !! 275 TRACE_DEFINE_ENUM(LOOKUP_DOWN); 238 __field(loff_t, new_si !! 276 239 ), !! 277 #define show_lookup_flags(flags) \ 240 !! 278 __print_flags(flags, "|", \ 241 TP_fast_assign( !! 279 { LOOKUP_FOLLOW, "FOLLOW" }, \ 242 const struct nfs_inode !! 280 { LOOKUP_DIRECTORY, "DIRECTORY" }, \ 243 !! 281 { LOOKUP_AUTOMOUNT, "AUTOMOUNT" }, \ 244 __entry->dev = inode-> !! 282 { LOOKUP_PARENT, "PARENT" }, \ 245 __entry->fhandle = nfs !! 283 { LOOKUP_REVAL, "REVAL" }, \ 246 __entry->fileid = nfsi !! 284 { LOOKUP_RCU, "RCU" }, \ 247 __entry->version = ino !! 285 { LOOKUP_OPEN, "OPEN" }, \ 248 __entry->cur_size = i_ !! 286 { LOOKUP_CREATE, "CREATE" }, \ 249 __entry->new_size = ne !! 287 { LOOKUP_EXCL, "EXCL" }, \ 250 ), !! 288 { LOOKUP_RENAME_TARGET, "RENAME_TARGET" }, \ 251 !! 289 { LOOKUP_JUMPED, "JUMPED" }, \ 252 TP_printk( !! 290 { LOOKUP_ROOT, "ROOT" }, \ 253 "fileid=%02x:%02x:%llu !! 291 { LOOKUP_EMPTY, "EMPTY" }, \ 254 MAJOR(__entry->dev), M !! 292 { LOOKUP_DOWN, "DOWN" }) 255 (unsigned long long)__ << 256 __entry->fhandle, __en << 257 __entry->cur_size, __e << 258 ) << 259 ); << 260 << 261 #define DEFINE_NFS_UPDATE_SIZE_EVENT(name) \ << 262 DEFINE_EVENT(nfs_update_size_class, nf << 263 TP_PROTO( \ << 264 const struct i << 265 loff_t new_siz << 266 ), \ << 267 TP_ARGS(inode, new_siz << 268 << 269 DEFINE_NFS_UPDATE_SIZE_EVENT(truncate); << 270 DEFINE_NFS_UPDATE_SIZE_EVENT(wcc); << 271 DEFINE_NFS_UPDATE_SIZE_EVENT(update); << 272 DEFINE_NFS_UPDATE_SIZE_EVENT(grow); << 273 << 274 DECLARE_EVENT_CLASS(nfs_inode_range_event, << 275 TP_PROTO( << 276 const struct inode *in << 277 loff_t range_start, << 278 loff_t range_end << 279 ), << 280 << 281 TP_ARGS(inode, range_start, ra << 282 << 283 TP_STRUCT__entry( << 284 __field(dev_t, dev) << 285 __field(u32, fhandle) << 286 __field(u64, fileid) << 287 __field(u64, version) << 288 __field(loff_t, range_ << 289 __field(loff_t, range_ << 290 ), << 291 << 292 TP_fast_assign( << 293 const struct nfs_inode << 294 << 295 __entry->dev = inode-> << 296 __entry->fhandle = nfs << 297 __entry->fileid = nfsi << 298 __entry->version = ino << 299 __entry->range_start = << 300 __entry->range_end = r << 301 ), << 302 << 303 TP_printk( << 304 "fileid=%02x:%02x:%llu << 305 "range=[%lld, %lld]", << 306 MAJOR(__entry->dev), M << 307 (unsigned long long)__ << 308 __entry->fhandle, __en << 309 __entry->range_start, << 310 ) << 311 ); << 312 << 313 #define DEFINE_NFS_INODE_RANGE_EVENT(name) \ << 314 DEFINE_EVENT(nfs_inode_range_event, na << 315 TP_PROTO( \ << 316 const struct i << 317 loff_t range_s << 318 loff_t range_e << 319 ), \ << 320 TP_ARGS(inode, range_s << 321 << 322 DEFINE_NFS_INODE_RANGE_EVENT(nfs_readdir_inval << 323 << 324 DECLARE_EVENT_CLASS(nfs_readdir_event, << 325 TP_PROTO( << 326 const struct file *fil << 327 const __be32 *verifier << 328 u64 cookie, << 329 pgoff_t page_index, << 330 unsigned int dtsize << 331 ), << 332 << 333 TP_ARGS(file, verifier, cookie << 334 << 335 TP_STRUCT__entry( << 336 __field(dev_t, dev) << 337 __field(u32, fhandle) << 338 __field(u64, fileid) << 339 __field(u64, version) << 340 __array(char, verifier << 341 __field(u64, cookie) << 342 __field(pgoff_t, index << 343 __field(unsigned int, << 344 ), << 345 << 346 TP_fast_assign( << 347 const struct inode *di << 348 const struct nfs_inode << 349 << 350 __entry->dev = dir->i_ << 351 __entry->fileid = nfsi << 352 __entry->fhandle = nfs << 353 __entry->version = ino << 354 if (cookie != 0) << 355 memcpy(__entry << 356 NFS4_VE << 357 else << 358 memset(__entry << 359 NFS4_VE << 360 __entry->cookie = cook << 361 __entry->index = page_ << 362 __entry->dtsize = dtsi << 363 ), << 364 << 365 TP_printk( << 366 "fileid=%02x:%02x:%llu << 367 "cookie=%s:0x%llx cach << 368 MAJOR(__entry->dev), M << 369 (unsigned long long)__ << 370 __entry->version, show << 371 (unsigned long long)__ << 372 __entry->dtsize << 373 ) << 374 ); << 375 << 376 #define DEFINE_NFS_READDIR_EVENT(name) \ << 377 DEFINE_EVENT(nfs_readdir_event, name, << 378 TP_PROTO( \ << 379 const struct f << 380 const __be32 * << 381 u64 cookie, \ << 382 pgoff_t page_i << 383 unsigned int d << 384 ), \ << 385 TP_ARGS(file, verifier << 386 << 387 DEFINE_NFS_READDIR_EVENT(nfs_readdir_cache_fil << 388 DEFINE_NFS_READDIR_EVENT(nfs_readdir_uncached) << 389 293 390 DECLARE_EVENT_CLASS(nfs_lookup_event, 294 DECLARE_EVENT_CLASS(nfs_lookup_event, 391 TP_PROTO( 295 TP_PROTO( 392 const struct inode *di 296 const struct inode *dir, 393 const struct dentry *d 297 const struct dentry *dentry, 394 unsigned int flags 298 unsigned int flags 395 ), 299 ), 396 300 397 TP_ARGS(dir, dentry, flags), 301 TP_ARGS(dir, dentry, flags), 398 302 399 TP_STRUCT__entry( 303 TP_STRUCT__entry( 400 __field(unsigned long, 304 __field(unsigned long, flags) 401 __field(dev_t, dev) 305 __field(dev_t, dev) 402 __field(u64, dir) 306 __field(u64, dir) 403 __field(u64, fileid) << 404 __string(name, dentry- 307 __string(name, dentry->d_name.name) 405 ), 308 ), 406 309 407 TP_fast_assign( 310 TP_fast_assign( 408 __entry->dev = dir->i_ 311 __entry->dev = dir->i_sb->s_dev; 409 __entry->dir = NFS_FIL 312 __entry->dir = NFS_FILEID(dir); 410 __entry->flags = flags 313 __entry->flags = flags; 411 __entry->fileid = d_is !! 314 __assign_str(name, dentry->d_name.name); 412 __assign_str(name); << 413 ), 315 ), 414 316 415 TP_printk( 317 TP_printk( 416 "flags=0x%lx (%s) name !! 318 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s", 417 __entry->flags, 319 __entry->flags, 418 show_fs_lookup_flags(_ !! 320 show_lookup_flags(__entry->flags), 419 MAJOR(__entry->dev), M 321 MAJOR(__entry->dev), MINOR(__entry->dev), 420 (unsigned long long)__ 322 (unsigned long long)__entry->dir, 421 __get_str(name), !! 323 __get_str(name) 422 __entry->fileid << 423 ) 324 ) 424 ); 325 ); 425 326 426 #define DEFINE_NFS_LOOKUP_EVENT(name) \ 327 #define DEFINE_NFS_LOOKUP_EVENT(name) \ 427 DEFINE_EVENT(nfs_lookup_event, name, \ 328 DEFINE_EVENT(nfs_lookup_event, name, \ 428 TP_PROTO( \ 329 TP_PROTO( \ 429 const struct i 330 const struct inode *dir, \ 430 const struct d 331 const struct dentry *dentry, \ 431 unsigned int f 332 unsigned int flags \ 432 ), \ 333 ), \ 433 TP_ARGS(dir, dentry, f 334 TP_ARGS(dir, dentry, flags)) 434 335 435 DECLARE_EVENT_CLASS(nfs_lookup_event_done, 336 DECLARE_EVENT_CLASS(nfs_lookup_event_done, 436 TP_PROTO( 337 TP_PROTO( 437 const struct inode *di 338 const struct inode *dir, 438 const struct dentry *d 339 const struct dentry *dentry, 439 unsigned int flags, 340 unsigned int flags, 440 int error 341 int error 441 ), 342 ), 442 343 443 TP_ARGS(dir, dentry, flags, er 344 TP_ARGS(dir, dentry, flags, error), 444 345 445 TP_STRUCT__entry( 346 TP_STRUCT__entry( 446 __field(unsigned long, 347 __field(unsigned long, error) 447 __field(unsigned long, 348 __field(unsigned long, flags) 448 __field(dev_t, dev) 349 __field(dev_t, dev) 449 __field(u64, dir) 350 __field(u64, dir) 450 __field(u64, fileid) << 451 __string(name, dentry- 351 __string(name, dentry->d_name.name) 452 ), 352 ), 453 353 454 TP_fast_assign( 354 TP_fast_assign( 455 __entry->dev = dir->i_ 355 __entry->dev = dir->i_sb->s_dev; 456 __entry->dir = NFS_FIL 356 __entry->dir = NFS_FILEID(dir); 457 __entry->error = error 357 __entry->error = error < 0 ? -error : 0; 458 __entry->flags = flags 358 __entry->flags = flags; 459 __entry->fileid = d_is !! 359 __assign_str(name, dentry->d_name.name); 460 __assign_str(name); << 461 ), 360 ), 462 361 463 TP_printk( 362 TP_printk( 464 "error=%ld (%s) flags= !! 363 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s", 465 -__entry->error, show_ !! 364 -__entry->error, nfs_show_status(__entry->error), 466 __entry->flags, 365 __entry->flags, 467 show_fs_lookup_flags(_ !! 366 show_lookup_flags(__entry->flags), 468 MAJOR(__entry->dev), M 367 MAJOR(__entry->dev), MINOR(__entry->dev), 469 (unsigned long long)__ 368 (unsigned long long)__entry->dir, 470 __get_str(name), !! 369 __get_str(name) 471 __entry->fileid << 472 ) 370 ) 473 ); 371 ); 474 372 475 #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \ 373 #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \ 476 DEFINE_EVENT(nfs_lookup_event_done, na 374 DEFINE_EVENT(nfs_lookup_event_done, name, \ 477 TP_PROTO( \ 375 TP_PROTO( \ 478 const struct i 376 const struct inode *dir, \ 479 const struct d 377 const struct dentry *dentry, \ 480 unsigned int f 378 unsigned int flags, \ 481 int error \ 379 int error \ 482 ), \ 380 ), \ 483 TP_ARGS(dir, dentry, f 381 TP_ARGS(dir, dentry, flags, error)) 484 382 485 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter); 383 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter); 486 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit); 384 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit); 487 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_ 385 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter); 488 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revali 386 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit); 489 DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup); !! 387 490 DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup_rev !! 388 TRACE_DEFINE_ENUM(O_WRONLY); 491 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_readdir_looku !! 389 TRACE_DEFINE_ENUM(O_RDWR); >> 390 TRACE_DEFINE_ENUM(O_CREAT); >> 391 TRACE_DEFINE_ENUM(O_EXCL); >> 392 TRACE_DEFINE_ENUM(O_NOCTTY); >> 393 TRACE_DEFINE_ENUM(O_TRUNC); >> 394 TRACE_DEFINE_ENUM(O_APPEND); >> 395 TRACE_DEFINE_ENUM(O_NONBLOCK); >> 396 TRACE_DEFINE_ENUM(O_DSYNC); >> 397 TRACE_DEFINE_ENUM(O_DIRECT); >> 398 TRACE_DEFINE_ENUM(O_LARGEFILE); >> 399 TRACE_DEFINE_ENUM(O_DIRECTORY); >> 400 TRACE_DEFINE_ENUM(O_NOFOLLOW); >> 401 TRACE_DEFINE_ENUM(O_NOATIME); >> 402 TRACE_DEFINE_ENUM(O_CLOEXEC); >> 403 >> 404 #define show_open_flags(flags) \ >> 405 __print_flags(flags, "|", \ >> 406 { O_WRONLY, "O_WRONLY" }, \ >> 407 { O_RDWR, "O_RDWR" }, \ >> 408 { O_CREAT, "O_CREAT" }, \ >> 409 { O_EXCL, "O_EXCL" }, \ >> 410 { O_NOCTTY, "O_NOCTTY" }, \ >> 411 { O_TRUNC, "O_TRUNC" }, \ >> 412 { O_APPEND, "O_APPEND" }, \ >> 413 { O_NONBLOCK, "O_NONBLOCK" }, \ >> 414 { O_DSYNC, "O_DSYNC" }, \ >> 415 { O_DIRECT, "O_DIRECT" }, \ >> 416 { O_LARGEFILE, "O_LARGEFILE" }, \ >> 417 { O_DIRECTORY, "O_DIRECTORY" }, \ >> 418 { O_NOFOLLOW, "O_NOFOLLOW" }, \ >> 419 { O_NOATIME, "O_NOATIME" }, \ >> 420 { O_CLOEXEC, "O_CLOEXEC" }) >> 421 >> 422 TRACE_DEFINE_ENUM(FMODE_READ); >> 423 TRACE_DEFINE_ENUM(FMODE_WRITE); >> 424 TRACE_DEFINE_ENUM(FMODE_EXEC); >> 425 >> 426 #define show_fmode_flags(mode) \ >> 427 __print_flags(mode, "|", \ >> 428 { ((__force unsigned long)FMODE_READ), "READ" }, \ >> 429 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \ >> 430 { ((__force unsigned long)FMODE_EXEC), "EXEC" }) 492 431 493 TRACE_EVENT(nfs_atomic_open_enter, 432 TRACE_EVENT(nfs_atomic_open_enter, 494 TP_PROTO( 433 TP_PROTO( 495 const struct inode *di 434 const struct inode *dir, 496 const struct nfs_open_ 435 const struct nfs_open_context *ctx, 497 unsigned int flags 436 unsigned int flags 498 ), 437 ), 499 438 500 TP_ARGS(dir, ctx, flags), 439 TP_ARGS(dir, ctx, flags), 501 440 502 TP_STRUCT__entry( 441 TP_STRUCT__entry( 503 __field(unsigned long, 442 __field(unsigned long, flags) 504 __field(unsigned long, !! 443 __field(unsigned int, fmode) 505 __field(dev_t, dev) 444 __field(dev_t, dev) 506 __field(u64, dir) 445 __field(u64, dir) 507 __string(name, ctx->de 446 __string(name, ctx->dentry->d_name.name) 508 ), 447 ), 509 448 510 TP_fast_assign( 449 TP_fast_assign( 511 __entry->dev = dir->i_ 450 __entry->dev = dir->i_sb->s_dev; 512 __entry->dir = NFS_FIL 451 __entry->dir = NFS_FILEID(dir); 513 __entry->flags = flags 452 __entry->flags = flags; 514 __entry->fmode = (__fo !! 453 __entry->fmode = (__force unsigned int)ctx->mode; 515 __assign_str(name); !! 454 __assign_str(name, ctx->dentry->d_name.name); 516 ), 455 ), 517 456 518 TP_printk( 457 TP_printk( 519 "flags=0x%lx (%s) fmod 458 "flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s", 520 __entry->flags, 459 __entry->flags, 521 show_fs_fcntl_open_fla !! 460 show_open_flags(__entry->flags), 522 show_fs_fmode_flags(__ !! 461 show_fmode_flags(__entry->fmode), 523 MAJOR(__entry->dev), M 462 MAJOR(__entry->dev), MINOR(__entry->dev), 524 (unsigned long long)__ 463 (unsigned long long)__entry->dir, 525 __get_str(name) 464 __get_str(name) 526 ) 465 ) 527 ); 466 ); 528 467 529 TRACE_EVENT(nfs_atomic_open_exit, 468 TRACE_EVENT(nfs_atomic_open_exit, 530 TP_PROTO( 469 TP_PROTO( 531 const struct inode *di 470 const struct inode *dir, 532 const struct nfs_open_ 471 const struct nfs_open_context *ctx, 533 unsigned int flags, 472 unsigned int flags, 534 int error 473 int error 535 ), 474 ), 536 475 537 TP_ARGS(dir, ctx, flags, error 476 TP_ARGS(dir, ctx, flags, error), 538 477 539 TP_STRUCT__entry( 478 TP_STRUCT__entry( 540 __field(unsigned long, 479 __field(unsigned long, error) 541 __field(unsigned long, 480 __field(unsigned long, flags) 542 __field(unsigned long, !! 481 __field(unsigned int, fmode) 543 __field(dev_t, dev) 482 __field(dev_t, dev) 544 __field(u64, dir) 483 __field(u64, dir) 545 __string(name, ctx->de 484 __string(name, ctx->dentry->d_name.name) 546 ), 485 ), 547 486 548 TP_fast_assign( 487 TP_fast_assign( 549 __entry->error = -erro 488 __entry->error = -error; 550 __entry->dev = dir->i_ 489 __entry->dev = dir->i_sb->s_dev; 551 __entry->dir = NFS_FIL 490 __entry->dir = NFS_FILEID(dir); 552 __entry->flags = flags 491 __entry->flags = flags; 553 __entry->fmode = (__fo !! 492 __entry->fmode = (__force unsigned int)ctx->mode; 554 __assign_str(name); !! 493 __assign_str(name, ctx->dentry->d_name.name); 555 ), 494 ), 556 495 557 TP_printk( 496 TP_printk( 558 "error=%ld (%s) flags= 497 "error=%ld (%s) flags=0x%lx (%s) fmode=%s " 559 "name=%02x:%02x:%llu/% 498 "name=%02x:%02x:%llu/%s", 560 -__entry->error, show_ !! 499 -__entry->error, nfs_show_status(__entry->error), 561 __entry->flags, 500 __entry->flags, 562 show_fs_fcntl_open_fla !! 501 show_open_flags(__entry->flags), 563 show_fs_fmode_flags(__ !! 502 show_fmode_flags(__entry->fmode), 564 MAJOR(__entry->dev), M 503 MAJOR(__entry->dev), MINOR(__entry->dev), 565 (unsigned long long)__ 504 (unsigned long long)__entry->dir, 566 __get_str(name) 505 __get_str(name) 567 ) 506 ) 568 ); 507 ); 569 508 570 TRACE_EVENT(nfs_create_enter, 509 TRACE_EVENT(nfs_create_enter, 571 TP_PROTO( 510 TP_PROTO( 572 const struct inode *di 511 const struct inode *dir, 573 const struct dentry *d 512 const struct dentry *dentry, 574 unsigned int flags 513 unsigned int flags 575 ), 514 ), 576 515 577 TP_ARGS(dir, dentry, flags), 516 TP_ARGS(dir, dentry, flags), 578 517 579 TP_STRUCT__entry( 518 TP_STRUCT__entry( 580 __field(unsigned long, 519 __field(unsigned long, flags) 581 __field(dev_t, dev) 520 __field(dev_t, dev) 582 __field(u64, dir) 521 __field(u64, dir) 583 __string(name, dentry- 522 __string(name, dentry->d_name.name) 584 ), 523 ), 585 524 586 TP_fast_assign( 525 TP_fast_assign( 587 __entry->dev = dir->i_ 526 __entry->dev = dir->i_sb->s_dev; 588 __entry->dir = NFS_FIL 527 __entry->dir = NFS_FILEID(dir); 589 __entry->flags = flags 528 __entry->flags = flags; 590 __assign_str(name); !! 529 __assign_str(name, dentry->d_name.name); 591 ), 530 ), 592 531 593 TP_printk( 532 TP_printk( 594 "flags=0x%lx (%s) name 533 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s", 595 __entry->flags, 534 __entry->flags, 596 show_fs_fcntl_open_fla !! 535 show_open_flags(__entry->flags), 597 MAJOR(__entry->dev), M 536 MAJOR(__entry->dev), MINOR(__entry->dev), 598 (unsigned long long)__ 537 (unsigned long long)__entry->dir, 599 __get_str(name) 538 __get_str(name) 600 ) 539 ) 601 ); 540 ); 602 541 603 TRACE_EVENT(nfs_create_exit, 542 TRACE_EVENT(nfs_create_exit, 604 TP_PROTO( 543 TP_PROTO( 605 const struct inode *di 544 const struct inode *dir, 606 const struct dentry *d 545 const struct dentry *dentry, 607 unsigned int flags, 546 unsigned int flags, 608 int error 547 int error 609 ), 548 ), 610 549 611 TP_ARGS(dir, dentry, flags, er 550 TP_ARGS(dir, dentry, flags, error), 612 551 613 TP_STRUCT__entry( 552 TP_STRUCT__entry( 614 __field(unsigned long, 553 __field(unsigned long, error) 615 __field(unsigned long, 554 __field(unsigned long, flags) 616 __field(dev_t, dev) 555 __field(dev_t, dev) 617 __field(u64, dir) 556 __field(u64, dir) 618 __string(name, dentry- 557 __string(name, dentry->d_name.name) 619 ), 558 ), 620 559 621 TP_fast_assign( 560 TP_fast_assign( 622 __entry->error = -erro 561 __entry->error = -error; 623 __entry->dev = dir->i_ 562 __entry->dev = dir->i_sb->s_dev; 624 __entry->dir = NFS_FIL 563 __entry->dir = NFS_FILEID(dir); 625 __entry->flags = flags 564 __entry->flags = flags; 626 __assign_str(name); !! 565 __assign_str(name, dentry->d_name.name); 627 ), 566 ), 628 567 629 TP_printk( 568 TP_printk( 630 "error=%ld (%s) flags= 569 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s", 631 -__entry->error, show_ !! 570 -__entry->error, nfs_show_status(__entry->error), 632 __entry->flags, 571 __entry->flags, 633 show_fs_fcntl_open_fla !! 572 show_open_flags(__entry->flags), 634 MAJOR(__entry->dev), M 573 MAJOR(__entry->dev), MINOR(__entry->dev), 635 (unsigned long long)__ 574 (unsigned long long)__entry->dir, 636 __get_str(name) 575 __get_str(name) 637 ) 576 ) 638 ); 577 ); 639 578 640 DECLARE_EVENT_CLASS(nfs_directory_event, 579 DECLARE_EVENT_CLASS(nfs_directory_event, 641 TP_PROTO( 580 TP_PROTO( 642 const struct inode *di 581 const struct inode *dir, 643 const struct dentry *d 582 const struct dentry *dentry 644 ), 583 ), 645 584 646 TP_ARGS(dir, dentry), 585 TP_ARGS(dir, dentry), 647 586 648 TP_STRUCT__entry( 587 TP_STRUCT__entry( 649 __field(dev_t, dev) 588 __field(dev_t, dev) 650 __field(u64, dir) 589 __field(u64, dir) 651 __string(name, dentry- 590 __string(name, dentry->d_name.name) 652 ), 591 ), 653 592 654 TP_fast_assign( 593 TP_fast_assign( 655 __entry->dev = dir->i_ 594 __entry->dev = dir->i_sb->s_dev; 656 __entry->dir = NFS_FIL 595 __entry->dir = NFS_FILEID(dir); 657 __assign_str(name); !! 596 __assign_str(name, dentry->d_name.name); 658 ), 597 ), 659 598 660 TP_printk( 599 TP_printk( 661 "name=%02x:%02x:%llu/% 600 "name=%02x:%02x:%llu/%s", 662 MAJOR(__entry->dev), M 601 MAJOR(__entry->dev), MINOR(__entry->dev), 663 (unsigned long long)__ 602 (unsigned long long)__entry->dir, 664 __get_str(name) 603 __get_str(name) 665 ) 604 ) 666 ); 605 ); 667 606 668 #define DEFINE_NFS_DIRECTORY_EVENT(name) \ 607 #define DEFINE_NFS_DIRECTORY_EVENT(name) \ 669 DEFINE_EVENT(nfs_directory_event, name 608 DEFINE_EVENT(nfs_directory_event, name, \ 670 TP_PROTO( \ 609 TP_PROTO( \ 671 const struct i 610 const struct inode *dir, \ 672 const struct d 611 const struct dentry *dentry \ 673 ), \ 612 ), \ 674 TP_ARGS(dir, dentry)) 613 TP_ARGS(dir, dentry)) 675 614 676 DECLARE_EVENT_CLASS(nfs_directory_event_done, 615 DECLARE_EVENT_CLASS(nfs_directory_event_done, 677 TP_PROTO( 616 TP_PROTO( 678 const struct inode *di 617 const struct inode *dir, 679 const struct dentry *d 618 const struct dentry *dentry, 680 int error 619 int error 681 ), 620 ), 682 621 683 TP_ARGS(dir, dentry, error), 622 TP_ARGS(dir, dentry, error), 684 623 685 TP_STRUCT__entry( 624 TP_STRUCT__entry( 686 __field(unsigned long, 625 __field(unsigned long, error) 687 __field(dev_t, dev) 626 __field(dev_t, dev) 688 __field(u64, dir) 627 __field(u64, dir) 689 __string(name, dentry- 628 __string(name, dentry->d_name.name) 690 ), 629 ), 691 630 692 TP_fast_assign( 631 TP_fast_assign( 693 __entry->dev = dir->i_ 632 __entry->dev = dir->i_sb->s_dev; 694 __entry->dir = NFS_FIL 633 __entry->dir = NFS_FILEID(dir); 695 __entry->error = error 634 __entry->error = error < 0 ? -error : 0; 696 __assign_str(name); !! 635 __assign_str(name, dentry->d_name.name); 697 ), 636 ), 698 637 699 TP_printk( 638 TP_printk( 700 "error=%ld (%s) name=% 639 "error=%ld (%s) name=%02x:%02x:%llu/%s", 701 -__entry->error, show_ !! 640 -__entry->error, nfs_show_status(__entry->error), 702 MAJOR(__entry->dev), M 641 MAJOR(__entry->dev), MINOR(__entry->dev), 703 (unsigned long long)__ 642 (unsigned long long)__entry->dir, 704 __get_str(name) 643 __get_str(name) 705 ) 644 ) 706 ); 645 ); 707 646 708 #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) 647 #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \ 709 DEFINE_EVENT(nfs_directory_event_done, 648 DEFINE_EVENT(nfs_directory_event_done, name, \ 710 TP_PROTO( \ 649 TP_PROTO( \ 711 const struct i 650 const struct inode *dir, \ 712 const struct d 651 const struct dentry *dentry, \ 713 int error \ 652 int error \ 714 ), \ 653 ), \ 715 TP_ARGS(dir, dentry, e 654 TP_ARGS(dir, dentry, error)) 716 655 717 DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter); 656 DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter); 718 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit 657 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit); 719 DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter); 658 DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter); 720 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit 659 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit); 721 DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter); 660 DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter); 722 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit 661 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit); 723 DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter); 662 DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter); 724 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exi 663 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit); 725 DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter); 664 DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter); 726 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exi 665 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit); 727 DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter); 666 DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter); 728 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_ex 667 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit); 729 668 730 TRACE_EVENT(nfs_link_enter, 669 TRACE_EVENT(nfs_link_enter, 731 TP_PROTO( 670 TP_PROTO( 732 const struct inode *in 671 const struct inode *inode, 733 const struct inode *di 672 const struct inode *dir, 734 const struct dentry *d 673 const struct dentry *dentry 735 ), 674 ), 736 675 737 TP_ARGS(inode, dir, dentry), 676 TP_ARGS(inode, dir, dentry), 738 677 739 TP_STRUCT__entry( 678 TP_STRUCT__entry( 740 __field(dev_t, dev) 679 __field(dev_t, dev) 741 __field(u64, fileid) 680 __field(u64, fileid) 742 __field(u64, dir) 681 __field(u64, dir) 743 __string(name, dentry- 682 __string(name, dentry->d_name.name) 744 ), 683 ), 745 684 746 TP_fast_assign( 685 TP_fast_assign( 747 __entry->dev = inode-> 686 __entry->dev = inode->i_sb->s_dev; 748 __entry->fileid = NFS_ 687 __entry->fileid = NFS_FILEID(inode); 749 __entry->dir = NFS_FIL 688 __entry->dir = NFS_FILEID(dir); 750 __assign_str(name); !! 689 __assign_str(name, dentry->d_name.name); 751 ), 690 ), 752 691 753 TP_printk( 692 TP_printk( 754 "fileid=%02x:%02x:%llu 693 "fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s", 755 MAJOR(__entry->dev), M 694 MAJOR(__entry->dev), MINOR(__entry->dev), 756 __entry->fileid, 695 __entry->fileid, 757 MAJOR(__entry->dev), M 696 MAJOR(__entry->dev), MINOR(__entry->dev), 758 (unsigned long long)__ 697 (unsigned long long)__entry->dir, 759 __get_str(name) 698 __get_str(name) 760 ) 699 ) 761 ); 700 ); 762 701 763 TRACE_EVENT(nfs_link_exit, 702 TRACE_EVENT(nfs_link_exit, 764 TP_PROTO( 703 TP_PROTO( 765 const struct inode *in 704 const struct inode *inode, 766 const struct inode *di 705 const struct inode *dir, 767 const struct dentry *d 706 const struct dentry *dentry, 768 int error 707 int error 769 ), 708 ), 770 709 771 TP_ARGS(inode, dir, dentry, er 710 TP_ARGS(inode, dir, dentry, error), 772 711 773 TP_STRUCT__entry( 712 TP_STRUCT__entry( 774 __field(unsigned long, 713 __field(unsigned long, error) 775 __field(dev_t, dev) 714 __field(dev_t, dev) 776 __field(u64, fileid) 715 __field(u64, fileid) 777 __field(u64, dir) 716 __field(u64, dir) 778 __string(name, dentry- 717 __string(name, dentry->d_name.name) 779 ), 718 ), 780 719 781 TP_fast_assign( 720 TP_fast_assign( 782 __entry->dev = inode-> 721 __entry->dev = inode->i_sb->s_dev; 783 __entry->fileid = NFS_ 722 __entry->fileid = NFS_FILEID(inode); 784 __entry->dir = NFS_FIL 723 __entry->dir = NFS_FILEID(dir); 785 __entry->error = error 724 __entry->error = error < 0 ? -error : 0; 786 __assign_str(name); !! 725 __assign_str(name, dentry->d_name.name); 787 ), 726 ), 788 727 789 TP_printk( 728 TP_printk( 790 "error=%ld (%s) fileid 729 "error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s", 791 -__entry->error, show_ !! 730 -__entry->error, nfs_show_status(__entry->error), 792 MAJOR(__entry->dev), M 731 MAJOR(__entry->dev), MINOR(__entry->dev), 793 __entry->fileid, 732 __entry->fileid, 794 MAJOR(__entry->dev), M 733 MAJOR(__entry->dev), MINOR(__entry->dev), 795 (unsigned long long)__ 734 (unsigned long long)__entry->dir, 796 __get_str(name) 735 __get_str(name) 797 ) 736 ) 798 ); 737 ); 799 738 800 DECLARE_EVENT_CLASS(nfs_rename_event, 739 DECLARE_EVENT_CLASS(nfs_rename_event, 801 TP_PROTO( 740 TP_PROTO( 802 const struct inode *ol 741 const struct inode *old_dir, 803 const struct dentry *o 742 const struct dentry *old_dentry, 804 const struct inode *ne 743 const struct inode *new_dir, 805 const struct dentry *n 744 const struct dentry *new_dentry 806 ), 745 ), 807 746 808 TP_ARGS(old_dir, old_dentry, n 747 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry), 809 748 810 TP_STRUCT__entry( 749 TP_STRUCT__entry( 811 __field(dev_t, dev) 750 __field(dev_t, dev) 812 __field(u64, old_dir) 751 __field(u64, old_dir) 813 __field(u64, new_dir) 752 __field(u64, new_dir) 814 __string(old_name, old 753 __string(old_name, old_dentry->d_name.name) 815 __string(new_name, new 754 __string(new_name, new_dentry->d_name.name) 816 ), 755 ), 817 756 818 TP_fast_assign( 757 TP_fast_assign( 819 __entry->dev = old_dir 758 __entry->dev = old_dir->i_sb->s_dev; 820 __entry->old_dir = NFS 759 __entry->old_dir = NFS_FILEID(old_dir); 821 __entry->new_dir = NFS 760 __entry->new_dir = NFS_FILEID(new_dir); 822 __assign_str(old_name) !! 761 __assign_str(old_name, old_dentry->d_name.name); 823 __assign_str(new_name) !! 762 __assign_str(new_name, new_dentry->d_name.name); 824 ), 763 ), 825 764 826 TP_printk( 765 TP_printk( 827 "old_name=%02x:%02x:%l 766 "old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s", 828 MAJOR(__entry->dev), M 767 MAJOR(__entry->dev), MINOR(__entry->dev), 829 (unsigned long long)__ 768 (unsigned long long)__entry->old_dir, 830 __get_str(old_name), 769 __get_str(old_name), 831 MAJOR(__entry->dev), M 770 MAJOR(__entry->dev), MINOR(__entry->dev), 832 (unsigned long long)__ 771 (unsigned long long)__entry->new_dir, 833 __get_str(new_name) 772 __get_str(new_name) 834 ) 773 ) 835 ); 774 ); 836 #define DEFINE_NFS_RENAME_EVENT(name) \ 775 #define DEFINE_NFS_RENAME_EVENT(name) \ 837 DEFINE_EVENT(nfs_rename_event, name, \ 776 DEFINE_EVENT(nfs_rename_event, name, \ 838 TP_PROTO( \ 777 TP_PROTO( \ 839 const struct i 778 const struct inode *old_dir, \ 840 const struct d 779 const struct dentry *old_dentry, \ 841 const struct i 780 const struct inode *new_dir, \ 842 const struct d 781 const struct dentry *new_dentry \ 843 ), \ 782 ), \ 844 TP_ARGS(old_dir, old_d 783 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry)) 845 784 846 DECLARE_EVENT_CLASS(nfs_rename_event_done, 785 DECLARE_EVENT_CLASS(nfs_rename_event_done, 847 TP_PROTO( 786 TP_PROTO( 848 const struct inode *ol 787 const struct inode *old_dir, 849 const struct dentry *o 788 const struct dentry *old_dentry, 850 const struct inode *ne 789 const struct inode *new_dir, 851 const struct dentry *n 790 const struct dentry *new_dentry, 852 int error 791 int error 853 ), 792 ), 854 793 855 TP_ARGS(old_dir, old_dentry, n 794 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, error), 856 795 857 TP_STRUCT__entry( 796 TP_STRUCT__entry( 858 __field(dev_t, dev) 797 __field(dev_t, dev) 859 __field(unsigned long, 798 __field(unsigned long, error) 860 __field(u64, old_dir) 799 __field(u64, old_dir) 861 __string(old_name, old 800 __string(old_name, old_dentry->d_name.name) 862 __field(u64, new_dir) 801 __field(u64, new_dir) 863 __string(new_name, new 802 __string(new_name, new_dentry->d_name.name) 864 ), 803 ), 865 804 866 TP_fast_assign( 805 TP_fast_assign( 867 __entry->dev = old_dir 806 __entry->dev = old_dir->i_sb->s_dev; 868 __entry->error = -erro 807 __entry->error = -error; 869 __entry->old_dir = NFS 808 __entry->old_dir = NFS_FILEID(old_dir); 870 __entry->new_dir = NFS 809 __entry->new_dir = NFS_FILEID(new_dir); 871 __assign_str(old_name) !! 810 __assign_str(old_name, old_dentry->d_name.name); 872 __assign_str(new_name) !! 811 __assign_str(new_name, new_dentry->d_name.name); 873 ), 812 ), 874 813 875 TP_printk( 814 TP_printk( 876 "error=%ld (%s) old_na 815 "error=%ld (%s) old_name=%02x:%02x:%llu/%s " 877 "new_name=%02x:%02x:%l 816 "new_name=%02x:%02x:%llu/%s", 878 -__entry->error, show_ !! 817 -__entry->error, nfs_show_status(__entry->error), 879 MAJOR(__entry->dev), M 818 MAJOR(__entry->dev), MINOR(__entry->dev), 880 (unsigned long long)__ 819 (unsigned long long)__entry->old_dir, 881 __get_str(old_name), 820 __get_str(old_name), 882 MAJOR(__entry->dev), M 821 MAJOR(__entry->dev), MINOR(__entry->dev), 883 (unsigned long long)__ 822 (unsigned long long)__entry->new_dir, 884 __get_str(new_name) 823 __get_str(new_name) 885 ) 824 ) 886 ); 825 ); 887 #define DEFINE_NFS_RENAME_EVENT_DONE(name) \ 826 #define DEFINE_NFS_RENAME_EVENT_DONE(name) \ 888 DEFINE_EVENT(nfs_rename_event_done, na 827 DEFINE_EVENT(nfs_rename_event_done, name, \ 889 TP_PROTO( \ 828 TP_PROTO( \ 890 const struct i 829 const struct inode *old_dir, \ 891 const struct d 830 const struct dentry *old_dentry, \ 892 const struct i 831 const struct inode *new_dir, \ 893 const struct d 832 const struct dentry *new_dentry, \ 894 int error \ 833 int error \ 895 ), \ 834 ), \ 896 TP_ARGS(old_dir, old_d 835 TP_ARGS(old_dir, old_dentry, new_dir, \ 897 new_dentry, er 836 new_dentry, error)) 898 837 899 DEFINE_NFS_RENAME_EVENT(nfs_rename_enter); 838 DEFINE_NFS_RENAME_EVENT(nfs_rename_enter); 900 DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit); 839 DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit); 901 840 902 DEFINE_NFS_RENAME_EVENT_DONE(nfs_async_rename_ !! 841 DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename); 903 842 904 TRACE_EVENT(nfs_sillyrename_unlink, 843 TRACE_EVENT(nfs_sillyrename_unlink, 905 TP_PROTO( 844 TP_PROTO( 906 const struct nfs_unlin 845 const struct nfs_unlinkdata *data, 907 int error 846 int error 908 ), 847 ), 909 848 910 TP_ARGS(data, error), 849 TP_ARGS(data, error), 911 850 912 TP_STRUCT__entry( 851 TP_STRUCT__entry( 913 __field(dev_t, dev) 852 __field(dev_t, dev) 914 __field(unsigned long, 853 __field(unsigned long, error) 915 __field(u64, dir) 854 __field(u64, dir) 916 __dynamic_array(char, 855 __dynamic_array(char, name, data->args.name.len + 1) 917 ), 856 ), 918 857 919 TP_fast_assign( 858 TP_fast_assign( 920 struct inode *dir = d_ 859 struct inode *dir = d_inode(data->dentry->d_parent); 921 size_t len = data->arg 860 size_t len = data->args.name.len; 922 __entry->dev = dir->i_ 861 __entry->dev = dir->i_sb->s_dev; 923 __entry->dir = NFS_FIL 862 __entry->dir = NFS_FILEID(dir); 924 __entry->error = -erro 863 __entry->error = -error; 925 memcpy(__get_str(name) 864 memcpy(__get_str(name), 926 data->args.nam 865 data->args.name.name, len); 927 __get_str(name)[len] = 866 __get_str(name)[len] = 0; 928 ), 867 ), 929 868 930 TP_printk( 869 TP_printk( 931 "error=%ld (%s) name=% 870 "error=%ld (%s) name=%02x:%02x:%llu/%s", 932 -__entry->error, show_ !! 871 -__entry->error, nfs_show_status(__entry->error), 933 MAJOR(__entry->dev), M 872 MAJOR(__entry->dev), MINOR(__entry->dev), 934 (unsigned long long)__ 873 (unsigned long long)__entry->dir, 935 __get_str(name) 874 __get_str(name) 936 ) 875 ) 937 ); 876 ); 938 877 939 DECLARE_EVENT_CLASS(nfs_folio_event, << 940 TP_PROTO( << 941 const struct inode *in << 942 loff_t offset, << 943 size_t count << 944 ), << 945 << 946 TP_ARGS(inode, offset, count), << 947 << 948 TP_STRUCT__entry( << 949 __field(dev_t, dev) << 950 __field(u32, fhandle) << 951 __field(u64, fileid) << 952 __field(u64, version) << 953 __field(loff_t, offset << 954 __field(size_t, count) << 955 ), << 956 << 957 TP_fast_assign( << 958 const struct nfs_inode << 959 << 960 __entry->dev = inode-> << 961 __entry->fileid = nfsi << 962 __entry->fhandle = nfs << 963 __entry->version = ino << 964 __entry->offset = offs << 965 __entry->count = count << 966 ), << 967 << 968 TP_printk( << 969 "fileid=%02x:%02x:%llu << 970 "offset=%lld count=%zu << 971 MAJOR(__entry->dev), M << 972 (unsigned long long)__ << 973 __entry->fhandle, __en << 974 __entry->offset, __ent << 975 ) << 976 ); << 977 << 978 #define DEFINE_NFS_FOLIO_EVENT(name) \ << 979 DEFINE_EVENT(nfs_folio_event, name, \ << 980 TP_PROTO( \ << 981 const struct i << 982 loff_t offset, << 983 size_t count \ << 984 ), \ << 985 TP_ARGS(inode, offset, << 986 << 987 DECLARE_EVENT_CLASS(nfs_folio_event_done, << 988 TP_PROTO( << 989 const struct inode *in << 990 loff_t offset, << 991 size_t count, << 992 int ret << 993 ), << 994 << 995 TP_ARGS(inode, offset, count, << 996 << 997 TP_STRUCT__entry( << 998 __field(dev_t, dev) << 999 __field(u32, fhandle) << 1000 __field(int, ret) << 1001 __field(u64, fileid) << 1002 __field(u64, version) << 1003 __field(loff_t, offse << 1004 __field(size_t, count << 1005 ), << 1006 << 1007 TP_fast_assign( << 1008 const struct nfs_inod << 1009 << 1010 __entry->dev = inode- << 1011 __entry->fileid = nfs << 1012 __entry->fhandle = nf << 1013 __entry->version = in << 1014 __entry->offset = off << 1015 __entry->count = coun << 1016 __entry->ret = ret; << 1017 ), << 1018 << 1019 TP_printk( << 1020 "fileid=%02x:%02x:%ll << 1021 "offset=%lld count=%z << 1022 MAJOR(__entry->dev), << 1023 (unsigned long long)_ << 1024 __entry->fhandle, __e << 1025 __entry->offset, __en << 1026 ) << 1027 ); << 1028 << 1029 #define DEFINE_NFS_FOLIO_EVENT_DONE(name) \ << 1030 DEFINE_EVENT(nfs_folio_event_done, na << 1031 TP_PROTO( \ << 1032 const struct << 1033 loff_t offset << 1034 size_t count, << 1035 int ret \ << 1036 ), \ << 1037 TP_ARGS(inode, offset << 1038 << 1039 DEFINE_NFS_FOLIO_EVENT(nfs_aop_readpage); << 1040 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_aop_readpage_ << 1041 << 1042 DEFINE_NFS_FOLIO_EVENT(nfs_writeback_folio); << 1043 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_writeback_fol << 1044 << 1045 DEFINE_NFS_FOLIO_EVENT(nfs_invalidate_folio); << 1046 DEFINE_NFS_FOLIO_EVENT_DONE(nfs_launder_folio << 1047 << 1048 TRACE_EVENT(nfs_aop_readahead, << 1049 TP_PROTO( << 1050 const struct inode *i << 1051 loff_t pos, << 1052 unsigned int nr_pages << 1053 ), << 1054 << 1055 TP_ARGS(inode, pos, nr_pages) << 1056 << 1057 TP_STRUCT__entry( << 1058 __field(dev_t, dev) << 1059 __field(u32, fhandle) << 1060 __field(u64, fileid) << 1061 __field(u64, version) << 1062 __field(loff_t, offse << 1063 __field(unsigned int, << 1064 ), << 1065 << 1066 TP_fast_assign( << 1067 const struct nfs_inod << 1068 << 1069 __entry->dev = inode- << 1070 __entry->fileid = nfs << 1071 __entry->fhandle = nf << 1072 __entry->version = in << 1073 __entry->offset = pos << 1074 __entry->nr_pages = n << 1075 ), << 1076 << 1077 TP_printk( << 1078 "fileid=%02x:%02x:%ll << 1079 MAJOR(__entry->dev), << 1080 (unsigned long long)_ << 1081 __entry->fhandle, __e << 1082 __entry->offset, __en << 1083 ) << 1084 ); << 1085 << 1086 TRACE_EVENT(nfs_aop_readahead_done, << 1087 TP_PROTO( << 1088 const struct inode *i << 1089 unsigned int nr_pages << 1090 int ret << 1091 ), << 1092 << 1093 TP_ARGS(inode, nr_pages, ret) << 1094 << 1095 TP_STRUCT__entry( << 1096 __field(dev_t, dev) << 1097 __field(u32, fhandle) << 1098 __field(int, ret) << 1099 __field(u64, fileid) << 1100 __field(u64, version) << 1101 __field(loff_t, offse << 1102 __field(unsigned int, << 1103 ), << 1104 << 1105 TP_fast_assign( << 1106 const struct nfs_inod << 1107 << 1108 __entry->dev = inode- << 1109 __entry->fileid = nfs << 1110 __entry->fhandle = nf << 1111 __entry->version = in << 1112 __entry->nr_pages = n << 1113 __entry->ret = ret; << 1114 ), << 1115 << 1116 TP_printk( << 1117 "fileid=%02x:%02x:%ll << 1118 MAJOR(__entry->dev), << 1119 (unsigned long long)_ << 1120 __entry->fhandle, __e << 1121 __entry->nr_pages, __ << 1122 ) << 1123 ); << 1124 << 1125 TRACE_EVENT(nfs_initiate_read, 878 TRACE_EVENT(nfs_initiate_read, 1126 TP_PROTO( 879 TP_PROTO( 1127 const struct nfs_pgio 880 const struct nfs_pgio_header *hdr 1128 ), 881 ), 1129 882 1130 TP_ARGS(hdr), 883 TP_ARGS(hdr), 1131 884 1132 TP_STRUCT__entry( 885 TP_STRUCT__entry( 1133 __field(dev_t, dev) 886 __field(dev_t, dev) 1134 __field(u32, fhandle) 887 __field(u32, fhandle) 1135 __field(u64, fileid) 888 __field(u64, fileid) 1136 __field(loff_t, offse 889 __field(loff_t, offset) 1137 __field(u32, count) 890 __field(u32, count) 1138 ), 891 ), 1139 892 1140 TP_fast_assign( 893 TP_fast_assign( 1141 const struct inode *i 894 const struct inode *inode = hdr->inode; 1142 const struct nfs_inod 895 const struct nfs_inode *nfsi = NFS_I(inode); 1143 const struct nfs_fh * 896 const struct nfs_fh *fh = hdr->args.fh ? 1144 897 hdr->args.fh : &nfsi->fh; 1145 898 1146 __entry->offset = hdr 899 __entry->offset = hdr->args.offset; 1147 __entry->count = hdr- 900 __entry->count = hdr->args.count; 1148 __entry->dev = inode- 901 __entry->dev = inode->i_sb->s_dev; 1149 __entry->fileid = nfs 902 __entry->fileid = nfsi->fileid; 1150 __entry->fhandle = nf 903 __entry->fhandle = nfs_fhandle_hash(fh); 1151 ), 904 ), 1152 905 1153 TP_printk( 906 TP_printk( 1154 "fileid=%02x:%02x:%ll 907 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1155 "offset=%lld count=%u 908 "offset=%lld count=%u", 1156 MAJOR(__entry->dev), 909 MAJOR(__entry->dev), MINOR(__entry->dev), 1157 (unsigned long long)_ 910 (unsigned long long)__entry->fileid, 1158 __entry->fhandle, 911 __entry->fhandle, 1159 (long long)__entry->o 912 (long long)__entry->offset, __entry->count 1160 ) 913 ) 1161 ); 914 ); 1162 915 1163 TRACE_EVENT(nfs_readpage_done, 916 TRACE_EVENT(nfs_readpage_done, 1164 TP_PROTO( 917 TP_PROTO( 1165 const struct rpc_task 918 const struct rpc_task *task, 1166 const struct nfs_pgio 919 const struct nfs_pgio_header *hdr 1167 ), 920 ), 1168 921 1169 TP_ARGS(task, hdr), 922 TP_ARGS(task, hdr), 1170 923 1171 TP_STRUCT__entry( 924 TP_STRUCT__entry( 1172 __field(dev_t, dev) 925 __field(dev_t, dev) 1173 __field(u32, fhandle) 926 __field(u32, fhandle) 1174 __field(u64, fileid) 927 __field(u64, fileid) 1175 __field(loff_t, offse 928 __field(loff_t, offset) 1176 __field(u32, arg_coun 929 __field(u32, arg_count) 1177 __field(u32, res_coun 930 __field(u32, res_count) 1178 __field(bool, eof) 931 __field(bool, eof) 1179 __field(int, error) !! 932 __field(int, status) 1180 ), 933 ), 1181 934 1182 TP_fast_assign( 935 TP_fast_assign( 1183 const struct inode *i 936 const struct inode *inode = hdr->inode; 1184 const struct nfs_inod 937 const struct nfs_inode *nfsi = NFS_I(inode); 1185 const struct nfs_fh * 938 const struct nfs_fh *fh = hdr->args.fh ? 1186 939 hdr->args.fh : &nfsi->fh; 1187 940 1188 __entry->error = task !! 941 __entry->status = task->tk_status; 1189 __entry->offset = hdr 942 __entry->offset = hdr->args.offset; 1190 __entry->arg_count = 943 __entry->arg_count = hdr->args.count; 1191 __entry->res_count = 944 __entry->res_count = hdr->res.count; 1192 __entry->eof = hdr->r 945 __entry->eof = hdr->res.eof; 1193 __entry->dev = inode- 946 __entry->dev = inode->i_sb->s_dev; 1194 __entry->fileid = nfs 947 __entry->fileid = nfsi->fileid; 1195 __entry->fhandle = nf 948 __entry->fhandle = nfs_fhandle_hash(fh); 1196 ), 949 ), 1197 950 1198 TP_printk( 951 TP_printk( 1199 "error=%d fileid=%02x !! 952 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1200 "offset=%lld count=%u !! 953 "offset=%lld count=%u res=%u status=%d%s", 1201 MAJOR(__entry->dev), << 1202 (unsigned long long)_ << 1203 __entry->fhandle, << 1204 (long long)__entry->o << 1205 __entry->res_count, _ << 1206 ) << 1207 ); << 1208 << 1209 TRACE_EVENT(nfs_readpage_short, << 1210 TP_PROTO( << 1211 const struct rpc_task << 1212 const struct nfs_pgio << 1213 ), << 1214 << 1215 TP_ARGS(task, hdr), << 1216 << 1217 TP_STRUCT__entry( << 1218 __field(dev_t, dev) << 1219 __field(u32, fhandle) << 1220 __field(u64, fileid) << 1221 __field(loff_t, offse << 1222 __field(u32, arg_coun << 1223 __field(u32, res_coun << 1224 __field(bool, eof) << 1225 __field(int, error) << 1226 ), << 1227 << 1228 TP_fast_assign( << 1229 const struct inode *i << 1230 const struct nfs_inod << 1231 const struct nfs_fh * << 1232 << 1233 << 1234 __entry->error = task << 1235 __entry->offset = hdr << 1236 __entry->arg_count = << 1237 __entry->res_count = << 1238 __entry->eof = hdr->r << 1239 __entry->dev = inode- << 1240 __entry->fileid = nfs << 1241 __entry->fhandle = nf << 1242 ), << 1243 << 1244 TP_printk( << 1245 "error=%d fileid=%02x << 1246 "offset=%lld count=%u << 1247 MAJOR(__entry->dev), 954 MAJOR(__entry->dev), MINOR(__entry->dev), 1248 (unsigned long long)_ 955 (unsigned long long)__entry->fileid, 1249 __entry->fhandle, 956 __entry->fhandle, 1250 (long long)__entry->o 957 (long long)__entry->offset, __entry->arg_count, 1251 __entry->res_count, _ !! 958 __entry->res_count, __entry->status, >> 959 __entry->eof ? " eof" : "" 1252 ) 960 ) 1253 ); 961 ); 1254 962 >> 963 TRACE_DEFINE_ENUM(NFS_UNSTABLE); >> 964 TRACE_DEFINE_ENUM(NFS_DATA_SYNC); >> 965 TRACE_DEFINE_ENUM(NFS_FILE_SYNC); 1255 966 1256 TRACE_EVENT(nfs_pgio_error, !! 967 #define nfs_show_stable(stable) \ 1257 TP_PROTO( !! 968 __print_symbolic(stable, \ 1258 const struct nfs_pgio_header !! 969 { NFS_UNSTABLE, "UNSTABLE" }, \ 1259 int error, !! 970 { NFS_DATA_SYNC, "DATA_SYNC" }, \ 1260 loff_t pos !! 971 { NFS_FILE_SYNC, "FILE_SYNC" }) 1261 ), << 1262 << 1263 TP_ARGS(hdr, error, pos), << 1264 << 1265 TP_STRUCT__entry( << 1266 __field(dev_t, dev) << 1267 __field(u32, fhandle) << 1268 __field(u64, fileid) << 1269 __field(loff_t, offset) << 1270 __field(u32, arg_count) << 1271 __field(u32, res_count) << 1272 __field(loff_t, pos) << 1273 __field(int, error) << 1274 ), << 1275 << 1276 TP_fast_assign( << 1277 const struct inode *inode = h << 1278 const struct nfs_inode *nfsi << 1279 const struct nfs_fh *fh = hdr << 1280 hdr << 1281 << 1282 __entry->error = error; << 1283 __entry->offset = hdr->args.o << 1284 __entry->arg_count = hdr->arg << 1285 __entry->res_count = hdr->res << 1286 __entry->dev = inode->i_sb->s << 1287 __entry->fileid = nfsi->filei << 1288 __entry->fhandle = nfs_fhandl << 1289 ), << 1290 << 1291 TP_printk("error=%d fileid=%02x:%02x: << 1292 "offset=%lld count=%u res=% << 1293 MAJOR(__entry->dev), MINOR(__ << 1294 (unsigned long long)__entry-> << 1295 (long long)__entry->offset, _ << 1296 __entry->pos << 1297 ) << 1298 ); << 1299 972 1300 TRACE_EVENT(nfs_initiate_write, 973 TRACE_EVENT(nfs_initiate_write, 1301 TP_PROTO( 974 TP_PROTO( 1302 const struct nfs_pgio 975 const struct nfs_pgio_header *hdr 1303 ), 976 ), 1304 977 1305 TP_ARGS(hdr), 978 TP_ARGS(hdr), 1306 979 1307 TP_STRUCT__entry( 980 TP_STRUCT__entry( 1308 __field(dev_t, dev) 981 __field(dev_t, dev) 1309 __field(u32, fhandle) 982 __field(u32, fhandle) 1310 __field(u64, fileid) 983 __field(u64, fileid) 1311 __field(loff_t, offse 984 __field(loff_t, offset) 1312 __field(u32, count) 985 __field(u32, count) 1313 __field(unsigned long !! 986 __field(enum nfs3_stable_how, stable) 1314 ), 987 ), 1315 988 1316 TP_fast_assign( 989 TP_fast_assign( 1317 const struct inode *i 990 const struct inode *inode = hdr->inode; 1318 const struct nfs_inod 991 const struct nfs_inode *nfsi = NFS_I(inode); 1319 const struct nfs_fh * 992 const struct nfs_fh *fh = hdr->args.fh ? 1320 993 hdr->args.fh : &nfsi->fh; 1321 994 1322 __entry->offset = hdr 995 __entry->offset = hdr->args.offset; 1323 __entry->count = hdr- 996 __entry->count = hdr->args.count; 1324 __entry->stable = hdr 997 __entry->stable = hdr->args.stable; 1325 __entry->dev = inode- 998 __entry->dev = inode->i_sb->s_dev; 1326 __entry->fileid = nfs 999 __entry->fileid = nfsi->fileid; 1327 __entry->fhandle = nf 1000 __entry->fhandle = nfs_fhandle_hash(fh); 1328 ), 1001 ), 1329 1002 1330 TP_printk( 1003 TP_printk( 1331 "fileid=%02x:%02x:%ll 1004 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1332 "offset=%lld count=%u 1005 "offset=%lld count=%u stable=%s", 1333 MAJOR(__entry->dev), 1006 MAJOR(__entry->dev), MINOR(__entry->dev), 1334 (unsigned long long)_ 1007 (unsigned long long)__entry->fileid, 1335 __entry->fhandle, 1008 __entry->fhandle, 1336 (long long)__entry->o 1009 (long long)__entry->offset, __entry->count, 1337 show_nfs_stable_how(_ !! 1010 nfs_show_stable(__entry->stable) 1338 ) 1011 ) 1339 ); 1012 ); 1340 1013 1341 TRACE_EVENT(nfs_writeback_done, 1014 TRACE_EVENT(nfs_writeback_done, 1342 TP_PROTO( 1015 TP_PROTO( 1343 const struct rpc_task 1016 const struct rpc_task *task, 1344 const struct nfs_pgio 1017 const struct nfs_pgio_header *hdr 1345 ), 1018 ), 1346 1019 1347 TP_ARGS(task, hdr), 1020 TP_ARGS(task, hdr), 1348 1021 1349 TP_STRUCT__entry( 1022 TP_STRUCT__entry( 1350 __field(dev_t, dev) 1023 __field(dev_t, dev) 1351 __field(u32, fhandle) 1024 __field(u32, fhandle) 1352 __field(u64, fileid) 1025 __field(u64, fileid) 1353 __field(loff_t, offse 1026 __field(loff_t, offset) 1354 __field(u32, arg_coun 1027 __field(u32, arg_count) 1355 __field(u32, res_coun 1028 __field(u32, res_count) 1356 __field(int, error) !! 1029 __field(int, status) 1357 __field(unsigned long !! 1030 __field(enum nfs3_stable_how, stable) 1358 __array(char, verifie 1031 __array(char, verifier, NFS4_VERIFIER_SIZE) 1359 ), 1032 ), 1360 1033 1361 TP_fast_assign( 1034 TP_fast_assign( 1362 const struct inode *i 1035 const struct inode *inode = hdr->inode; 1363 const struct nfs_inod 1036 const struct nfs_inode *nfsi = NFS_I(inode); 1364 const struct nfs_fh * 1037 const struct nfs_fh *fh = hdr->args.fh ? 1365 1038 hdr->args.fh : &nfsi->fh; 1366 const struct nfs_writ 1039 const struct nfs_writeverf *verf = hdr->res.verf; 1367 1040 1368 __entry->error = task !! 1041 __entry->status = task->tk_status; 1369 __entry->offset = hdr 1042 __entry->offset = hdr->args.offset; 1370 __entry->arg_count = 1043 __entry->arg_count = hdr->args.count; 1371 __entry->res_count = 1044 __entry->res_count = hdr->res.count; 1372 __entry->stable = ver 1045 __entry->stable = verf->committed; 1373 memcpy(__entry->verif 1046 memcpy(__entry->verifier, 1374 &verf->verifi 1047 &verf->verifier, 1375 NFS4_VERIFIER 1048 NFS4_VERIFIER_SIZE); 1376 __entry->dev = inode- 1049 __entry->dev = inode->i_sb->s_dev; 1377 __entry->fileid = nfs 1050 __entry->fileid = nfsi->fileid; 1378 __entry->fhandle = nf 1051 __entry->fhandle = nfs_fhandle_hash(fh); 1379 ), 1052 ), 1380 1053 1381 TP_printk( 1054 TP_printk( 1382 "error=%d fileid=%02x !! 1055 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1383 "offset=%lld count=%u !! 1056 "offset=%lld count=%u res=%u status=%d stable=%s " 1384 "verifier=%s", __entr !! 1057 "verifier=%s", 1385 MAJOR(__entry->dev), 1058 MAJOR(__entry->dev), MINOR(__entry->dev), 1386 (unsigned long long)_ 1059 (unsigned long long)__entry->fileid, 1387 __entry->fhandle, 1060 __entry->fhandle, 1388 (long long)__entry->o 1061 (long long)__entry->offset, __entry->arg_count, 1389 __entry->res_count, !! 1062 __entry->res_count, __entry->status, 1390 show_nfs_stable_how(_ !! 1063 nfs_show_stable(__entry->stable), 1391 show_nfs4_verifier(__ !! 1064 __print_hex_str(__entry->verifier, NFS4_VERIFIER_SIZE) 1392 ) 1065 ) 1393 ); 1066 ); 1394 1067 1395 DECLARE_EVENT_CLASS(nfs_page_error_class, 1068 DECLARE_EVENT_CLASS(nfs_page_error_class, 1396 TP_PROTO( 1069 TP_PROTO( 1397 const struct inode *i << 1398 const struct nfs_page 1070 const struct nfs_page *req, 1399 int error 1071 int error 1400 ), 1072 ), 1401 1073 1402 TP_ARGS(inode, req, error), !! 1074 TP_ARGS(req, error), 1403 1075 1404 TP_STRUCT__entry( 1076 TP_STRUCT__entry( 1405 __field(dev_t, dev) !! 1077 __field(const void *, req) 1406 __field(u32, fhandle) !! 1078 __field(pgoff_t, index) 1407 __field(u64, fileid) !! 1079 __field(unsigned int, offset) 1408 __field(loff_t, offse !! 1080 __field(unsigned int, pgbase) 1409 __field(unsigned int, !! 1081 __field(unsigned int, bytes) 1410 __field(int, error) 1082 __field(int, error) 1411 ), 1083 ), 1412 1084 1413 TP_fast_assign( 1085 TP_fast_assign( 1414 const struct nfs_inod !! 1086 __entry->req = req; 1415 __entry->dev = inode- !! 1087 __entry->index = req->wb_index; 1416 __entry->fileid = nfs !! 1088 __entry->offset = req->wb_offset; 1417 __entry->fhandle = nf !! 1089 __entry->pgbase = req->wb_pgbase; 1418 __entry->offset = req !! 1090 __entry->bytes = req->wb_bytes; 1419 __entry->count = req- << 1420 __entry->error = erro 1091 __entry->error = error; 1421 ), 1092 ), 1422 1093 1423 TP_printk( 1094 TP_printk( 1424 "error=%d fileid=%02x !! 1095 "req=%p index=%lu offset=%u pgbase=%u bytes=%u error=%d", 1425 "offset=%lld count=%u !! 1096 __entry->req, __entry->index, __entry->offset, 1426 MAJOR(__entry->dev), !! 1097 __entry->pgbase, __entry->bytes, __entry->error 1427 (unsigned long long)_ << 1428 __entry->fhandle, __e << 1429 __entry->count << 1430 ) 1098 ) 1431 ); 1099 ); 1432 1100 1433 #define DEFINE_NFS_PAGEERR_EVENT(name) \ 1101 #define DEFINE_NFS_PAGEERR_EVENT(name) \ 1434 DEFINE_EVENT(nfs_page_error_class, na 1102 DEFINE_EVENT(nfs_page_error_class, name, \ 1435 TP_PROTO( \ 1103 TP_PROTO( \ 1436 const struct << 1437 const struct 1104 const struct nfs_page *req, \ 1438 int error \ 1105 int error \ 1439 ), \ 1106 ), \ 1440 TP_ARGS(inode, req, e !! 1107 TP_ARGS(req, error)) 1441 1108 1442 DEFINE_NFS_PAGEERR_EVENT(nfs_write_error); 1109 DEFINE_NFS_PAGEERR_EVENT(nfs_write_error); 1443 DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error); 1110 DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error); 1444 DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error); 1111 DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error); 1445 1112 1446 TRACE_EVENT(nfs_initiate_commit, 1113 TRACE_EVENT(nfs_initiate_commit, 1447 TP_PROTO( 1114 TP_PROTO( 1448 const struct nfs_comm 1115 const struct nfs_commit_data *data 1449 ), 1116 ), 1450 1117 1451 TP_ARGS(data), 1118 TP_ARGS(data), 1452 1119 1453 TP_STRUCT__entry( 1120 TP_STRUCT__entry( 1454 __field(dev_t, dev) 1121 __field(dev_t, dev) 1455 __field(u32, fhandle) 1122 __field(u32, fhandle) 1456 __field(u64, fileid) 1123 __field(u64, fileid) 1457 __field(loff_t, offse 1124 __field(loff_t, offset) 1458 __field(u32, count) 1125 __field(u32, count) 1459 ), 1126 ), 1460 1127 1461 TP_fast_assign( 1128 TP_fast_assign( 1462 const struct inode *i 1129 const struct inode *inode = data->inode; 1463 const struct nfs_inod 1130 const struct nfs_inode *nfsi = NFS_I(inode); 1464 const struct nfs_fh * 1131 const struct nfs_fh *fh = data->args.fh ? 1465 1132 data->args.fh : &nfsi->fh; 1466 1133 1467 __entry->offset = dat 1134 __entry->offset = data->args.offset; 1468 __entry->count = data 1135 __entry->count = data->args.count; 1469 __entry->dev = inode- 1136 __entry->dev = inode->i_sb->s_dev; 1470 __entry->fileid = nfs 1137 __entry->fileid = nfsi->fileid; 1471 __entry->fhandle = nf 1138 __entry->fhandle = nfs_fhandle_hash(fh); 1472 ), 1139 ), 1473 1140 1474 TP_printk( 1141 TP_printk( 1475 "fileid=%02x:%02x:%ll 1142 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1476 "offset=%lld count=%u 1143 "offset=%lld count=%u", 1477 MAJOR(__entry->dev), 1144 MAJOR(__entry->dev), MINOR(__entry->dev), 1478 (unsigned long long)_ 1145 (unsigned long long)__entry->fileid, 1479 __entry->fhandle, 1146 __entry->fhandle, 1480 (long long)__entry->o 1147 (long long)__entry->offset, __entry->count 1481 ) 1148 ) 1482 ); 1149 ); 1483 1150 1484 TRACE_EVENT(nfs_commit_done, 1151 TRACE_EVENT(nfs_commit_done, 1485 TP_PROTO( 1152 TP_PROTO( 1486 const struct rpc_task 1153 const struct rpc_task *task, 1487 const struct nfs_comm 1154 const struct nfs_commit_data *data 1488 ), 1155 ), 1489 1156 1490 TP_ARGS(task, data), 1157 TP_ARGS(task, data), 1491 1158 1492 TP_STRUCT__entry( 1159 TP_STRUCT__entry( 1493 __field(dev_t, dev) 1160 __field(dev_t, dev) 1494 __field(u32, fhandle) 1161 __field(u32, fhandle) 1495 __field(u64, fileid) 1162 __field(u64, fileid) 1496 __field(loff_t, offse 1163 __field(loff_t, offset) 1497 __field(int, error) !! 1164 __field(int, status) 1498 __field(unsigned long !! 1165 __field(enum nfs3_stable_how, stable) 1499 __array(char, verifie 1166 __array(char, verifier, NFS4_VERIFIER_SIZE) 1500 ), 1167 ), 1501 1168 1502 TP_fast_assign( 1169 TP_fast_assign( 1503 const struct inode *i 1170 const struct inode *inode = data->inode; 1504 const struct nfs_inod 1171 const struct nfs_inode *nfsi = NFS_I(inode); 1505 const struct nfs_fh * 1172 const struct nfs_fh *fh = data->args.fh ? 1506 1173 data->args.fh : &nfsi->fh; 1507 const struct nfs_writ 1174 const struct nfs_writeverf *verf = data->res.verf; 1508 1175 1509 __entry->error = task !! 1176 __entry->status = task->tk_status; 1510 __entry->offset = dat 1177 __entry->offset = data->args.offset; 1511 __entry->stable = ver 1178 __entry->stable = verf->committed; 1512 memcpy(__entry->verif 1179 memcpy(__entry->verifier, 1513 &verf->verifi 1180 &verf->verifier, 1514 NFS4_VERIFIER 1181 NFS4_VERIFIER_SIZE); 1515 __entry->dev = inode- 1182 __entry->dev = inode->i_sb->s_dev; 1516 __entry->fileid = nfs 1183 __entry->fileid = nfsi->fileid; 1517 __entry->fhandle = nf 1184 __entry->fhandle = nfs_fhandle_hash(fh); 1518 ), 1185 ), 1519 1186 1520 TP_printk( 1187 TP_printk( 1521 "error=%d fileid=%02x !! 1188 "fileid=%02x:%02x:%llu fhandle=0x%08x " 1522 "offset=%lld stable=% !! 1189 "offset=%lld status=%d stable=%s verifier=%s", 1523 MAJOR(__entry->dev), 1190 MAJOR(__entry->dev), MINOR(__entry->dev), 1524 (unsigned long long)_ 1191 (unsigned long long)__entry->fileid, 1525 __entry->fhandle, 1192 __entry->fhandle, 1526 (long long)__entry->o !! 1193 (long long)__entry->offset, __entry->status, 1527 show_nfs_stable_how(_ !! 1194 nfs_show_stable(__entry->stable), 1528 show_nfs4_verifier(__ !! 1195 __print_hex_str(__entry->verifier, NFS4_VERIFIER_SIZE) 1529 ) 1196 ) 1530 ); 1197 ); 1531 1198 1532 #define nfs_show_direct_req_flags(v) \ << 1533 __print_flags(v, "|", \ << 1534 { NFS_ODIRECT_DO_COMM << 1535 { NFS_ODIRECT_RESCHED << 1536 { NFS_ODIRECT_SHOULD_ << 1537 { NFS_ODIRECT_DONE, " << 1538 << 1539 DECLARE_EVENT_CLASS(nfs_direct_req_class, << 1540 TP_PROTO( << 1541 const struct nfs_dire << 1542 ), << 1543 << 1544 TP_ARGS(dreq), << 1545 << 1546 TP_STRUCT__entry( << 1547 __field(dev_t, dev) << 1548 __field(u64, fileid) << 1549 __field(u32, fhandle) << 1550 __field(loff_t, offse << 1551 __field(ssize_t, coun << 1552 __field(ssize_t, erro << 1553 __field(int, flags) << 1554 ), << 1555 << 1556 TP_fast_assign( << 1557 const struct inode *i << 1558 const struct nfs_inod << 1559 const struct nfs_fh * << 1560 << 1561 __entry->dev = inode- << 1562 __entry->fileid = nfs << 1563 __entry->fhandle = nf << 1564 __entry->offset = dre << 1565 __entry->count = dreq << 1566 __entry->error = dreq << 1567 __entry->flags = dreq << 1568 ), << 1569 << 1570 TP_printk( << 1571 "error=%zd fileid=%02 << 1572 "offset=%lld count=%z << 1573 __entry->error, MAJOR << 1574 MINOR(__entry->dev), << 1575 (unsigned long long)_ << 1576 __entry->fhandle, __e << 1577 __entry->count, << 1578 nfs_show_direct_req_f << 1579 ) << 1580 ); << 1581 << 1582 #define DEFINE_NFS_DIRECT_REQ_EVENT(name) \ << 1583 DEFINE_EVENT(nfs_direct_req_class, na << 1584 TP_PROTO( \ << 1585 const struct << 1586 ), \ << 1587 TP_ARGS(dreq)) << 1588 << 1589 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_commit << 1590 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_resche << 1591 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_ << 1592 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_ << 1593 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_ << 1594 DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_ << 1595 << 1596 TRACE_EVENT(nfs_fh_to_dentry, 1199 TRACE_EVENT(nfs_fh_to_dentry, 1597 TP_PROTO( 1200 TP_PROTO( 1598 const struct super_bl 1201 const struct super_block *sb, 1599 const struct nfs_fh * 1202 const struct nfs_fh *fh, 1600 u64 fileid, 1203 u64 fileid, 1601 int error 1204 int error 1602 ), 1205 ), 1603 1206 1604 TP_ARGS(sb, fh, fileid, error 1207 TP_ARGS(sb, fh, fileid, error), 1605 1208 1606 TP_STRUCT__entry( 1209 TP_STRUCT__entry( 1607 __field(int, error) 1210 __field(int, error) 1608 __field(dev_t, dev) 1211 __field(dev_t, dev) 1609 __field(u32, fhandle) 1212 __field(u32, fhandle) 1610 __field(u64, fileid) 1213 __field(u64, fileid) 1611 ), 1214 ), 1612 1215 1613 TP_fast_assign( 1216 TP_fast_assign( 1614 __entry->error = erro 1217 __entry->error = error; 1615 __entry->dev = sb->s_ 1218 __entry->dev = sb->s_dev; 1616 __entry->fileid = fil 1219 __entry->fileid = fileid; 1617 __entry->fhandle = nf 1220 __entry->fhandle = nfs_fhandle_hash(fh); 1618 ), 1221 ), 1619 1222 1620 TP_printk( 1223 TP_printk( 1621 "error=%d fileid=%02x 1224 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ", 1622 __entry->error, 1225 __entry->error, 1623 MAJOR(__entry->dev), 1226 MAJOR(__entry->dev), MINOR(__entry->dev), 1624 (unsigned long long)_ 1227 (unsigned long long)__entry->fileid, 1625 __entry->fhandle 1228 __entry->fhandle 1626 ) 1229 ) 1627 ); 1230 ); 1628 1231 1629 TRACE_EVENT(nfs_mount_assign, !! 1232 TRACE_DEFINE_ENUM(NFS_OK); 1630 TP_PROTO( !! 1233 TRACE_DEFINE_ENUM(NFSERR_PERM); 1631 const char *option, !! 1234 TRACE_DEFINE_ENUM(NFSERR_NOENT); 1632 const char *value !! 1235 TRACE_DEFINE_ENUM(NFSERR_IO); 1633 ), !! 1236 TRACE_DEFINE_ENUM(NFSERR_NXIO); 1634 !! 1237 TRACE_DEFINE_ENUM(ECHILD); 1635 TP_ARGS(option, value), !! 1238 TRACE_DEFINE_ENUM(NFSERR_EAGAIN); >> 1239 TRACE_DEFINE_ENUM(NFSERR_ACCES); >> 1240 TRACE_DEFINE_ENUM(NFSERR_EXIST); >> 1241 TRACE_DEFINE_ENUM(NFSERR_XDEV); >> 1242 TRACE_DEFINE_ENUM(NFSERR_NODEV); >> 1243 TRACE_DEFINE_ENUM(NFSERR_NOTDIR); >> 1244 TRACE_DEFINE_ENUM(NFSERR_ISDIR); >> 1245 TRACE_DEFINE_ENUM(NFSERR_INVAL); >> 1246 TRACE_DEFINE_ENUM(NFSERR_FBIG); >> 1247 TRACE_DEFINE_ENUM(NFSERR_NOSPC); >> 1248 TRACE_DEFINE_ENUM(NFSERR_ROFS); >> 1249 TRACE_DEFINE_ENUM(NFSERR_MLINK); >> 1250 TRACE_DEFINE_ENUM(NFSERR_OPNOTSUPP); >> 1251 TRACE_DEFINE_ENUM(NFSERR_NAMETOOLONG); >> 1252 TRACE_DEFINE_ENUM(NFSERR_NOTEMPTY); >> 1253 TRACE_DEFINE_ENUM(NFSERR_DQUOT); >> 1254 TRACE_DEFINE_ENUM(NFSERR_STALE); >> 1255 TRACE_DEFINE_ENUM(NFSERR_REMOTE); >> 1256 TRACE_DEFINE_ENUM(NFSERR_WFLUSH); >> 1257 TRACE_DEFINE_ENUM(NFSERR_BADHANDLE); >> 1258 TRACE_DEFINE_ENUM(NFSERR_NOT_SYNC); >> 1259 TRACE_DEFINE_ENUM(NFSERR_BAD_COOKIE); >> 1260 TRACE_DEFINE_ENUM(NFSERR_NOTSUPP); >> 1261 TRACE_DEFINE_ENUM(NFSERR_TOOSMALL); >> 1262 TRACE_DEFINE_ENUM(NFSERR_SERVERFAULT); >> 1263 TRACE_DEFINE_ENUM(NFSERR_BADTYPE); >> 1264 TRACE_DEFINE_ENUM(NFSERR_JUKEBOX); >> 1265 >> 1266 #define nfs_show_status(x) \ >> 1267 __print_symbolic(x, \ >> 1268 { NFS_OK, "OK" }, \ >> 1269 { NFSERR_PERM, "PERM" }, \ >> 1270 { NFSERR_NOENT, "NOENT" }, \ >> 1271 { NFSERR_IO, "IO" }, \ >> 1272 { NFSERR_NXIO, "NXIO" }, \ >> 1273 { ECHILD, "CHILD" }, \ >> 1274 { NFSERR_EAGAIN, "AGAIN" }, \ >> 1275 { NFSERR_ACCES, "ACCES" }, \ >> 1276 { NFSERR_EXIST, "EXIST" }, \ >> 1277 { NFSERR_XDEV, "XDEV" }, \ >> 1278 { NFSERR_NODEV, "NODEV" }, \ >> 1279 { NFSERR_NOTDIR, "NOTDIR" }, \ >> 1280 { NFSERR_ISDIR, "ISDIR" }, \ >> 1281 { NFSERR_INVAL, "INVAL" }, \ >> 1282 { NFSERR_FBIG, "FBIG" }, \ >> 1283 { NFSERR_NOSPC, "NOSPC" }, \ >> 1284 { NFSERR_ROFS, "ROFS" }, \ >> 1285 { NFSERR_MLINK, "MLINK" }, \ >> 1286 { NFSERR_OPNOTSUPP, "OPNOTSUPP" }, \ >> 1287 { NFSERR_NAMETOOLONG, "NAMETOOLONG" }, \ >> 1288 { NFSERR_NOTEMPTY, "NOTEMPTY" }, \ >> 1289 { NFSERR_DQUOT, "DQUOT" }, \ >> 1290 { NFSERR_STALE, "STALE" }, \ >> 1291 { NFSERR_REMOTE, "REMOTE" }, \ >> 1292 { NFSERR_WFLUSH, "WFLUSH" }, \ >> 1293 { NFSERR_BADHANDLE, "BADHANDLE" }, \ >> 1294 { NFSERR_NOT_SYNC, "NOTSYNC" }, \ >> 1295 { NFSERR_BAD_COOKIE, "BADCOOKIE" }, \ >> 1296 { NFSERR_NOTSUPP, "NOTSUPP" }, \ >> 1297 { NFSERR_TOOSMALL, "TOOSMALL" }, \ >> 1298 { NFSERR_SERVERFAULT, "REMOTEIO" }, \ >> 1299 { NFSERR_BADTYPE, "BADTYPE" }, \ >> 1300 { NFSERR_JUKEBOX, "JUKEBOX" }) 1636 1301 1637 TP_STRUCT__entry( !! 1302 TRACE_EVENT(nfs_xdr_status, 1638 __string(option, option) << 1639 __string(value, value) << 1640 ), << 1641 << 1642 TP_fast_assign( << 1643 __assign_str(option); << 1644 __assign_str(value); << 1645 ), << 1646 << 1647 TP_printk("option %s=%s", << 1648 __get_str(option), __get_str( << 1649 ) << 1650 ); << 1651 << 1652 TRACE_EVENT(nfs_mount_option, << 1653 TP_PROTO( << 1654 const struct fs_parameter *pa << 1655 ), << 1656 << 1657 TP_ARGS(param), << 1658 << 1659 TP_STRUCT__entry( << 1660 __string(option, param->key) << 1661 ), << 1662 << 1663 TP_fast_assign( << 1664 __assign_str(option); << 1665 ), << 1666 << 1667 TP_printk("option %s", __get_str(opti << 1668 ); << 1669 << 1670 TRACE_EVENT(nfs_mount_path, << 1671 TP_PROTO( << 1672 const char *path << 1673 ), << 1674 << 1675 TP_ARGS(path), << 1676 << 1677 TP_STRUCT__entry( << 1678 __string(path, path) << 1679 ), << 1680 << 1681 TP_fast_assign( << 1682 __assign_str(path); << 1683 ), << 1684 << 1685 TP_printk("path='%s'", __get_str(path << 1686 ); << 1687 << 1688 DECLARE_EVENT_CLASS(nfs_xdr_event, << 1689 TP_PROTO( 1303 TP_PROTO( 1690 const struct xdr_stre 1304 const struct xdr_stream *xdr, 1691 int error 1305 int error 1692 ), 1306 ), 1693 1307 1694 TP_ARGS(xdr, error), 1308 TP_ARGS(xdr, error), 1695 1309 1696 TP_STRUCT__entry( 1310 TP_STRUCT__entry( 1697 __field(unsigned int, 1311 __field(unsigned int, task_id) 1698 __field(unsigned int, 1312 __field(unsigned int, client_id) 1699 __field(u32, xid) 1313 __field(u32, xid) 1700 __field(int, version) << 1701 __field(unsigned long 1314 __field(unsigned long, error) 1702 __string(program, << 1703 xdr->rqst->r << 1704 __string(procedure, << 1705 xdr->rqst->r << 1706 ), 1315 ), 1707 1316 1708 TP_fast_assign( 1317 TP_fast_assign( 1709 const struct rpc_rqst 1318 const struct rpc_rqst *rqstp = xdr->rqst; 1710 const struct rpc_task 1319 const struct rpc_task *task = rqstp->rq_task; 1711 1320 1712 __entry->task_id = ta 1321 __entry->task_id = task->tk_pid; 1713 __entry->client_id = 1322 __entry->client_id = task->tk_client->cl_clid; 1714 __entry->xid = be32_t 1323 __entry->xid = be32_to_cpu(rqstp->rq_xid); 1715 __entry->version = ta << 1716 __entry->error = erro 1324 __entry->error = error; 1717 __assign_str(program) << 1718 __assign_str(procedur << 1719 ), 1325 ), 1720 1326 1721 TP_printk(SUNRPC_TRACE_TASK_S !! 1327 TP_printk( 1722 " xid=0x%08x %sv%d !! 1328 "task:%u@%d xid=0x%08x error=%ld (%s)", 1723 __entry->task_id, __e 1329 __entry->task_id, __entry->client_id, __entry->xid, 1724 __get_str(program), _ !! 1330 -__entry->error, nfs_show_status(__entry->error) 1725 __get_str(procedure), << 1726 show_nfs_status(__ent << 1727 ) 1331 ) 1728 ); 1332 ); 1729 #define DEFINE_NFS_XDR_EVENT(name) \ << 1730 DEFINE_EVENT(nfs_xdr_event, name, \ << 1731 TP_PROTO( \ << 1732 const struct << 1733 int error \ << 1734 ), \ << 1735 TP_ARGS(xdr, error)) << 1736 DEFINE_NFS_XDR_EVENT(nfs_xdr_status); << 1737 DEFINE_NFS_XDR_EVENT(nfs_xdr_bad_filehandle); << 1738 1333 1739 #endif /* _TRACE_NFS_H */ 1334 #endif /* _TRACE_NFS_H */ 1740 1335 1741 #undef TRACE_INCLUDE_PATH 1336 #undef TRACE_INCLUDE_PATH 1742 #define TRACE_INCLUDE_PATH . 1337 #define TRACE_INCLUDE_PATH . 1743 #define TRACE_INCLUDE_FILE nfstrace 1338 #define TRACE_INCLUDE_FILE nfstrace 1744 /* This part must be outside protection */ 1339 /* This part must be outside protection */ 1745 #include <trace/define_trace.h> 1340 #include <trace/define_trace.h> 1746 1341
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.