xref: /openbmc/linux/fs/nfs/nfstrace.h (revision e7253313)
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
7 
8 #if !defined(_TRACE_NFS_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _TRACE_NFS_H
10 
11 #include <linux/tracepoint.h>
12 #include <linux/iversion.h>
13 
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);
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);
48 
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" })
63 
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);
74 
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" })
87 
88 DECLARE_EVENT_CLASS(nfs_inode_event,
89 		TP_PROTO(
90 			const struct inode *inode
91 		),
92 
93 		TP_ARGS(inode),
94 
95 		TP_STRUCT__entry(
96 			__field(dev_t, dev)
97 			__field(u32, fhandle)
98 			__field(u64, fileid)
99 			__field(u64, version)
100 		),
101 
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);
108 		),
109 
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
116 		)
117 );
118 
119 DECLARE_EVENT_CLASS(nfs_inode_event_done,
120 		TP_PROTO(
121 			const struct inode *inode,
122 			int error
123 		),
124 
125 		TP_ARGS(inode, error),
126 
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)
137 		),
138 
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;
150 		),
151 
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)
168 		)
169 );
170 
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_refresh_inode_enter);
185 DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit);
186 DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter);
187 DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit);
188 DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter);
189 DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit);
190 DEFINE_NFS_INODE_EVENT(nfs_getattr_enter);
191 DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit);
192 DEFINE_NFS_INODE_EVENT(nfs_setattr_enter);
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);
196 DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter);
197 DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit);
198 DEFINE_NFS_INODE_EVENT(nfs_fsync_enter);
199 DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit);
200 DEFINE_NFS_INODE_EVENT(nfs_access_enter);
201 DEFINE_NFS_INODE_EVENT_DONE(nfs_access_exit);
202 
203 TRACE_DEFINE_ENUM(LOOKUP_FOLLOW);
204 TRACE_DEFINE_ENUM(LOOKUP_DIRECTORY);
205 TRACE_DEFINE_ENUM(LOOKUP_AUTOMOUNT);
206 TRACE_DEFINE_ENUM(LOOKUP_PARENT);
207 TRACE_DEFINE_ENUM(LOOKUP_REVAL);
208 TRACE_DEFINE_ENUM(LOOKUP_RCU);
209 TRACE_DEFINE_ENUM(LOOKUP_OPEN);
210 TRACE_DEFINE_ENUM(LOOKUP_CREATE);
211 TRACE_DEFINE_ENUM(LOOKUP_EXCL);
212 TRACE_DEFINE_ENUM(LOOKUP_RENAME_TARGET);
213 TRACE_DEFINE_ENUM(LOOKUP_JUMPED);
214 TRACE_DEFINE_ENUM(LOOKUP_ROOT);
215 TRACE_DEFINE_ENUM(LOOKUP_EMPTY);
216 TRACE_DEFINE_ENUM(LOOKUP_DOWN);
217 
218 #define show_lookup_flags(flags) \
219 	__print_flags(flags, "|", \
220 			{ LOOKUP_FOLLOW, "FOLLOW" }, \
221 			{ LOOKUP_DIRECTORY, "DIRECTORY" }, \
222 			{ LOOKUP_AUTOMOUNT, "AUTOMOUNT" }, \
223 			{ LOOKUP_PARENT, "PARENT" }, \
224 			{ LOOKUP_REVAL, "REVAL" }, \
225 			{ LOOKUP_RCU, "RCU" }, \
226 			{ LOOKUP_OPEN, "OPEN" }, \
227 			{ LOOKUP_CREATE, "CREATE" }, \
228 			{ LOOKUP_EXCL, "EXCL" }, \
229 			{ LOOKUP_RENAME_TARGET, "RENAME_TARGET" }, \
230 			{ LOOKUP_JUMPED, "JUMPED" }, \
231 			{ LOOKUP_ROOT, "ROOT" }, \
232 			{ LOOKUP_EMPTY, "EMPTY" }, \
233 			{ LOOKUP_DOWN, "DOWN" })
234 
235 DECLARE_EVENT_CLASS(nfs_lookup_event,
236 		TP_PROTO(
237 			const struct inode *dir,
238 			const struct dentry *dentry,
239 			unsigned int flags
240 		),
241 
242 		TP_ARGS(dir, dentry, flags),
243 
244 		TP_STRUCT__entry(
245 			__field(unsigned long, flags)
246 			__field(dev_t, dev)
247 			__field(u64, dir)
248 			__string(name, dentry->d_name.name)
249 		),
250 
251 		TP_fast_assign(
252 			__entry->dev = dir->i_sb->s_dev;
253 			__entry->dir = NFS_FILEID(dir);
254 			__entry->flags = flags;
255 			__assign_str(name, dentry->d_name.name);
256 		),
257 
258 		TP_printk(
259 			"flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
260 			__entry->flags,
261 			show_lookup_flags(__entry->flags),
262 			MAJOR(__entry->dev), MINOR(__entry->dev),
263 			(unsigned long long)__entry->dir,
264 			__get_str(name)
265 		)
266 );
267 
268 #define DEFINE_NFS_LOOKUP_EVENT(name) \
269 	DEFINE_EVENT(nfs_lookup_event, name, \
270 			TP_PROTO( \
271 				const struct inode *dir, \
272 				const struct dentry *dentry, \
273 				unsigned int flags \
274 			), \
275 			TP_ARGS(dir, dentry, flags))
276 
277 DECLARE_EVENT_CLASS(nfs_lookup_event_done,
278 		TP_PROTO(
279 			const struct inode *dir,
280 			const struct dentry *dentry,
281 			unsigned int flags,
282 			int error
283 		),
284 
285 		TP_ARGS(dir, dentry, flags, error),
286 
287 		TP_STRUCT__entry(
288 			__field(unsigned long, error)
289 			__field(unsigned long, flags)
290 			__field(dev_t, dev)
291 			__field(u64, dir)
292 			__string(name, dentry->d_name.name)
293 		),
294 
295 		TP_fast_assign(
296 			__entry->dev = dir->i_sb->s_dev;
297 			__entry->dir = NFS_FILEID(dir);
298 			__entry->error = error < 0 ? -error : 0;
299 			__entry->flags = flags;
300 			__assign_str(name, dentry->d_name.name);
301 		),
302 
303 		TP_printk(
304 			"error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
305 			-__entry->error, nfs_show_status(__entry->error),
306 			__entry->flags,
307 			show_lookup_flags(__entry->flags),
308 			MAJOR(__entry->dev), MINOR(__entry->dev),
309 			(unsigned long long)__entry->dir,
310 			__get_str(name)
311 		)
312 );
313 
314 #define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \
315 	DEFINE_EVENT(nfs_lookup_event_done, name, \
316 			TP_PROTO( \
317 				const struct inode *dir, \
318 				const struct dentry *dentry, \
319 				unsigned int flags, \
320 				int error \
321 			), \
322 			TP_ARGS(dir, dentry, flags, error))
323 
324 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter);
325 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit);
326 DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter);
327 DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit);
328 
329 TRACE_DEFINE_ENUM(O_WRONLY);
330 TRACE_DEFINE_ENUM(O_RDWR);
331 TRACE_DEFINE_ENUM(O_CREAT);
332 TRACE_DEFINE_ENUM(O_EXCL);
333 TRACE_DEFINE_ENUM(O_NOCTTY);
334 TRACE_DEFINE_ENUM(O_TRUNC);
335 TRACE_DEFINE_ENUM(O_APPEND);
336 TRACE_DEFINE_ENUM(O_NONBLOCK);
337 TRACE_DEFINE_ENUM(O_DSYNC);
338 TRACE_DEFINE_ENUM(O_DIRECT);
339 TRACE_DEFINE_ENUM(O_LARGEFILE);
340 TRACE_DEFINE_ENUM(O_DIRECTORY);
341 TRACE_DEFINE_ENUM(O_NOFOLLOW);
342 TRACE_DEFINE_ENUM(O_NOATIME);
343 TRACE_DEFINE_ENUM(O_CLOEXEC);
344 
345 #define show_open_flags(flags) \
346 	__print_flags(flags, "|", \
347 		{ O_WRONLY, "O_WRONLY" }, \
348 		{ O_RDWR, "O_RDWR" }, \
349 		{ O_CREAT, "O_CREAT" }, \
350 		{ O_EXCL, "O_EXCL" }, \
351 		{ O_NOCTTY, "O_NOCTTY" }, \
352 		{ O_TRUNC, "O_TRUNC" }, \
353 		{ O_APPEND, "O_APPEND" }, \
354 		{ O_NONBLOCK, "O_NONBLOCK" }, \
355 		{ O_DSYNC, "O_DSYNC" }, \
356 		{ O_DIRECT, "O_DIRECT" }, \
357 		{ O_LARGEFILE, "O_LARGEFILE" }, \
358 		{ O_DIRECTORY, "O_DIRECTORY" }, \
359 		{ O_NOFOLLOW, "O_NOFOLLOW" }, \
360 		{ O_NOATIME, "O_NOATIME" }, \
361 		{ O_CLOEXEC, "O_CLOEXEC" })
362 
363 TRACE_DEFINE_ENUM(FMODE_READ);
364 TRACE_DEFINE_ENUM(FMODE_WRITE);
365 TRACE_DEFINE_ENUM(FMODE_EXEC);
366 
367 #define show_fmode_flags(mode) \
368 	__print_flags(mode, "|", \
369 		{ ((__force unsigned long)FMODE_READ), "READ" }, \
370 		{ ((__force unsigned long)FMODE_WRITE), "WRITE" }, \
371 		{ ((__force unsigned long)FMODE_EXEC), "EXEC" })
372 
373 TRACE_EVENT(nfs_atomic_open_enter,
374 		TP_PROTO(
375 			const struct inode *dir,
376 			const struct nfs_open_context *ctx,
377 			unsigned int flags
378 		),
379 
380 		TP_ARGS(dir, ctx, flags),
381 
382 		TP_STRUCT__entry(
383 			__field(unsigned long, flags)
384 			__field(unsigned int, fmode)
385 			__field(dev_t, dev)
386 			__field(u64, dir)
387 			__string(name, ctx->dentry->d_name.name)
388 		),
389 
390 		TP_fast_assign(
391 			__entry->dev = dir->i_sb->s_dev;
392 			__entry->dir = NFS_FILEID(dir);
393 			__entry->flags = flags;
394 			__entry->fmode = (__force unsigned int)ctx->mode;
395 			__assign_str(name, ctx->dentry->d_name.name);
396 		),
397 
398 		TP_printk(
399 			"flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s",
400 			__entry->flags,
401 			show_open_flags(__entry->flags),
402 			show_fmode_flags(__entry->fmode),
403 			MAJOR(__entry->dev), MINOR(__entry->dev),
404 			(unsigned long long)__entry->dir,
405 			__get_str(name)
406 		)
407 );
408 
409 TRACE_EVENT(nfs_atomic_open_exit,
410 		TP_PROTO(
411 			const struct inode *dir,
412 			const struct nfs_open_context *ctx,
413 			unsigned int flags,
414 			int error
415 		),
416 
417 		TP_ARGS(dir, ctx, flags, error),
418 
419 		TP_STRUCT__entry(
420 			__field(unsigned long, error)
421 			__field(unsigned long, flags)
422 			__field(unsigned int, fmode)
423 			__field(dev_t, dev)
424 			__field(u64, dir)
425 			__string(name, ctx->dentry->d_name.name)
426 		),
427 
428 		TP_fast_assign(
429 			__entry->error = -error;
430 			__entry->dev = dir->i_sb->s_dev;
431 			__entry->dir = NFS_FILEID(dir);
432 			__entry->flags = flags;
433 			__entry->fmode = (__force unsigned int)ctx->mode;
434 			__assign_str(name, ctx->dentry->d_name.name);
435 		),
436 
437 		TP_printk(
438 			"error=%ld (%s) flags=0x%lx (%s) fmode=%s "
439 			"name=%02x:%02x:%llu/%s",
440 			-__entry->error, nfs_show_status(__entry->error),
441 			__entry->flags,
442 			show_open_flags(__entry->flags),
443 			show_fmode_flags(__entry->fmode),
444 			MAJOR(__entry->dev), MINOR(__entry->dev),
445 			(unsigned long long)__entry->dir,
446 			__get_str(name)
447 		)
448 );
449 
450 TRACE_EVENT(nfs_create_enter,
451 		TP_PROTO(
452 			const struct inode *dir,
453 			const struct dentry *dentry,
454 			unsigned int flags
455 		),
456 
457 		TP_ARGS(dir, dentry, flags),
458 
459 		TP_STRUCT__entry(
460 			__field(unsigned long, flags)
461 			__field(dev_t, dev)
462 			__field(u64, dir)
463 			__string(name, dentry->d_name.name)
464 		),
465 
466 		TP_fast_assign(
467 			__entry->dev = dir->i_sb->s_dev;
468 			__entry->dir = NFS_FILEID(dir);
469 			__entry->flags = flags;
470 			__assign_str(name, dentry->d_name.name);
471 		),
472 
473 		TP_printk(
474 			"flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
475 			__entry->flags,
476 			show_open_flags(__entry->flags),
477 			MAJOR(__entry->dev), MINOR(__entry->dev),
478 			(unsigned long long)__entry->dir,
479 			__get_str(name)
480 		)
481 );
482 
483 TRACE_EVENT(nfs_create_exit,
484 		TP_PROTO(
485 			const struct inode *dir,
486 			const struct dentry *dentry,
487 			unsigned int flags,
488 			int error
489 		),
490 
491 		TP_ARGS(dir, dentry, flags, error),
492 
493 		TP_STRUCT__entry(
494 			__field(unsigned long, error)
495 			__field(unsigned long, flags)
496 			__field(dev_t, dev)
497 			__field(u64, dir)
498 			__string(name, dentry->d_name.name)
499 		),
500 
501 		TP_fast_assign(
502 			__entry->error = -error;
503 			__entry->dev = dir->i_sb->s_dev;
504 			__entry->dir = NFS_FILEID(dir);
505 			__entry->flags = flags;
506 			__assign_str(name, dentry->d_name.name);
507 		),
508 
509 		TP_printk(
510 			"error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
511 			-__entry->error, nfs_show_status(__entry->error),
512 			__entry->flags,
513 			show_open_flags(__entry->flags),
514 			MAJOR(__entry->dev), MINOR(__entry->dev),
515 			(unsigned long long)__entry->dir,
516 			__get_str(name)
517 		)
518 );
519 
520 DECLARE_EVENT_CLASS(nfs_directory_event,
521 		TP_PROTO(
522 			const struct inode *dir,
523 			const struct dentry *dentry
524 		),
525 
526 		TP_ARGS(dir, dentry),
527 
528 		TP_STRUCT__entry(
529 			__field(dev_t, dev)
530 			__field(u64, dir)
531 			__string(name, dentry->d_name.name)
532 		),
533 
534 		TP_fast_assign(
535 			__entry->dev = dir->i_sb->s_dev;
536 			__entry->dir = NFS_FILEID(dir);
537 			__assign_str(name, dentry->d_name.name);
538 		),
539 
540 		TP_printk(
541 			"name=%02x:%02x:%llu/%s",
542 			MAJOR(__entry->dev), MINOR(__entry->dev),
543 			(unsigned long long)__entry->dir,
544 			__get_str(name)
545 		)
546 );
547 
548 #define DEFINE_NFS_DIRECTORY_EVENT(name) \
549 	DEFINE_EVENT(nfs_directory_event, name, \
550 			TP_PROTO( \
551 				const struct inode *dir, \
552 				const struct dentry *dentry \
553 			), \
554 			TP_ARGS(dir, dentry))
555 
556 DECLARE_EVENT_CLASS(nfs_directory_event_done,
557 		TP_PROTO(
558 			const struct inode *dir,
559 			const struct dentry *dentry,
560 			int error
561 		),
562 
563 		TP_ARGS(dir, dentry, error),
564 
565 		TP_STRUCT__entry(
566 			__field(unsigned long, error)
567 			__field(dev_t, dev)
568 			__field(u64, dir)
569 			__string(name, dentry->d_name.name)
570 		),
571 
572 		TP_fast_assign(
573 			__entry->dev = dir->i_sb->s_dev;
574 			__entry->dir = NFS_FILEID(dir);
575 			__entry->error = error < 0 ? -error : 0;
576 			__assign_str(name, dentry->d_name.name);
577 		),
578 
579 		TP_printk(
580 			"error=%ld (%s) name=%02x:%02x:%llu/%s",
581 			-__entry->error, nfs_show_status(__entry->error),
582 			MAJOR(__entry->dev), MINOR(__entry->dev),
583 			(unsigned long long)__entry->dir,
584 			__get_str(name)
585 		)
586 );
587 
588 #define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \
589 	DEFINE_EVENT(nfs_directory_event_done, name, \
590 			TP_PROTO( \
591 				const struct inode *dir, \
592 				const struct dentry *dentry, \
593 				int error \
594 			), \
595 			TP_ARGS(dir, dentry, error))
596 
597 DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter);
598 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit);
599 DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter);
600 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit);
601 DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter);
602 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit);
603 DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter);
604 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit);
605 DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter);
606 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit);
607 DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter);
608 DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit);
609 
610 TRACE_EVENT(nfs_link_enter,
611 		TP_PROTO(
612 			const struct inode *inode,
613 			const struct inode *dir,
614 			const struct dentry *dentry
615 		),
616 
617 		TP_ARGS(inode, dir, dentry),
618 
619 		TP_STRUCT__entry(
620 			__field(dev_t, dev)
621 			__field(u64, fileid)
622 			__field(u64, dir)
623 			__string(name, dentry->d_name.name)
624 		),
625 
626 		TP_fast_assign(
627 			__entry->dev = inode->i_sb->s_dev;
628 			__entry->fileid = NFS_FILEID(inode);
629 			__entry->dir = NFS_FILEID(dir);
630 			__assign_str(name, dentry->d_name.name);
631 		),
632 
633 		TP_printk(
634 			"fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
635 			MAJOR(__entry->dev), MINOR(__entry->dev),
636 			__entry->fileid,
637 			MAJOR(__entry->dev), MINOR(__entry->dev),
638 			(unsigned long long)__entry->dir,
639 			__get_str(name)
640 		)
641 );
642 
643 TRACE_EVENT(nfs_link_exit,
644 		TP_PROTO(
645 			const struct inode *inode,
646 			const struct inode *dir,
647 			const struct dentry *dentry,
648 			int error
649 		),
650 
651 		TP_ARGS(inode, dir, dentry, error),
652 
653 		TP_STRUCT__entry(
654 			__field(unsigned long, error)
655 			__field(dev_t, dev)
656 			__field(u64, fileid)
657 			__field(u64, dir)
658 			__string(name, dentry->d_name.name)
659 		),
660 
661 		TP_fast_assign(
662 			__entry->dev = inode->i_sb->s_dev;
663 			__entry->fileid = NFS_FILEID(inode);
664 			__entry->dir = NFS_FILEID(dir);
665 			__entry->error = error < 0 ? -error : 0;
666 			__assign_str(name, dentry->d_name.name);
667 		),
668 
669 		TP_printk(
670 			"error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
671 			-__entry->error, nfs_show_status(__entry->error),
672 			MAJOR(__entry->dev), MINOR(__entry->dev),
673 			__entry->fileid,
674 			MAJOR(__entry->dev), MINOR(__entry->dev),
675 			(unsigned long long)__entry->dir,
676 			__get_str(name)
677 		)
678 );
679 
680 DECLARE_EVENT_CLASS(nfs_rename_event,
681 		TP_PROTO(
682 			const struct inode *old_dir,
683 			const struct dentry *old_dentry,
684 			const struct inode *new_dir,
685 			const struct dentry *new_dentry
686 		),
687 
688 		TP_ARGS(old_dir, old_dentry, new_dir, new_dentry),
689 
690 		TP_STRUCT__entry(
691 			__field(dev_t, dev)
692 			__field(u64, old_dir)
693 			__field(u64, new_dir)
694 			__string(old_name, old_dentry->d_name.name)
695 			__string(new_name, new_dentry->d_name.name)
696 		),
697 
698 		TP_fast_assign(
699 			__entry->dev = old_dir->i_sb->s_dev;
700 			__entry->old_dir = NFS_FILEID(old_dir);
701 			__entry->new_dir = NFS_FILEID(new_dir);
702 			__assign_str(old_name, old_dentry->d_name.name);
703 			__assign_str(new_name, new_dentry->d_name.name);
704 		),
705 
706 		TP_printk(
707 			"old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s",
708 			MAJOR(__entry->dev), MINOR(__entry->dev),
709 			(unsigned long long)__entry->old_dir,
710 			__get_str(old_name),
711 			MAJOR(__entry->dev), MINOR(__entry->dev),
712 			(unsigned long long)__entry->new_dir,
713 			__get_str(new_name)
714 		)
715 );
716 #define DEFINE_NFS_RENAME_EVENT(name) \
717 	DEFINE_EVENT(nfs_rename_event, name, \
718 			TP_PROTO( \
719 				const struct inode *old_dir, \
720 				const struct dentry *old_dentry, \
721 				const struct inode *new_dir, \
722 				const struct dentry *new_dentry \
723 			), \
724 			TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
725 
726 DECLARE_EVENT_CLASS(nfs_rename_event_done,
727 		TP_PROTO(
728 			const struct inode *old_dir,
729 			const struct dentry *old_dentry,
730 			const struct inode *new_dir,
731 			const struct dentry *new_dentry,
732 			int error
733 		),
734 
735 		TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, error),
736 
737 		TP_STRUCT__entry(
738 			__field(dev_t, dev)
739 			__field(unsigned long, error)
740 			__field(u64, old_dir)
741 			__string(old_name, old_dentry->d_name.name)
742 			__field(u64, new_dir)
743 			__string(new_name, new_dentry->d_name.name)
744 		),
745 
746 		TP_fast_assign(
747 			__entry->dev = old_dir->i_sb->s_dev;
748 			__entry->error = -error;
749 			__entry->old_dir = NFS_FILEID(old_dir);
750 			__entry->new_dir = NFS_FILEID(new_dir);
751 			__assign_str(old_name, old_dentry->d_name.name);
752 			__assign_str(new_name, new_dentry->d_name.name);
753 		),
754 
755 		TP_printk(
756 			"error=%ld (%s) old_name=%02x:%02x:%llu/%s "
757 			"new_name=%02x:%02x:%llu/%s",
758 			-__entry->error, nfs_show_status(__entry->error),
759 			MAJOR(__entry->dev), MINOR(__entry->dev),
760 			(unsigned long long)__entry->old_dir,
761 			__get_str(old_name),
762 			MAJOR(__entry->dev), MINOR(__entry->dev),
763 			(unsigned long long)__entry->new_dir,
764 			__get_str(new_name)
765 		)
766 );
767 #define DEFINE_NFS_RENAME_EVENT_DONE(name) \
768 	DEFINE_EVENT(nfs_rename_event_done, name, \
769 			TP_PROTO( \
770 				const struct inode *old_dir, \
771 				const struct dentry *old_dentry, \
772 				const struct inode *new_dir, \
773 				const struct dentry *new_dentry, \
774 				int error \
775 			), \
776 			TP_ARGS(old_dir, old_dentry, new_dir, \
777 				new_dentry, error))
778 
779 DEFINE_NFS_RENAME_EVENT(nfs_rename_enter);
780 DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit);
781 
782 DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename);
783 
784 TRACE_EVENT(nfs_sillyrename_unlink,
785 		TP_PROTO(
786 			const struct nfs_unlinkdata *data,
787 			int error
788 		),
789 
790 		TP_ARGS(data, error),
791 
792 		TP_STRUCT__entry(
793 			__field(dev_t, dev)
794 			__field(unsigned long, error)
795 			__field(u64, dir)
796 			__dynamic_array(char, name, data->args.name.len + 1)
797 		),
798 
799 		TP_fast_assign(
800 			struct inode *dir = d_inode(data->dentry->d_parent);
801 			size_t len = data->args.name.len;
802 			__entry->dev = dir->i_sb->s_dev;
803 			__entry->dir = NFS_FILEID(dir);
804 			__entry->error = -error;
805 			memcpy(__get_str(name),
806 				data->args.name.name, len);
807 			__get_str(name)[len] = 0;
808 		),
809 
810 		TP_printk(
811 			"error=%ld (%s) name=%02x:%02x:%llu/%s",
812 			-__entry->error, nfs_show_status(__entry->error),
813 			MAJOR(__entry->dev), MINOR(__entry->dev),
814 			(unsigned long long)__entry->dir,
815 			__get_str(name)
816 		)
817 );
818 
819 TRACE_EVENT(nfs_initiate_read,
820 		TP_PROTO(
821 			const struct inode *inode,
822 			loff_t offset, unsigned long count
823 		),
824 
825 		TP_ARGS(inode, offset, count),
826 
827 		TP_STRUCT__entry(
828 			__field(loff_t, offset)
829 			__field(unsigned long, count)
830 			__field(dev_t, dev)
831 			__field(u32, fhandle)
832 			__field(u64, fileid)
833 		),
834 
835 		TP_fast_assign(
836 			const struct nfs_inode *nfsi = NFS_I(inode);
837 
838 			__entry->offset = offset;
839 			__entry->count = count;
840 			__entry->dev = inode->i_sb->s_dev;
841 			__entry->fileid = nfsi->fileid;
842 			__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
843 		),
844 
845 		TP_printk(
846 			"fileid=%02x:%02x:%llu fhandle=0x%08x "
847 			"offset=%lld count=%lu",
848 			MAJOR(__entry->dev), MINOR(__entry->dev),
849 			(unsigned long long)__entry->fileid,
850 			__entry->fhandle,
851 			__entry->offset, __entry->count
852 		)
853 );
854 
855 TRACE_EVENT(nfs_readpage_done,
856 		TP_PROTO(
857 			const struct inode *inode,
858 			int status, loff_t offset, bool eof
859 		),
860 
861 		TP_ARGS(inode, status, offset, eof),
862 
863 		TP_STRUCT__entry(
864 			__field(int, status)
865 			__field(loff_t, offset)
866 			__field(bool, eof)
867 			__field(dev_t, dev)
868 			__field(u32, fhandle)
869 			__field(u64, fileid)
870 		),
871 
872 		TP_fast_assign(
873 			const struct nfs_inode *nfsi = NFS_I(inode);
874 
875 			__entry->status = status;
876 			__entry->offset = offset;
877 			__entry->eof = eof;
878 			__entry->dev = inode->i_sb->s_dev;
879 			__entry->fileid = nfsi->fileid;
880 			__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
881 		),
882 
883 		TP_printk(
884 			"fileid=%02x:%02x:%llu fhandle=0x%08x "
885 			"offset=%lld status=%d%s",
886 			MAJOR(__entry->dev), MINOR(__entry->dev),
887 			(unsigned long long)__entry->fileid,
888 			__entry->fhandle,
889 			__entry->offset, __entry->status,
890 			__entry->eof ? " eof" : ""
891 		)
892 );
893 
894 TRACE_DEFINE_ENUM(NFS_UNSTABLE);
895 TRACE_DEFINE_ENUM(NFS_DATA_SYNC);
896 TRACE_DEFINE_ENUM(NFS_FILE_SYNC);
897 
898 #define nfs_show_stable(stable) \
899 	__print_symbolic(stable, \
900 			{ NFS_UNSTABLE, "UNSTABLE" }, \
901 			{ NFS_DATA_SYNC, "DATA_SYNC" }, \
902 			{ NFS_FILE_SYNC, "FILE_SYNC" })
903 
904 TRACE_EVENT(nfs_initiate_write,
905 		TP_PROTO(
906 			const struct inode *inode,
907 			loff_t offset, unsigned long count,
908 			enum nfs3_stable_how stable
909 		),
910 
911 		TP_ARGS(inode, offset, count, stable),
912 
913 		TP_STRUCT__entry(
914 			__field(loff_t, offset)
915 			__field(unsigned long, count)
916 			__field(enum nfs3_stable_how, stable)
917 			__field(dev_t, dev)
918 			__field(u32, fhandle)
919 			__field(u64, fileid)
920 		),
921 
922 		TP_fast_assign(
923 			const struct nfs_inode *nfsi = NFS_I(inode);
924 
925 			__entry->offset = offset;
926 			__entry->count = count;
927 			__entry->stable = stable;
928 			__entry->dev = inode->i_sb->s_dev;
929 			__entry->fileid = nfsi->fileid;
930 			__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
931 		),
932 
933 		TP_printk(
934 			"fileid=%02x:%02x:%llu fhandle=0x%08x "
935 			"offset=%lld count=%lu stable=%s",
936 			MAJOR(__entry->dev), MINOR(__entry->dev),
937 			(unsigned long long)__entry->fileid,
938 			__entry->fhandle,
939 			__entry->offset, __entry->count,
940 			nfs_show_stable(__entry->stable)
941 		)
942 );
943 
944 TRACE_EVENT(nfs_writeback_done,
945 		TP_PROTO(
946 			const struct inode *inode,
947 			int status,
948 			loff_t offset,
949 			struct nfs_writeverf *writeverf
950 		),
951 
952 		TP_ARGS(inode, status, offset, writeverf),
953 
954 		TP_STRUCT__entry(
955 			__field(int, status)
956 			__field(loff_t, offset)
957 			__field(enum nfs3_stable_how, stable)
958 			__field(unsigned long long, verifier)
959 			__field(dev_t, dev)
960 			__field(u32, fhandle)
961 			__field(u64, fileid)
962 		),
963 
964 		TP_fast_assign(
965 			const struct nfs_inode *nfsi = NFS_I(inode);
966 
967 			__entry->status = status;
968 			__entry->offset = offset;
969 			__entry->stable = writeverf->committed;
970 			memcpy(&__entry->verifier, &writeverf->verifier,
971 			       sizeof(__entry->verifier));
972 			__entry->dev = inode->i_sb->s_dev;
973 			__entry->fileid = nfsi->fileid;
974 			__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
975 		),
976 
977 		TP_printk(
978 			"fileid=%02x:%02x:%llu fhandle=0x%08x "
979 			"offset=%lld status=%d stable=%s "
980 			"verifier 0x%016llx",
981 			MAJOR(__entry->dev), MINOR(__entry->dev),
982 			(unsigned long long)__entry->fileid,
983 			__entry->fhandle,
984 			__entry->offset, __entry->status,
985 			nfs_show_stable(__entry->stable),
986 			__entry->verifier
987 		)
988 );
989 
990 TRACE_EVENT(nfs_initiate_commit,
991 		TP_PROTO(
992 			const struct nfs_commit_data *data
993 		),
994 
995 		TP_ARGS(data),
996 
997 		TP_STRUCT__entry(
998 			__field(loff_t, offset)
999 			__field(unsigned long, count)
1000 			__field(dev_t, dev)
1001 			__field(u32, fhandle)
1002 			__field(u64, fileid)
1003 		),
1004 
1005 		TP_fast_assign(
1006 			const struct inode *inode = data->inode;
1007 			const struct nfs_inode *nfsi = NFS_I(inode);
1008 
1009 			__entry->offset = data->args.offset;
1010 			__entry->count = data->args.count;
1011 			__entry->dev = inode->i_sb->s_dev;
1012 			__entry->fileid = nfsi->fileid;
1013 			__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
1014 		),
1015 
1016 		TP_printk(
1017 			"fileid=%02x:%02x:%llu fhandle=0x%08x "
1018 			"offset=%lld count=%lu",
1019 			MAJOR(__entry->dev), MINOR(__entry->dev),
1020 			(unsigned long long)__entry->fileid,
1021 			__entry->fhandle,
1022 			__entry->offset, __entry->count
1023 		)
1024 );
1025 
1026 TRACE_EVENT(nfs_commit_done,
1027 		TP_PROTO(
1028 			const struct nfs_commit_data *data
1029 		),
1030 
1031 		TP_ARGS(data),
1032 
1033 		TP_STRUCT__entry(
1034 			__field(int, status)
1035 			__field(loff_t, offset)
1036 			__field(unsigned long long, verifier)
1037 			__field(dev_t, dev)
1038 			__field(u32, fhandle)
1039 			__field(u64, fileid)
1040 		),
1041 
1042 		TP_fast_assign(
1043 			const struct inode *inode = data->inode;
1044 			const struct nfs_inode *nfsi = NFS_I(inode);
1045 
1046 			__entry->status = data->res.op_status;
1047 			__entry->offset = data->args.offset;
1048 			memcpy(&__entry->verifier, &data->verf.verifier,
1049 			       sizeof(__entry->verifier));
1050 			__entry->dev = inode->i_sb->s_dev;
1051 			__entry->fileid = nfsi->fileid;
1052 			__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
1053 		),
1054 
1055 		TP_printk(
1056 			"fileid=%02x:%02x:%llu fhandle=0x%08x "
1057 			"offset=%lld status=%d verifier 0x%016llx",
1058 			MAJOR(__entry->dev), MINOR(__entry->dev),
1059 			(unsigned long long)__entry->fileid,
1060 			__entry->fhandle,
1061 			__entry->offset, __entry->status,
1062 			__entry->verifier
1063 		)
1064 );
1065 
1066 TRACE_EVENT(nfs_fh_to_dentry,
1067 		TP_PROTO(
1068 			const struct super_block *sb,
1069 			const struct nfs_fh *fh,
1070 			u64 fileid,
1071 			int error
1072 		),
1073 
1074 		TP_ARGS(sb, fh, fileid, error),
1075 
1076 		TP_STRUCT__entry(
1077 			__field(int, error)
1078 			__field(dev_t, dev)
1079 			__field(u32, fhandle)
1080 			__field(u64, fileid)
1081 		),
1082 
1083 		TP_fast_assign(
1084 			__entry->error = error;
1085 			__entry->dev = sb->s_dev;
1086 			__entry->fileid = fileid;
1087 			__entry->fhandle = nfs_fhandle_hash(fh);
1088 		),
1089 
1090 		TP_printk(
1091 			"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ",
1092 			__entry->error,
1093 			MAJOR(__entry->dev), MINOR(__entry->dev),
1094 			(unsigned long long)__entry->fileid,
1095 			__entry->fhandle
1096 		)
1097 );
1098 
1099 TRACE_DEFINE_ENUM(NFS_OK);
1100 TRACE_DEFINE_ENUM(NFSERR_PERM);
1101 TRACE_DEFINE_ENUM(NFSERR_NOENT);
1102 TRACE_DEFINE_ENUM(NFSERR_IO);
1103 TRACE_DEFINE_ENUM(NFSERR_NXIO);
1104 TRACE_DEFINE_ENUM(ECHILD);
1105 TRACE_DEFINE_ENUM(NFSERR_EAGAIN);
1106 TRACE_DEFINE_ENUM(NFSERR_ACCES);
1107 TRACE_DEFINE_ENUM(NFSERR_EXIST);
1108 TRACE_DEFINE_ENUM(NFSERR_XDEV);
1109 TRACE_DEFINE_ENUM(NFSERR_NODEV);
1110 TRACE_DEFINE_ENUM(NFSERR_NOTDIR);
1111 TRACE_DEFINE_ENUM(NFSERR_ISDIR);
1112 TRACE_DEFINE_ENUM(NFSERR_INVAL);
1113 TRACE_DEFINE_ENUM(NFSERR_FBIG);
1114 TRACE_DEFINE_ENUM(NFSERR_NOSPC);
1115 TRACE_DEFINE_ENUM(NFSERR_ROFS);
1116 TRACE_DEFINE_ENUM(NFSERR_MLINK);
1117 TRACE_DEFINE_ENUM(NFSERR_OPNOTSUPP);
1118 TRACE_DEFINE_ENUM(NFSERR_NAMETOOLONG);
1119 TRACE_DEFINE_ENUM(NFSERR_NOTEMPTY);
1120 TRACE_DEFINE_ENUM(NFSERR_DQUOT);
1121 TRACE_DEFINE_ENUM(NFSERR_STALE);
1122 TRACE_DEFINE_ENUM(NFSERR_REMOTE);
1123 TRACE_DEFINE_ENUM(NFSERR_WFLUSH);
1124 TRACE_DEFINE_ENUM(NFSERR_BADHANDLE);
1125 TRACE_DEFINE_ENUM(NFSERR_NOT_SYNC);
1126 TRACE_DEFINE_ENUM(NFSERR_BAD_COOKIE);
1127 TRACE_DEFINE_ENUM(NFSERR_NOTSUPP);
1128 TRACE_DEFINE_ENUM(NFSERR_TOOSMALL);
1129 TRACE_DEFINE_ENUM(NFSERR_SERVERFAULT);
1130 TRACE_DEFINE_ENUM(NFSERR_BADTYPE);
1131 TRACE_DEFINE_ENUM(NFSERR_JUKEBOX);
1132 
1133 #define nfs_show_status(x) \
1134 	__print_symbolic(x, \
1135 			{ NFS_OK, "OK" }, \
1136 			{ NFSERR_PERM, "PERM" }, \
1137 			{ NFSERR_NOENT, "NOENT" }, \
1138 			{ NFSERR_IO, "IO" }, \
1139 			{ NFSERR_NXIO, "NXIO" }, \
1140 			{ ECHILD, "CHILD" }, \
1141 			{ NFSERR_EAGAIN, "AGAIN" }, \
1142 			{ NFSERR_ACCES, "ACCES" }, \
1143 			{ NFSERR_EXIST, "EXIST" }, \
1144 			{ NFSERR_XDEV, "XDEV" }, \
1145 			{ NFSERR_NODEV, "NODEV" }, \
1146 			{ NFSERR_NOTDIR, "NOTDIR" }, \
1147 			{ NFSERR_ISDIR, "ISDIR" }, \
1148 			{ NFSERR_INVAL, "INVAL" }, \
1149 			{ NFSERR_FBIG, "FBIG" }, \
1150 			{ NFSERR_NOSPC, "NOSPC" }, \
1151 			{ NFSERR_ROFS, "ROFS" }, \
1152 			{ NFSERR_MLINK, "MLINK" }, \
1153 			{ NFSERR_OPNOTSUPP, "OPNOTSUPP" }, \
1154 			{ NFSERR_NAMETOOLONG, "NAMETOOLONG" }, \
1155 			{ NFSERR_NOTEMPTY, "NOTEMPTY" }, \
1156 			{ NFSERR_DQUOT, "DQUOT" }, \
1157 			{ NFSERR_STALE, "STALE" }, \
1158 			{ NFSERR_REMOTE, "REMOTE" }, \
1159 			{ NFSERR_WFLUSH, "WFLUSH" }, \
1160 			{ NFSERR_BADHANDLE, "BADHANDLE" }, \
1161 			{ NFSERR_NOT_SYNC, "NOTSYNC" }, \
1162 			{ NFSERR_BAD_COOKIE, "BADCOOKIE" }, \
1163 			{ NFSERR_NOTSUPP, "NOTSUPP" }, \
1164 			{ NFSERR_TOOSMALL, "TOOSMALL" }, \
1165 			{ NFSERR_SERVERFAULT, "REMOTEIO" }, \
1166 			{ NFSERR_BADTYPE, "BADTYPE" }, \
1167 			{ NFSERR_JUKEBOX, "JUKEBOX" })
1168 
1169 TRACE_EVENT(nfs_xdr_status,
1170 		TP_PROTO(
1171 			const struct xdr_stream *xdr,
1172 			int error
1173 		),
1174 
1175 		TP_ARGS(xdr, error),
1176 
1177 		TP_STRUCT__entry(
1178 			__field(unsigned int, task_id)
1179 			__field(unsigned int, client_id)
1180 			__field(u32, xid)
1181 			__field(unsigned long, error)
1182 		),
1183 
1184 		TP_fast_assign(
1185 			const struct rpc_rqst *rqstp = xdr->rqst;
1186 			const struct rpc_task *task = rqstp->rq_task;
1187 
1188 			__entry->task_id = task->tk_pid;
1189 			__entry->client_id = task->tk_client->cl_clid;
1190 			__entry->xid = be32_to_cpu(rqstp->rq_xid);
1191 			__entry->error = error;
1192 		),
1193 
1194 		TP_printk(
1195 			"task:%u@%d xid=0x%08x error=%ld (%s)",
1196 			__entry->task_id, __entry->client_id, __entry->xid,
1197 			-__entry->error, nfs_show_status(__entry->error)
1198 		)
1199 );
1200 
1201 #endif /* _TRACE_NFS_H */
1202 
1203 #undef TRACE_INCLUDE_PATH
1204 #define TRACE_INCLUDE_PATH .
1205 #define TRACE_INCLUDE_FILE nfstrace
1206 /* This part must be outside protection */
1207 #include <trace/define_trace.h>
1208