Linux 5.7.6
[linux/fpc-iii.git] / fs / nfs / nfstrace.h
blob7e7a97ae21ede36c408dae292c9847e786775772
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
4 */
5 #undef TRACE_SYSTEM
6 #define TRACE_SYSTEM nfs
8 #if !defined(_TRACE_NFS_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _TRACE_NFS_H
11 #include <linux/tracepoint.h>
12 #include <linux/iversion.h>
14 TRACE_DEFINE_ENUM(DT_UNKNOWN);
15 TRACE_DEFINE_ENUM(DT_FIFO);
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);
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" })
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);
49 #define nfs_show_cache_validity(v) \
50 __print_flags(v, "|", \
51 { NFS_INO_INVALID_DATA, "INVALID_DATA" }, \
52 { NFS_INO_INVALID_ATIME, "INVALID_ATIME" }, \
53 { NFS_INO_INVALID_ACCESS, "INVALID_ACCESS" }, \
54 { NFS_INO_INVALID_ACL, "INVALID_ACL" }, \
55 { NFS_INO_REVAL_PAGECACHE, "REVAL_PAGECACHE" }, \
56 { NFS_INO_REVAL_FORCED, "REVAL_FORCED" }, \
57 { NFS_INO_INVALID_LABEL, "INVALID_LABEL" }, \
58 { NFS_INO_INVALID_CHANGE, "INVALID_CHANGE" }, \
59 { NFS_INO_INVALID_CTIME, "INVALID_CTIME" }, \
60 { NFS_INO_INVALID_MTIME, "INVALID_MTIME" }, \
61 { NFS_INO_INVALID_SIZE, "INVALID_SIZE" }, \
62 { NFS_INO_INVALID_OTHER, "INVALID_OTHER" })
64 TRACE_DEFINE_ENUM(NFS_INO_ADVISE_RDPLUS);
65 TRACE_DEFINE_ENUM(NFS_INO_STALE);
66 TRACE_DEFINE_ENUM(NFS_INO_ACL_LRU_SET);
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);
75 #define nfs_show_nfsi_flags(v) \
76 __print_flags(v, "|", \
77 { BIT(NFS_INO_ADVISE_RDPLUS), "ADVISE_RDPLUS" }, \
78 { BIT(NFS_INO_STALE), "STALE" }, \
79 { BIT(NFS_INO_ACL_LRU_SET), "ACL_LRU_SET" }, \
80 { BIT(NFS_INO_INVALIDATING), "INVALIDATING" }, \
81 { BIT(NFS_INO_FSCACHE), "FSCACHE" }, \
82 { BIT(NFS_INO_FSCACHE_LOCK), "FSCACHE_LOCK" }, \
83 { BIT(NFS_INO_LAYOUTCOMMIT), "NEED_LAYOUTCOMMIT" }, \
84 { BIT(NFS_INO_LAYOUTCOMMITTING), "LAYOUTCOMMIT" }, \
85 { BIT(NFS_INO_LAYOUTSTATS), "LAYOUTSTATS" }, \
86 { BIT(NFS_INO_ODIRECT), "ODIRECT" })
88 DECLARE_EVENT_CLASS(nfs_inode_event,
89 TP_PROTO(
90 const struct inode *inode
93 TP_ARGS(inode),
95 TP_STRUCT__entry(
96 __field(dev_t, dev)
97 __field(u32, fhandle)
98 __field(u64, fileid)
99 __field(u64, version)
102 TP_fast_assign(
103 const struct nfs_inode *nfsi = NFS_I(inode);
104 __entry->dev = inode->i_sb->s_dev;
105 __entry->fileid = nfsi->fileid;
106 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
107 __entry->version = inode_peek_iversion_raw(inode);
110 TP_printk(
111 "fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ",
112 MAJOR(__entry->dev), MINOR(__entry->dev),
113 (unsigned long long)__entry->fileid,
114 __entry->fhandle,
115 (unsigned long long)__entry->version
119 DECLARE_EVENT_CLASS(nfs_inode_event_done,
120 TP_PROTO(
121 const struct inode *inode,
122 int error
125 TP_ARGS(inode, error),
127 TP_STRUCT__entry(
128 __field(unsigned long, error)
129 __field(dev_t, dev)
130 __field(u32, fhandle)
131 __field(unsigned char, type)
132 __field(u64, fileid)
133 __field(u64, version)
134 __field(loff_t, size)
135 __field(unsigned long, nfsi_flags)
136 __field(unsigned long, cache_validity)
139 TP_fast_assign(
140 const struct nfs_inode *nfsi = NFS_I(inode);
141 __entry->error = error < 0 ? -error : 0;
142 __entry->dev = inode->i_sb->s_dev;
143 __entry->fileid = nfsi->fileid;
144 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
145 __entry->type = nfs_umode_to_dtype(inode->i_mode);
146 __entry->version = inode_peek_iversion_raw(inode);
147 __entry->size = i_size_read(inode);
148 __entry->nfsi_flags = nfsi->flags;
149 __entry->cache_validity = nfsi->cache_validity;
152 TP_printk(
153 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
154 "type=%u (%s) version=%llu size=%lld "
155 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s)",
156 -__entry->error, nfs_show_status(__entry->error),
157 MAJOR(__entry->dev), MINOR(__entry->dev),
158 (unsigned long long)__entry->fileid,
159 __entry->fhandle,
160 __entry->type,
161 nfs_show_file_type(__entry->type),
162 (unsigned long long)__entry->version,
163 (long long)__entry->size,
164 __entry->cache_validity,
165 nfs_show_cache_validity(__entry->cache_validity),
166 __entry->nfsi_flags,
167 nfs_show_nfsi_flags(__entry->nfsi_flags)
171 #define DEFINE_NFS_INODE_EVENT(name) \
172 DEFINE_EVENT(nfs_inode_event, name, \
173 TP_PROTO( \
174 const struct inode *inode \
175 ), \
176 TP_ARGS(inode))
177 #define DEFINE_NFS_INODE_EVENT_DONE(name) \
178 DEFINE_EVENT(nfs_inode_event_done, name, \
179 TP_PROTO( \
180 const struct inode *inode, \
181 int error \
182 ), \
183 TP_ARGS(inode, error))
184 DEFINE_NFS_INODE_EVENT(nfs_set_inode_stale);
185 DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter);
186 DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit);
187 DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter);
188 DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit);
189 DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter);
190 DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit);
191 DEFINE_NFS_INODE_EVENT(nfs_getattr_enter);
192 DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit);
193 DEFINE_NFS_INODE_EVENT(nfs_setattr_enter);
194 DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit);
195 DEFINE_NFS_INODE_EVENT(nfs_writeback_page_enter);
196 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_page_exit);
197 DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter);
198 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit);
199 DEFINE_NFS_INODE_EVENT(nfs_fsync_enter);
200 DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit);
201 DEFINE_NFS_INODE_EVENT(nfs_access_enter);
203 TRACE_EVENT(nfs_access_exit,
204 TP_PROTO(
205 const struct inode *inode,
206 unsigned int mask,
207 unsigned int permitted,
208 int error
211 TP_ARGS(inode, mask, permitted, error),
213 TP_STRUCT__entry(
214 __field(unsigned long, error)
215 __field(dev_t, dev)
216 __field(u32, fhandle)
217 __field(unsigned char, type)
218 __field(u64, fileid)
219 __field(u64, version)
220 __field(loff_t, size)
221 __field(unsigned long, nfsi_flags)
222 __field(unsigned long, cache_validity)
223 __field(unsigned int, mask)
224 __field(unsigned int, permitted)
227 TP_fast_assign(
228 const struct nfs_inode *nfsi = NFS_I(inode);
229 __entry->error = error < 0 ? -error : 0;
230 __entry->dev = inode->i_sb->s_dev;
231 __entry->fileid = nfsi->fileid;
232 __entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
233 __entry->type = nfs_umode_to_dtype(inode->i_mode);
234 __entry->version = inode_peek_iversion_raw(inode);
235 __entry->size = i_size_read(inode);
236 __entry->nfsi_flags = nfsi->flags;
237 __entry->cache_validity = nfsi->cache_validity;
238 __entry->mask = mask;
239 __entry->permitted = permitted;
242 TP_printk(
243 "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
244 "type=%u (%s) version=%llu size=%lld "
245 "cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s) "
246 "mask=0x%x permitted=0x%x",
247 -__entry->error, nfs_show_status(__entry->error),
248 MAJOR(__entry->dev), MINOR(__entry->dev),
249 (unsigned long long)__entry->fileid,
250 __entry->fhandle,
251 __entry->type,
252 nfs_show_file_type(__entry->type),
253 (unsigned long long)__entry->version,
254 (long long)__entry->size,
255 __entry->cache_validity,
256 nfs_show_cache_validity(__entry->cache_validity),
257 __entry->nfsi_flags,
258 nfs_show_nfsi_flags(__entry->nfsi_flags),
259 __entry->mask, __entry->permitted
263 TRACE_DEFINE_ENUM(LOOKUP_FOLLOW);
264 TRACE_DEFINE_ENUM(LOOKUP_DIRECTORY);
265 TRACE_DEFINE_ENUM(LOOKUP_AUTOMOUNT);
266 TRACE_DEFINE_ENUM(LOOKUP_PARENT);
267 TRACE_DEFINE_ENUM(LOOKUP_REVAL);
268 TRACE_DEFINE_ENUM(LOOKUP_RCU);
269 TRACE_DEFINE_ENUM(LOOKUP_OPEN);
270 TRACE_DEFINE_ENUM(LOOKUP_CREATE);
271 TRACE_DEFINE_ENUM(LOOKUP_EXCL);
272 TRACE_DEFINE_ENUM(LOOKUP_RENAME_TARGET);
273 TRACE_DEFINE_ENUM(LOOKUP_JUMPED);
274 TRACE_DEFINE_ENUM(LOOKUP_ROOT);
275 TRACE_DEFINE_ENUM(LOOKUP_EMPTY);
276 TRACE_DEFINE_ENUM(LOOKUP_DOWN);
278 #define show_lookup_flags(flags) \
279 __print_flags(flags, "|", \
280 { LOOKUP_FOLLOW, "FOLLOW" }, \
281 { LOOKUP_DIRECTORY, "DIRECTORY" }, \
282 { LOOKUP_AUTOMOUNT, "AUTOMOUNT" }, \
283 { LOOKUP_PARENT, "PARENT" }, \
284 { LOOKUP_REVAL, "REVAL" }, \
285 { LOOKUP_RCU, "RCU" }, \
286 { LOOKUP_OPEN, "OPEN" }, \
287 { LOOKUP_CREATE, "CREATE" }, \
288 { LOOKUP_EXCL, "EXCL" }, \
289 { LOOKUP_RENAME_TARGET, "RENAME_TARGET" }, \
290 { LOOKUP_JUMPED, "JUMPED" }, \
291 { LOOKUP_ROOT, "ROOT" }, \
292 { LOOKUP_EMPTY, "EMPTY" }, \
293 { LOOKUP_DOWN, "DOWN" })
295 DECLARE_EVENT_CLASS(nfs_lookup_event,
296 TP_PROTO(
297 const struct inode *dir,
298 const struct dentry *dentry,
299 unsigned int flags
302 TP_ARGS(dir, dentry, flags),
304 TP_STRUCT__entry(
305 __field(unsigned long, flags)
306 __field(dev_t, dev)
307 __field(u64, dir)
308 __string(name, dentry->d_name.name)
311 TP_fast_assign(
312 __entry->dev = dir->i_sb->s_dev;
313 __entry->dir = NFS_FILEID(dir);
314 __entry->flags = flags;
315 __assign_str(name, dentry->d_name.name);
318 TP_printk(
319 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
320 __entry->flags,
321 show_lookup_flags(__entry->flags),
322 MAJOR(__entry->dev), MINOR(__entry->dev),
323 (unsigned long long)__entry->dir,
324 __get_str(name)
328 #define DEFINE_NFS_LOOKUP_EVENT(name) \
329 DEFINE_EVENT(nfs_lookup_event, name, \
330 TP_PROTO( \
331 const struct inode *dir, \
332 const struct dentry *dentry, \
333 unsigned int flags \
334 ), \
335 TP_ARGS(dir, dentry, flags))
337 DECLARE_EVENT_CLASS(nfs_lookup_event_done,
338 TP_PROTO(
339 const struct inode *dir,
340 const struct dentry *dentry,
341 unsigned int flags,
342 int error
345 TP_ARGS(dir, dentry, flags, error),
347 TP_STRUCT__entry(
348 __field(unsigned long, error)
349 __field(unsigned long, flags)
350 __field(dev_t, dev)
351 __field(u64, dir)
352 __string(name, dentry->d_name.name)
355 TP_fast_assign(
356 __entry->dev = dir->i_sb->s_dev;
357 __entry->dir = NFS_FILEID(dir);
358 __entry->error = error < 0 ? -error : 0;
359 __entry->flags = flags;
360 __assign_str(name, dentry->d_name.name);
363 TP_printk(
364 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
365 -__entry->error, nfs_show_status(__entry->error),
366 __entry->flags,
367 show_lookup_flags(__entry->flags),
368 MAJOR(__entry->dev), MINOR(__entry->dev),
369 (unsigned long long)__entry->dir,
370 __get_str(name)
374 #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \
375 DEFINE_EVENT(nfs_lookup_event_done, name, \
376 TP_PROTO( \
377 const struct inode *dir, \
378 const struct dentry *dentry, \
379 unsigned int flags, \
380 int error \
381 ), \
382 TP_ARGS(dir, dentry, flags, error))
384 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter);
385 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit);
386 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter);
387 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit);
389 TRACE_DEFINE_ENUM(O_WRONLY);
390 TRACE_DEFINE_ENUM(O_RDWR);
391 TRACE_DEFINE_ENUM(O_CREAT);
392 TRACE_DEFINE_ENUM(O_EXCL);
393 TRACE_DEFINE_ENUM(O_NOCTTY);
394 TRACE_DEFINE_ENUM(O_TRUNC);
395 TRACE_DEFINE_ENUM(O_APPEND);
396 TRACE_DEFINE_ENUM(O_NONBLOCK);
397 TRACE_DEFINE_ENUM(O_DSYNC);
398 TRACE_DEFINE_ENUM(O_DIRECT);
399 TRACE_DEFINE_ENUM(O_LARGEFILE);
400 TRACE_DEFINE_ENUM(O_DIRECTORY);
401 TRACE_DEFINE_ENUM(O_NOFOLLOW);
402 TRACE_DEFINE_ENUM(O_NOATIME);
403 TRACE_DEFINE_ENUM(O_CLOEXEC);
405 #define show_open_flags(flags) \
406 __print_flags(flags, "|", \
407 { O_WRONLY, "O_WRONLY" }, \
408 { O_RDWR, "O_RDWR" }, \
409 { O_CREAT, "O_CREAT" }, \
410 { O_EXCL, "O_EXCL" }, \
411 { O_NOCTTY, "O_NOCTTY" }, \
412 { O_TRUNC, "O_TRUNC" }, \
413 { O_APPEND, "O_APPEND" }, \
414 { O_NONBLOCK, "O_NONBLOCK" }, \
415 { O_DSYNC, "O_DSYNC" }, \
416 { O_DIRECT, "O_DIRECT" }, \
417 { O_LARGEFILE, "O_LARGEFILE" }, \
418 { O_DIRECTORY, "O_DIRECTORY" }, \
419 { O_NOFOLLOW, "O_NOFOLLOW" }, \
420 { O_NOATIME, "O_NOATIME" }, \
421 { O_CLOEXEC, "O_CLOEXEC" })
423 TRACE_DEFINE_ENUM(FMODE_READ);
424 TRACE_DEFINE_ENUM(FMODE_WRITE);
425 TRACE_DEFINE_ENUM(FMODE_EXEC);
427 #define show_fmode_flags(mode) \
428 __print_flags(mode, "|", \
429 { ((__force unsigned long)FMODE_READ), "READ" }, \
430 { ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
431 { ((__force unsigned long)FMODE_EXEC), "EXEC" })
433 TRACE_EVENT(nfs_atomic_open_enter,
434 TP_PROTO(
435 const struct inode *dir,
436 const struct nfs_open_context *ctx,
437 unsigned int flags
440 TP_ARGS(dir, ctx, flags),
442 TP_STRUCT__entry(
443 __field(unsigned long, flags)
444 __field(unsigned int, fmode)
445 __field(dev_t, dev)
446 __field(u64, dir)
447 __string(name, ctx->dentry->d_name.name)
450 TP_fast_assign(
451 __entry->dev = dir->i_sb->s_dev;
452 __entry->dir = NFS_FILEID(dir);
453 __entry->flags = flags;
454 __entry->fmode = (__force unsigned int)ctx->mode;
455 __assign_str(name, ctx->dentry->d_name.name);
458 TP_printk(
459 "flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s",
460 __entry->flags,
461 show_open_flags(__entry->flags),
462 show_fmode_flags(__entry->fmode),
463 MAJOR(__entry->dev), MINOR(__entry->dev),
464 (unsigned long long)__entry->dir,
465 __get_str(name)
469 TRACE_EVENT(nfs_atomic_open_exit,
470 TP_PROTO(
471 const struct inode *dir,
472 const struct nfs_open_context *ctx,
473 unsigned int flags,
474 int error
477 TP_ARGS(dir, ctx, flags, error),
479 TP_STRUCT__entry(
480 __field(unsigned long, error)
481 __field(unsigned long, flags)
482 __field(unsigned int, fmode)
483 __field(dev_t, dev)
484 __field(u64, dir)
485 __string(name, ctx->dentry->d_name.name)
488 TP_fast_assign(
489 __entry->error = -error;
490 __entry->dev = dir->i_sb->s_dev;
491 __entry->dir = NFS_FILEID(dir);
492 __entry->flags = flags;
493 __entry->fmode = (__force unsigned int)ctx->mode;
494 __assign_str(name, ctx->dentry->d_name.name);
497 TP_printk(
498 "error=%ld (%s) flags=0x%lx (%s) fmode=%s "
499 "name=%02x:%02x:%llu/%s",
500 -__entry->error, nfs_show_status(__entry->error),
501 __entry->flags,
502 show_open_flags(__entry->flags),
503 show_fmode_flags(__entry->fmode),
504 MAJOR(__entry->dev), MINOR(__entry->dev),
505 (unsigned long long)__entry->dir,
506 __get_str(name)
510 TRACE_EVENT(nfs_create_enter,
511 TP_PROTO(
512 const struct inode *dir,
513 const struct dentry *dentry,
514 unsigned int flags
517 TP_ARGS(dir, dentry, flags),
519 TP_STRUCT__entry(
520 __field(unsigned long, flags)
521 __field(dev_t, dev)
522 __field(u64, dir)
523 __string(name, dentry->d_name.name)
526 TP_fast_assign(
527 __entry->dev = dir->i_sb->s_dev;
528 __entry->dir = NFS_FILEID(dir);
529 __entry->flags = flags;
530 __assign_str(name, dentry->d_name.name);
533 TP_printk(
534 "flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
535 __entry->flags,
536 show_open_flags(__entry->flags),
537 MAJOR(__entry->dev), MINOR(__entry->dev),
538 (unsigned long long)__entry->dir,
539 __get_str(name)
543 TRACE_EVENT(nfs_create_exit,
544 TP_PROTO(
545 const struct inode *dir,
546 const struct dentry *dentry,
547 unsigned int flags,
548 int error
551 TP_ARGS(dir, dentry, flags, error),
553 TP_STRUCT__entry(
554 __field(unsigned long, error)
555 __field(unsigned long, flags)
556 __field(dev_t, dev)
557 __field(u64, dir)
558 __string(name, dentry->d_name.name)
561 TP_fast_assign(
562 __entry->error = -error;
563 __entry->dev = dir->i_sb->s_dev;
564 __entry->dir = NFS_FILEID(dir);
565 __entry->flags = flags;
566 __assign_str(name, dentry->d_name.name);
569 TP_printk(
570 "error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
571 -__entry->error, nfs_show_status(__entry->error),
572 __entry->flags,
573 show_open_flags(__entry->flags),
574 MAJOR(__entry->dev), MINOR(__entry->dev),
575 (unsigned long long)__entry->dir,
576 __get_str(name)
580 DECLARE_EVENT_CLASS(nfs_directory_event,
581 TP_PROTO(
582 const struct inode *dir,
583 const struct dentry *dentry
586 TP_ARGS(dir, dentry),
588 TP_STRUCT__entry(
589 __field(dev_t, dev)
590 __field(u64, dir)
591 __string(name, dentry->d_name.name)
594 TP_fast_assign(
595 __entry->dev = dir->i_sb->s_dev;
596 __entry->dir = NFS_FILEID(dir);
597 __assign_str(name, dentry->d_name.name);
600 TP_printk(
601 "name=%02x:%02x:%llu/%s",
602 MAJOR(__entry->dev), MINOR(__entry->dev),
603 (unsigned long long)__entry->dir,
604 __get_str(name)
608 #define DEFINE_NFS_DIRECTORY_EVENT(name) \
609 DEFINE_EVENT(nfs_directory_event, name, \
610 TP_PROTO( \
611 const struct inode *dir, \
612 const struct dentry *dentry \
613 ), \
614 TP_ARGS(dir, dentry))
616 DECLARE_EVENT_CLASS(nfs_directory_event_done,
617 TP_PROTO(
618 const struct inode *dir,
619 const struct dentry *dentry,
620 int error
623 TP_ARGS(dir, dentry, error),
625 TP_STRUCT__entry(
626 __field(unsigned long, error)
627 __field(dev_t, dev)
628 __field(u64, dir)
629 __string(name, dentry->d_name.name)
632 TP_fast_assign(
633 __entry->dev = dir->i_sb->s_dev;
634 __entry->dir = NFS_FILEID(dir);
635 __entry->error = error < 0 ? -error : 0;
636 __assign_str(name, dentry->d_name.name);
639 TP_printk(
640 "error=%ld (%s) name=%02x:%02x:%llu/%s",
641 -__entry->error, nfs_show_status(__entry->error),
642 MAJOR(__entry->dev), MINOR(__entry->dev),
643 (unsigned long long)__entry->dir,
644 __get_str(name)
648 #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \
649 DEFINE_EVENT(nfs_directory_event_done, name, \
650 TP_PROTO( \
651 const struct inode *dir, \
652 const struct dentry *dentry, \
653 int error \
654 ), \
655 TP_ARGS(dir, dentry, error))
657 DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter);
658 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit);
659 DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter);
660 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit);
661 DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter);
662 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit);
663 DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter);
664 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit);
665 DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter);
666 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit);
667 DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter);
668 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit);
670 TRACE_EVENT(nfs_link_enter,
671 TP_PROTO(
672 const struct inode *inode,
673 const struct inode *dir,
674 const struct dentry *dentry
677 TP_ARGS(inode, dir, dentry),
679 TP_STRUCT__entry(
680 __field(dev_t, dev)
681 __field(u64, fileid)
682 __field(u64, dir)
683 __string(name, dentry->d_name.name)
686 TP_fast_assign(
687 __entry->dev = inode->i_sb->s_dev;
688 __entry->fileid = NFS_FILEID(inode);
689 __entry->dir = NFS_FILEID(dir);
690 __assign_str(name, dentry->d_name.name);
693 TP_printk(
694 "fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
695 MAJOR(__entry->dev), MINOR(__entry->dev),
696 __entry->fileid,
697 MAJOR(__entry->dev), MINOR(__entry->dev),
698 (unsigned long long)__entry->dir,
699 __get_str(name)
703 TRACE_EVENT(nfs_link_exit,
704 TP_PROTO(
705 const struct inode *inode,
706 const struct inode *dir,
707 const struct dentry *dentry,
708 int error
711 TP_ARGS(inode, dir, dentry, error),
713 TP_STRUCT__entry(
714 __field(unsigned long, error)
715 __field(dev_t, dev)
716 __field(u64, fileid)
717 __field(u64, dir)
718 __string(name, dentry->d_name.name)
721 TP_fast_assign(
722 __entry->dev = inode->i_sb->s_dev;
723 __entry->fileid = NFS_FILEID(inode);
724 __entry->dir = NFS_FILEID(dir);
725 __entry->error = error < 0 ? -error : 0;
726 __assign_str(name, dentry->d_name.name);
729 TP_printk(
730 "error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
731 -__entry->error, nfs_show_status(__entry->error),
732 MAJOR(__entry->dev), MINOR(__entry->dev),
733 __entry->fileid,
734 MAJOR(__entry->dev), MINOR(__entry->dev),
735 (unsigned long long)__entry->dir,
736 __get_str(name)
740 DECLARE_EVENT_CLASS(nfs_rename_event,
741 TP_PROTO(
742 const struct inode *old_dir,
743 const struct dentry *old_dentry,
744 const struct inode *new_dir,
745 const struct dentry *new_dentry
748 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry),
750 TP_STRUCT__entry(
751 __field(dev_t, dev)
752 __field(u64, old_dir)
753 __field(u64, new_dir)
754 __string(old_name, old_dentry->d_name.name)
755 __string(new_name, new_dentry->d_name.name)
758 TP_fast_assign(
759 __entry->dev = old_dir->i_sb->s_dev;
760 __entry->old_dir = NFS_FILEID(old_dir);
761 __entry->new_dir = NFS_FILEID(new_dir);
762 __assign_str(old_name, old_dentry->d_name.name);
763 __assign_str(new_name, new_dentry->d_name.name);
766 TP_printk(
767 "old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s",
768 MAJOR(__entry->dev), MINOR(__entry->dev),
769 (unsigned long long)__entry->old_dir,
770 __get_str(old_name),
771 MAJOR(__entry->dev), MINOR(__entry->dev),
772 (unsigned long long)__entry->new_dir,
773 __get_str(new_name)
776 #define DEFINE_NFS_RENAME_EVENT(name) \
777 DEFINE_EVENT(nfs_rename_event, name, \
778 TP_PROTO( \
779 const struct inode *old_dir, \
780 const struct dentry *old_dentry, \
781 const struct inode *new_dir, \
782 const struct dentry *new_dentry \
783 ), \
784 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
786 DECLARE_EVENT_CLASS(nfs_rename_event_done,
787 TP_PROTO(
788 const struct inode *old_dir,
789 const struct dentry *old_dentry,
790 const struct inode *new_dir,
791 const struct dentry *new_dentry,
792 int error
795 TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, error),
797 TP_STRUCT__entry(
798 __field(dev_t, dev)
799 __field(unsigned long, error)
800 __field(u64, old_dir)
801 __string(old_name, old_dentry->d_name.name)
802 __field(u64, new_dir)
803 __string(new_name, new_dentry->d_name.name)
806 TP_fast_assign(
807 __entry->dev = old_dir->i_sb->s_dev;
808 __entry->error = -error;
809 __entry->old_dir = NFS_FILEID(old_dir);
810 __entry->new_dir = NFS_FILEID(new_dir);
811 __assign_str(old_name, old_dentry->d_name.name);
812 __assign_str(new_name, new_dentry->d_name.name);
815 TP_printk(
816 "error=%ld (%s) old_name=%02x:%02x:%llu/%s "
817 "new_name=%02x:%02x:%llu/%s",
818 -__entry->error, nfs_show_status(__entry->error),
819 MAJOR(__entry->dev), MINOR(__entry->dev),
820 (unsigned long long)__entry->old_dir,
821 __get_str(old_name),
822 MAJOR(__entry->dev), MINOR(__entry->dev),
823 (unsigned long long)__entry->new_dir,
824 __get_str(new_name)
827 #define DEFINE_NFS_RENAME_EVENT_DONE(name) \
828 DEFINE_EVENT(nfs_rename_event_done, name, \
829 TP_PROTO( \
830 const struct inode *old_dir, \
831 const struct dentry *old_dentry, \
832 const struct inode *new_dir, \
833 const struct dentry *new_dentry, \
834 int error \
835 ), \
836 TP_ARGS(old_dir, old_dentry, new_dir, \
837 new_dentry, error))
839 DEFINE_NFS_RENAME_EVENT(nfs_rename_enter);
840 DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit);
842 DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename);
844 TRACE_EVENT(nfs_sillyrename_unlink,
845 TP_PROTO(
846 const struct nfs_unlinkdata *data,
847 int error
850 TP_ARGS(data, error),
852 TP_STRUCT__entry(
853 __field(dev_t, dev)
854 __field(unsigned long, error)
855 __field(u64, dir)
856 __dynamic_array(char, name, data->args.name.len + 1)
859 TP_fast_assign(
860 struct inode *dir = d_inode(data->dentry->d_parent);
861 size_t len = data->args.name.len;
862 __entry->dev = dir->i_sb->s_dev;
863 __entry->dir = NFS_FILEID(dir);
864 __entry->error = -error;
865 memcpy(__get_str(name),
866 data->args.name.name, len);
867 __get_str(name)[len] = 0;
870 TP_printk(
871 "error=%ld (%s) name=%02x:%02x:%llu/%s",
872 -__entry->error, nfs_show_status(__entry->error),
873 MAJOR(__entry->dev), MINOR(__entry->dev),
874 (unsigned long long)__entry->dir,
875 __get_str(name)
879 TRACE_EVENT(nfs_initiate_read,
880 TP_PROTO(
881 const struct nfs_pgio_header *hdr
884 TP_ARGS(hdr),
886 TP_STRUCT__entry(
887 __field(dev_t, dev)
888 __field(u32, fhandle)
889 __field(u64, fileid)
890 __field(loff_t, offset)
891 __field(u32, count)
894 TP_fast_assign(
895 const struct inode *inode = hdr->inode;
896 const struct nfs_inode *nfsi = NFS_I(inode);
897 const struct nfs_fh *fh = hdr->args.fh ?
898 hdr->args.fh : &nfsi->fh;
900 __entry->offset = hdr->args.offset;
901 __entry->count = hdr->args.count;
902 __entry->dev = inode->i_sb->s_dev;
903 __entry->fileid = nfsi->fileid;
904 __entry->fhandle = nfs_fhandle_hash(fh);
907 TP_printk(
908 "fileid=%02x:%02x:%llu fhandle=0x%08x "
909 "offset=%lld count=%u",
910 MAJOR(__entry->dev), MINOR(__entry->dev),
911 (unsigned long long)__entry->fileid,
912 __entry->fhandle,
913 (long long)__entry->offset, __entry->count
917 TRACE_EVENT(nfs_readpage_done,
918 TP_PROTO(
919 const struct rpc_task *task,
920 const struct nfs_pgio_header *hdr
923 TP_ARGS(task, hdr),
925 TP_STRUCT__entry(
926 __field(dev_t, dev)
927 __field(u32, fhandle)
928 __field(u64, fileid)
929 __field(loff_t, offset)
930 __field(u32, arg_count)
931 __field(u32, res_count)
932 __field(bool, eof)
933 __field(int, status)
936 TP_fast_assign(
937 const struct inode *inode = hdr->inode;
938 const struct nfs_inode *nfsi = NFS_I(inode);
939 const struct nfs_fh *fh = hdr->args.fh ?
940 hdr->args.fh : &nfsi->fh;
942 __entry->status = task->tk_status;
943 __entry->offset = hdr->args.offset;
944 __entry->arg_count = hdr->args.count;
945 __entry->res_count = hdr->res.count;
946 __entry->eof = hdr->res.eof;
947 __entry->dev = inode->i_sb->s_dev;
948 __entry->fileid = nfsi->fileid;
949 __entry->fhandle = nfs_fhandle_hash(fh);
952 TP_printk(
953 "fileid=%02x:%02x:%llu fhandle=0x%08x "
954 "offset=%lld count=%u res=%u status=%d%s",
955 MAJOR(__entry->dev), MINOR(__entry->dev),
956 (unsigned long long)__entry->fileid,
957 __entry->fhandle,
958 (long long)__entry->offset, __entry->arg_count,
959 __entry->res_count, __entry->status,
960 __entry->eof ? " eof" : ""
964 TRACE_DEFINE_ENUM(NFS_UNSTABLE);
965 TRACE_DEFINE_ENUM(NFS_DATA_SYNC);
966 TRACE_DEFINE_ENUM(NFS_FILE_SYNC);
968 #define nfs_show_stable(stable) \
969 __print_symbolic(stable, \
970 { NFS_UNSTABLE, "UNSTABLE" }, \
971 { NFS_DATA_SYNC, "DATA_SYNC" }, \
972 { NFS_FILE_SYNC, "FILE_SYNC" })
974 TRACE_EVENT(nfs_initiate_write,
975 TP_PROTO(
976 const struct nfs_pgio_header *hdr
979 TP_ARGS(hdr),
981 TP_STRUCT__entry(
982 __field(dev_t, dev)
983 __field(u32, fhandle)
984 __field(u64, fileid)
985 __field(loff_t, offset)
986 __field(u32, count)
987 __field(enum nfs3_stable_how, stable)
990 TP_fast_assign(
991 const struct inode *inode = hdr->inode;
992 const struct nfs_inode *nfsi = NFS_I(inode);
993 const struct nfs_fh *fh = hdr->args.fh ?
994 hdr->args.fh : &nfsi->fh;
996 __entry->offset = hdr->args.offset;
997 __entry->count = hdr->args.count;
998 __entry->stable = hdr->args.stable;
999 __entry->dev = inode->i_sb->s_dev;
1000 __entry->fileid = nfsi->fileid;
1001 __entry->fhandle = nfs_fhandle_hash(fh);
1004 TP_printk(
1005 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1006 "offset=%lld count=%u stable=%s",
1007 MAJOR(__entry->dev), MINOR(__entry->dev),
1008 (unsigned long long)__entry->fileid,
1009 __entry->fhandle,
1010 (long long)__entry->offset, __entry->count,
1011 nfs_show_stable(__entry->stable)
1015 TRACE_EVENT(nfs_writeback_done,
1016 TP_PROTO(
1017 const struct rpc_task *task,
1018 const struct nfs_pgio_header *hdr
1021 TP_ARGS(task, hdr),
1023 TP_STRUCT__entry(
1024 __field(dev_t, dev)
1025 __field(u32, fhandle)
1026 __field(u64, fileid)
1027 __field(loff_t, offset)
1028 __field(u32, arg_count)
1029 __field(u32, res_count)
1030 __field(int, status)
1031 __field(enum nfs3_stable_how, stable)
1032 __array(char, verifier, NFS4_VERIFIER_SIZE)
1035 TP_fast_assign(
1036 const struct inode *inode = hdr->inode;
1037 const struct nfs_inode *nfsi = NFS_I(inode);
1038 const struct nfs_fh *fh = hdr->args.fh ?
1039 hdr->args.fh : &nfsi->fh;
1040 const struct nfs_writeverf *verf = hdr->res.verf;
1042 __entry->status = task->tk_status;
1043 __entry->offset = hdr->args.offset;
1044 __entry->arg_count = hdr->args.count;
1045 __entry->res_count = hdr->res.count;
1046 __entry->stable = verf->committed;
1047 memcpy(__entry->verifier,
1048 &verf->verifier,
1049 NFS4_VERIFIER_SIZE);
1050 __entry->dev = inode->i_sb->s_dev;
1051 __entry->fileid = nfsi->fileid;
1052 __entry->fhandle = nfs_fhandle_hash(fh);
1055 TP_printk(
1056 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1057 "offset=%lld count=%u res=%u status=%d stable=%s "
1058 "verifier=%s",
1059 MAJOR(__entry->dev), MINOR(__entry->dev),
1060 (unsigned long long)__entry->fileid,
1061 __entry->fhandle,
1062 (long long)__entry->offset, __entry->arg_count,
1063 __entry->res_count, __entry->status,
1064 nfs_show_stable(__entry->stable),
1065 __print_hex_str(__entry->verifier, NFS4_VERIFIER_SIZE)
1069 DECLARE_EVENT_CLASS(nfs_page_error_class,
1070 TP_PROTO(
1071 const struct nfs_page *req,
1072 int error
1075 TP_ARGS(req, error),
1077 TP_STRUCT__entry(
1078 __field(const void *, req)
1079 __field(pgoff_t, index)
1080 __field(unsigned int, offset)
1081 __field(unsigned int, pgbase)
1082 __field(unsigned int, bytes)
1083 __field(int, error)
1086 TP_fast_assign(
1087 __entry->req = req;
1088 __entry->index = req->wb_index;
1089 __entry->offset = req->wb_offset;
1090 __entry->pgbase = req->wb_pgbase;
1091 __entry->bytes = req->wb_bytes;
1092 __entry->error = error;
1095 TP_printk(
1096 "req=%p index=%lu offset=%u pgbase=%u bytes=%u error=%d",
1097 __entry->req, __entry->index, __entry->offset,
1098 __entry->pgbase, __entry->bytes, __entry->error
1102 #define DEFINE_NFS_PAGEERR_EVENT(name) \
1103 DEFINE_EVENT(nfs_page_error_class, name, \
1104 TP_PROTO( \
1105 const struct nfs_page *req, \
1106 int error \
1107 ), \
1108 TP_ARGS(req, error))
1110 DEFINE_NFS_PAGEERR_EVENT(nfs_write_error);
1111 DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error);
1112 DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error);
1114 TRACE_EVENT(nfs_initiate_commit,
1115 TP_PROTO(
1116 const struct nfs_commit_data *data
1119 TP_ARGS(data),
1121 TP_STRUCT__entry(
1122 __field(dev_t, dev)
1123 __field(u32, fhandle)
1124 __field(u64, fileid)
1125 __field(loff_t, offset)
1126 __field(u32, count)
1129 TP_fast_assign(
1130 const struct inode *inode = data->inode;
1131 const struct nfs_inode *nfsi = NFS_I(inode);
1132 const struct nfs_fh *fh = data->args.fh ?
1133 data->args.fh : &nfsi->fh;
1135 __entry->offset = data->args.offset;
1136 __entry->count = data->args.count;
1137 __entry->dev = inode->i_sb->s_dev;
1138 __entry->fileid = nfsi->fileid;
1139 __entry->fhandle = nfs_fhandle_hash(fh);
1142 TP_printk(
1143 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1144 "offset=%lld count=%u",
1145 MAJOR(__entry->dev), MINOR(__entry->dev),
1146 (unsigned long long)__entry->fileid,
1147 __entry->fhandle,
1148 (long long)__entry->offset, __entry->count
1152 TRACE_EVENT(nfs_commit_done,
1153 TP_PROTO(
1154 const struct rpc_task *task,
1155 const struct nfs_commit_data *data
1158 TP_ARGS(task, data),
1160 TP_STRUCT__entry(
1161 __field(dev_t, dev)
1162 __field(u32, fhandle)
1163 __field(u64, fileid)
1164 __field(loff_t, offset)
1165 __field(int, status)
1166 __field(enum nfs3_stable_how, stable)
1167 __array(char, verifier, NFS4_VERIFIER_SIZE)
1170 TP_fast_assign(
1171 const struct inode *inode = data->inode;
1172 const struct nfs_inode *nfsi = NFS_I(inode);
1173 const struct nfs_fh *fh = data->args.fh ?
1174 data->args.fh : &nfsi->fh;
1175 const struct nfs_writeverf *verf = data->res.verf;
1177 __entry->status = task->tk_status;
1178 __entry->offset = data->args.offset;
1179 __entry->stable = verf->committed;
1180 memcpy(__entry->verifier,
1181 &verf->verifier,
1182 NFS4_VERIFIER_SIZE);
1183 __entry->dev = inode->i_sb->s_dev;
1184 __entry->fileid = nfsi->fileid;
1185 __entry->fhandle = nfs_fhandle_hash(fh);
1188 TP_printk(
1189 "fileid=%02x:%02x:%llu fhandle=0x%08x "
1190 "offset=%lld status=%d stable=%s verifier=%s",
1191 MAJOR(__entry->dev), MINOR(__entry->dev),
1192 (unsigned long long)__entry->fileid,
1193 __entry->fhandle,
1194 (long long)__entry->offset, __entry->status,
1195 nfs_show_stable(__entry->stable),
1196 __print_hex_str(__entry->verifier, NFS4_VERIFIER_SIZE)
1200 TRACE_EVENT(nfs_fh_to_dentry,
1201 TP_PROTO(
1202 const struct super_block *sb,
1203 const struct nfs_fh *fh,
1204 u64 fileid,
1205 int error
1208 TP_ARGS(sb, fh, fileid, error),
1210 TP_STRUCT__entry(
1211 __field(int, error)
1212 __field(dev_t, dev)
1213 __field(u32, fhandle)
1214 __field(u64, fileid)
1217 TP_fast_assign(
1218 __entry->error = error;
1219 __entry->dev = sb->s_dev;
1220 __entry->fileid = fileid;
1221 __entry->fhandle = nfs_fhandle_hash(fh);
1224 TP_printk(
1225 "error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ",
1226 __entry->error,
1227 MAJOR(__entry->dev), MINOR(__entry->dev),
1228 (unsigned long long)__entry->fileid,
1229 __entry->fhandle
1233 TRACE_DEFINE_ENUM(NFS_OK);
1234 TRACE_DEFINE_ENUM(NFSERR_PERM);
1235 TRACE_DEFINE_ENUM(NFSERR_NOENT);
1236 TRACE_DEFINE_ENUM(NFSERR_IO);
1237 TRACE_DEFINE_ENUM(NFSERR_NXIO);
1238 TRACE_DEFINE_ENUM(ECHILD);
1239 TRACE_DEFINE_ENUM(NFSERR_EAGAIN);
1240 TRACE_DEFINE_ENUM(NFSERR_ACCES);
1241 TRACE_DEFINE_ENUM(NFSERR_EXIST);
1242 TRACE_DEFINE_ENUM(NFSERR_XDEV);
1243 TRACE_DEFINE_ENUM(NFSERR_NODEV);
1244 TRACE_DEFINE_ENUM(NFSERR_NOTDIR);
1245 TRACE_DEFINE_ENUM(NFSERR_ISDIR);
1246 TRACE_DEFINE_ENUM(NFSERR_INVAL);
1247 TRACE_DEFINE_ENUM(NFSERR_FBIG);
1248 TRACE_DEFINE_ENUM(NFSERR_NOSPC);
1249 TRACE_DEFINE_ENUM(NFSERR_ROFS);
1250 TRACE_DEFINE_ENUM(NFSERR_MLINK);
1251 TRACE_DEFINE_ENUM(NFSERR_OPNOTSUPP);
1252 TRACE_DEFINE_ENUM(NFSERR_NAMETOOLONG);
1253 TRACE_DEFINE_ENUM(NFSERR_NOTEMPTY);
1254 TRACE_DEFINE_ENUM(NFSERR_DQUOT);
1255 TRACE_DEFINE_ENUM(NFSERR_STALE);
1256 TRACE_DEFINE_ENUM(NFSERR_REMOTE);
1257 TRACE_DEFINE_ENUM(NFSERR_WFLUSH);
1258 TRACE_DEFINE_ENUM(NFSERR_BADHANDLE);
1259 TRACE_DEFINE_ENUM(NFSERR_NOT_SYNC);
1260 TRACE_DEFINE_ENUM(NFSERR_BAD_COOKIE);
1261 TRACE_DEFINE_ENUM(NFSERR_NOTSUPP);
1262 TRACE_DEFINE_ENUM(NFSERR_TOOSMALL);
1263 TRACE_DEFINE_ENUM(NFSERR_SERVERFAULT);
1264 TRACE_DEFINE_ENUM(NFSERR_BADTYPE);
1265 TRACE_DEFINE_ENUM(NFSERR_JUKEBOX);
1267 #define nfs_show_status(x) \
1268 __print_symbolic(x, \
1269 { NFS_OK, "OK" }, \
1270 { NFSERR_PERM, "PERM" }, \
1271 { NFSERR_NOENT, "NOENT" }, \
1272 { NFSERR_IO, "IO" }, \
1273 { NFSERR_NXIO, "NXIO" }, \
1274 { ECHILD, "CHILD" }, \
1275 { NFSERR_EAGAIN, "AGAIN" }, \
1276 { NFSERR_ACCES, "ACCES" }, \
1277 { NFSERR_EXIST, "EXIST" }, \
1278 { NFSERR_XDEV, "XDEV" }, \
1279 { NFSERR_NODEV, "NODEV" }, \
1280 { NFSERR_NOTDIR, "NOTDIR" }, \
1281 { NFSERR_ISDIR, "ISDIR" }, \
1282 { NFSERR_INVAL, "INVAL" }, \
1283 { NFSERR_FBIG, "FBIG" }, \
1284 { NFSERR_NOSPC, "NOSPC" }, \
1285 { NFSERR_ROFS, "ROFS" }, \
1286 { NFSERR_MLINK, "MLINK" }, \
1287 { NFSERR_OPNOTSUPP, "OPNOTSUPP" }, \
1288 { NFSERR_NAMETOOLONG, "NAMETOOLONG" }, \
1289 { NFSERR_NOTEMPTY, "NOTEMPTY" }, \
1290 { NFSERR_DQUOT, "DQUOT" }, \
1291 { NFSERR_STALE, "STALE" }, \
1292 { NFSERR_REMOTE, "REMOTE" }, \
1293 { NFSERR_WFLUSH, "WFLUSH" }, \
1294 { NFSERR_BADHANDLE, "BADHANDLE" }, \
1295 { NFSERR_NOT_SYNC, "NOTSYNC" }, \
1296 { NFSERR_BAD_COOKIE, "BADCOOKIE" }, \
1297 { NFSERR_NOTSUPP, "NOTSUPP" }, \
1298 { NFSERR_TOOSMALL, "TOOSMALL" }, \
1299 { NFSERR_SERVERFAULT, "REMOTEIO" }, \
1300 { NFSERR_BADTYPE, "BADTYPE" }, \
1301 { NFSERR_JUKEBOX, "JUKEBOX" })
1303 TRACE_EVENT(nfs_xdr_status,
1304 TP_PROTO(
1305 const struct xdr_stream *xdr,
1306 int error
1309 TP_ARGS(xdr, error),
1311 TP_STRUCT__entry(
1312 __field(unsigned int, task_id)
1313 __field(unsigned int, client_id)
1314 __field(u32, xid)
1315 __field(unsigned long, error)
1318 TP_fast_assign(
1319 const struct rpc_rqst *rqstp = xdr->rqst;
1320 const struct rpc_task *task = rqstp->rq_task;
1322 __entry->task_id = task->tk_pid;
1323 __entry->client_id = task->tk_client->cl_clid;
1324 __entry->xid = be32_to_cpu(rqstp->rq_xid);
1325 __entry->error = error;
1328 TP_printk(
1329 "task:%u@%d xid=0x%08x error=%ld (%s)",
1330 __entry->task_id, __entry->client_id, __entry->xid,
1331 -__entry->error, nfs_show_status(__entry->error)
1335 #endif /* _TRACE_NFS_H */
1337 #undef TRACE_INCLUDE_PATH
1338 #define TRACE_INCLUDE_PATH .
1339 #define TRACE_INCLUDE_FILE nfstrace
1340 /* This part must be outside protection */
1341 #include <trace/define_trace.h>