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