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