xref: /openbmc/linux/fs/nfsd/trace.h (revision c6fbbf1e)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (c) 2014 Christoph Hellwig.
4  */
5 #undef TRACE_SYSTEM
6 #define TRACE_SYSTEM nfsd
7 
8 #if !defined(_NFSD_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _NFSD_TRACE_H
10 
11 #include <linux/tracepoint.h>
12 
13 #include "export.h"
14 #include "nfsfh.h"
15 
16 #define NFSD_TRACE_PROC_RES_FIELDS \
17 		__field(unsigned int, netns_ino) \
18 		__field(u32, xid) \
19 		__field(unsigned long, status) \
20 		__array(unsigned char, server, sizeof(struct sockaddr_in6)) \
21 		__array(unsigned char, client, sizeof(struct sockaddr_in6))
22 
23 #define NFSD_TRACE_PROC_RES_ASSIGNMENTS(error) \
24 		do { \
25 			__entry->netns_ino = SVC_NET(rqstp)->ns.inum; \
26 			__entry->xid = be32_to_cpu(rqstp->rq_xid); \
27 			__entry->status = be32_to_cpu(error); \
28 			memcpy(__entry->server, &rqstp->rq_xprt->xpt_local, \
29 			       rqstp->rq_xprt->xpt_locallen); \
30 			memcpy(__entry->client, &rqstp->rq_xprt->xpt_remote, \
31 			       rqstp->rq_xprt->xpt_remotelen); \
32 		} while (0);
33 
34 DECLARE_EVENT_CLASS(nfsd_xdr_err_class,
35 	TP_PROTO(
36 		const struct svc_rqst *rqstp
37 	),
38 	TP_ARGS(rqstp),
39 	TP_STRUCT__entry(
40 		__field(unsigned int, netns_ino)
41 		__field(u32, xid)
42 		__field(u32, vers)
43 		__field(u32, proc)
44 		__sockaddr(server, rqstp->rq_xprt->xpt_locallen)
45 		__sockaddr(client, rqstp->rq_xprt->xpt_remotelen)
46 	),
47 	TP_fast_assign(
48 		const struct svc_xprt *xprt = rqstp->rq_xprt;
49 
50 		__entry->netns_ino = xprt->xpt_net->ns.inum;
51 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
52 		__entry->vers = rqstp->rq_vers;
53 		__entry->proc = rqstp->rq_proc;
54 		__assign_sockaddr(server, &xprt->xpt_local, xprt->xpt_locallen);
55 		__assign_sockaddr(client, &xprt->xpt_remote, xprt->xpt_remotelen);
56 	),
57 	TP_printk("xid=0x%08x vers=%u proc=%u",
58 		__entry->xid, __entry->vers, __entry->proc
59 	)
60 );
61 
62 #define DEFINE_NFSD_XDR_ERR_EVENT(name) \
63 DEFINE_EVENT(nfsd_xdr_err_class, nfsd_##name##_err, \
64 	TP_PROTO(const struct svc_rqst *rqstp), \
65 	TP_ARGS(rqstp))
66 
67 DEFINE_NFSD_XDR_ERR_EVENT(garbage_args);
68 DEFINE_NFSD_XDR_ERR_EVENT(cant_encode);
69 
70 #define show_nfsd_may_flags(x)						\
71 	__print_flags(x, "|",						\
72 		{ NFSD_MAY_EXEC,		"EXEC" },		\
73 		{ NFSD_MAY_WRITE,		"WRITE" },		\
74 		{ NFSD_MAY_READ,		"READ" },		\
75 		{ NFSD_MAY_SATTR,		"SATTR" },		\
76 		{ NFSD_MAY_TRUNC,		"TRUNC" },		\
77 		{ NFSD_MAY_LOCK,		"LOCK" },		\
78 		{ NFSD_MAY_OWNER_OVERRIDE,	"OWNER_OVERRIDE" },	\
79 		{ NFSD_MAY_LOCAL_ACCESS,	"LOCAL_ACCESS" },	\
80 		{ NFSD_MAY_BYPASS_GSS_ON_ROOT,	"BYPASS_GSS_ON_ROOT" },	\
81 		{ NFSD_MAY_NOT_BREAK_LEASE,	"NOT_BREAK_LEASE" },	\
82 		{ NFSD_MAY_BYPASS_GSS,		"BYPASS_GSS" },		\
83 		{ NFSD_MAY_READ_IF_EXEC,	"READ_IF_EXEC" },	\
84 		{ NFSD_MAY_64BIT_COOKIE,	"64BIT_COOKIE" })
85 
86 TRACE_EVENT(nfsd_compound,
87 	TP_PROTO(const struct svc_rqst *rqst,
88 		 u32 args_opcnt),
89 	TP_ARGS(rqst, args_opcnt),
90 	TP_STRUCT__entry(
91 		__field(u32, xid)
92 		__field(u32, args_opcnt)
93 	),
94 	TP_fast_assign(
95 		__entry->xid = be32_to_cpu(rqst->rq_xid);
96 		__entry->args_opcnt = args_opcnt;
97 	),
98 	TP_printk("xid=0x%08x opcnt=%u",
99 		__entry->xid, __entry->args_opcnt)
100 )
101 
102 TRACE_EVENT(nfsd_compound_status,
103 	TP_PROTO(u32 args_opcnt,
104 		 u32 resp_opcnt,
105 		 __be32 status,
106 		 const char *name),
107 	TP_ARGS(args_opcnt, resp_opcnt, status, name),
108 	TP_STRUCT__entry(
109 		__field(u32, args_opcnt)
110 		__field(u32, resp_opcnt)
111 		__field(int, status)
112 		__string(name, name)
113 	),
114 	TP_fast_assign(
115 		__entry->args_opcnt = args_opcnt;
116 		__entry->resp_opcnt = resp_opcnt;
117 		__entry->status = be32_to_cpu(status);
118 		__assign_str(name, name);
119 	),
120 	TP_printk("op=%u/%u %s status=%d",
121 		__entry->resp_opcnt, __entry->args_opcnt,
122 		__get_str(name), __entry->status)
123 )
124 
125 TRACE_EVENT(nfsd_compound_decode_err,
126 	TP_PROTO(
127 		const struct svc_rqst *rqstp,
128 		u32 args_opcnt,
129 		u32 resp_opcnt,
130 		u32 opnum,
131 		__be32 status
132 	),
133 	TP_ARGS(rqstp, args_opcnt, resp_opcnt, opnum, status),
134 	TP_STRUCT__entry(
135 		NFSD_TRACE_PROC_RES_FIELDS
136 
137 		__field(u32, args_opcnt)
138 		__field(u32, resp_opcnt)
139 		__field(u32, opnum)
140 	),
141 	TP_fast_assign(
142 		NFSD_TRACE_PROC_RES_ASSIGNMENTS(status)
143 
144 		__entry->args_opcnt = args_opcnt;
145 		__entry->resp_opcnt = resp_opcnt;
146 		__entry->opnum = opnum;
147 	),
148 	TP_printk("op=%u/%u opnum=%u status=%lu",
149 		__entry->resp_opcnt, __entry->args_opcnt,
150 		__entry->opnum, __entry->status)
151 );
152 
153 TRACE_EVENT(nfsd_compound_encode_err,
154 	TP_PROTO(
155 		const struct svc_rqst *rqstp,
156 		u32 opnum,
157 		__be32 status
158 	),
159 	TP_ARGS(rqstp, opnum, status),
160 	TP_STRUCT__entry(
161 		NFSD_TRACE_PROC_RES_FIELDS
162 
163 		__field(u32, opnum)
164 	),
165 	TP_fast_assign(
166 		NFSD_TRACE_PROC_RES_ASSIGNMENTS(status)
167 
168 		__entry->opnum = opnum;
169 	),
170 	TP_printk("opnum=%u status=%lu",
171 		__entry->opnum, __entry->status)
172 );
173 
174 
175 DECLARE_EVENT_CLASS(nfsd_fh_err_class,
176 	TP_PROTO(struct svc_rqst *rqstp,
177 		 struct svc_fh	*fhp,
178 		 int		status),
179 	TP_ARGS(rqstp, fhp, status),
180 	TP_STRUCT__entry(
181 		__field(u32, xid)
182 		__field(u32, fh_hash)
183 		__field(int, status)
184 	),
185 	TP_fast_assign(
186 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
187 		__entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
188 		__entry->status = status;
189 	),
190 	TP_printk("xid=0x%08x fh_hash=0x%08x status=%d",
191 		  __entry->xid, __entry->fh_hash,
192 		  __entry->status)
193 )
194 
195 #define DEFINE_NFSD_FH_ERR_EVENT(name)		\
196 DEFINE_EVENT(nfsd_fh_err_class, nfsd_##name,	\
197 	TP_PROTO(struct svc_rqst *rqstp,	\
198 		 struct svc_fh	*fhp,		\
199 		 int		status),	\
200 	TP_ARGS(rqstp, fhp, status))
201 
202 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport);
203 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle);
204 
205 TRACE_EVENT(nfsd_exp_find_key,
206 	TP_PROTO(const struct svc_expkey *key,
207 		 int status),
208 	TP_ARGS(key, status),
209 	TP_STRUCT__entry(
210 		__field(int, fsidtype)
211 		__array(u32, fsid, 6)
212 		__string(auth_domain, key->ek_client->name)
213 		__field(int, status)
214 	),
215 	TP_fast_assign(
216 		__entry->fsidtype = key->ek_fsidtype;
217 		memcpy(__entry->fsid, key->ek_fsid, 4*6);
218 		__assign_str(auth_domain, key->ek_client->name);
219 		__entry->status = status;
220 	),
221 	TP_printk("fsid=%x::%s domain=%s status=%d",
222 		__entry->fsidtype,
223 		__print_array(__entry->fsid, 6, 4),
224 		__get_str(auth_domain),
225 		__entry->status
226 	)
227 );
228 
229 TRACE_EVENT(nfsd_expkey_update,
230 	TP_PROTO(const struct svc_expkey *key, const char *exp_path),
231 	TP_ARGS(key, exp_path),
232 	TP_STRUCT__entry(
233 		__field(int, fsidtype)
234 		__array(u32, fsid, 6)
235 		__string(auth_domain, key->ek_client->name)
236 		__string(path, exp_path)
237 		__field(bool, cache)
238 	),
239 	TP_fast_assign(
240 		__entry->fsidtype = key->ek_fsidtype;
241 		memcpy(__entry->fsid, key->ek_fsid, 4*6);
242 		__assign_str(auth_domain, key->ek_client->name);
243 		__assign_str(path, exp_path);
244 		__entry->cache = !test_bit(CACHE_NEGATIVE, &key->h.flags);
245 	),
246 	TP_printk("fsid=%x::%s domain=%s path=%s cache=%s",
247 		__entry->fsidtype,
248 		__print_array(__entry->fsid, 6, 4),
249 		__get_str(auth_domain),
250 		__get_str(path),
251 		__entry->cache ? "pos" : "neg"
252 	)
253 );
254 
255 TRACE_EVENT(nfsd_exp_get_by_name,
256 	TP_PROTO(const struct svc_export *key,
257 		 int status),
258 	TP_ARGS(key, status),
259 	TP_STRUCT__entry(
260 		__string(path, key->ex_path.dentry->d_name.name)
261 		__string(auth_domain, key->ex_client->name)
262 		__field(int, status)
263 	),
264 	TP_fast_assign(
265 		__assign_str(path, key->ex_path.dentry->d_name.name);
266 		__assign_str(auth_domain, key->ex_client->name);
267 		__entry->status = status;
268 	),
269 	TP_printk("path=%s domain=%s status=%d",
270 		__get_str(path),
271 		__get_str(auth_domain),
272 		__entry->status
273 	)
274 );
275 
276 TRACE_EVENT(nfsd_export_update,
277 	TP_PROTO(const struct svc_export *key),
278 	TP_ARGS(key),
279 	TP_STRUCT__entry(
280 		__string(path, key->ex_path.dentry->d_name.name)
281 		__string(auth_domain, key->ex_client->name)
282 		__field(bool, cache)
283 	),
284 	TP_fast_assign(
285 		__assign_str(path, key->ex_path.dentry->d_name.name);
286 		__assign_str(auth_domain, key->ex_client->name);
287 		__entry->cache = !test_bit(CACHE_NEGATIVE, &key->h.flags);
288 	),
289 	TP_printk("path=%s domain=%s cache=%s",
290 		__get_str(path),
291 		__get_str(auth_domain),
292 		__entry->cache ? "pos" : "neg"
293 	)
294 );
295 
296 DECLARE_EVENT_CLASS(nfsd_io_class,
297 	TP_PROTO(struct svc_rqst *rqstp,
298 		 struct svc_fh	*fhp,
299 		 u64		offset,
300 		 u32		len),
301 	TP_ARGS(rqstp, fhp, offset, len),
302 	TP_STRUCT__entry(
303 		__field(u32, xid)
304 		__field(u32, fh_hash)
305 		__field(u64, offset)
306 		__field(u32, len)
307 	),
308 	TP_fast_assign(
309 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
310 		__entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
311 		__entry->offset = offset;
312 		__entry->len = len;
313 	),
314 	TP_printk("xid=0x%08x fh_hash=0x%08x offset=%llu len=%u",
315 		  __entry->xid, __entry->fh_hash,
316 		  __entry->offset, __entry->len)
317 )
318 
319 #define DEFINE_NFSD_IO_EVENT(name)		\
320 DEFINE_EVENT(nfsd_io_class, nfsd_##name,	\
321 	TP_PROTO(struct svc_rqst *rqstp,	\
322 		 struct svc_fh	*fhp,		\
323 		 u64		offset,		\
324 		 u32		len),		\
325 	TP_ARGS(rqstp, fhp, offset, len))
326 
327 DEFINE_NFSD_IO_EVENT(read_start);
328 DEFINE_NFSD_IO_EVENT(read_splice);
329 DEFINE_NFSD_IO_EVENT(read_vector);
330 DEFINE_NFSD_IO_EVENT(read_io_done);
331 DEFINE_NFSD_IO_EVENT(read_done);
332 DEFINE_NFSD_IO_EVENT(write_start);
333 DEFINE_NFSD_IO_EVENT(write_opened);
334 DEFINE_NFSD_IO_EVENT(write_io_done);
335 DEFINE_NFSD_IO_EVENT(write_done);
336 
337 DECLARE_EVENT_CLASS(nfsd_err_class,
338 	TP_PROTO(struct svc_rqst *rqstp,
339 		 struct svc_fh	*fhp,
340 		 loff_t		offset,
341 		 int		status),
342 	TP_ARGS(rqstp, fhp, offset, status),
343 	TP_STRUCT__entry(
344 		__field(u32, xid)
345 		__field(u32, fh_hash)
346 		__field(loff_t, offset)
347 		__field(int, status)
348 	),
349 	TP_fast_assign(
350 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
351 		__entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle);
352 		__entry->offset = offset;
353 		__entry->status = status;
354 	),
355 	TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld status=%d",
356 		  __entry->xid, __entry->fh_hash,
357 		  __entry->offset, __entry->status)
358 )
359 
360 #define DEFINE_NFSD_ERR_EVENT(name)		\
361 DEFINE_EVENT(nfsd_err_class, nfsd_##name,	\
362 	TP_PROTO(struct svc_rqst *rqstp,	\
363 		 struct svc_fh	*fhp,		\
364 		 loff_t		offset,		\
365 		 int		len),		\
366 	TP_ARGS(rqstp, fhp, offset, len))
367 
368 DEFINE_NFSD_ERR_EVENT(read_err);
369 DEFINE_NFSD_ERR_EVENT(write_err);
370 
371 TRACE_EVENT(nfsd_dirent,
372 	TP_PROTO(struct svc_fh *fhp,
373 		 u64 ino,
374 		 const char *name,
375 		 int namlen),
376 	TP_ARGS(fhp, ino, name, namlen),
377 	TP_STRUCT__entry(
378 		__field(u32, fh_hash)
379 		__field(u64, ino)
380 		__string_len(name, name, namlen)
381 	),
382 	TP_fast_assign(
383 		__entry->fh_hash = fhp ? knfsd_fh_hash(&fhp->fh_handle) : 0;
384 		__entry->ino = ino;
385 		__assign_str_len(name, name, namlen)
386 	),
387 	TP_printk("fh_hash=0x%08x ino=%llu name=%s",
388 		__entry->fh_hash, __entry->ino, __get_str(name)
389 	)
390 )
391 
392 DECLARE_EVENT_CLASS(nfsd_copy_err_class,
393 	TP_PROTO(struct svc_rqst *rqstp,
394 		 struct svc_fh	*src_fhp,
395 		 loff_t		src_offset,
396 		 struct svc_fh	*dst_fhp,
397 		 loff_t		dst_offset,
398 		 u64		count,
399 		 int		status),
400 	TP_ARGS(rqstp, src_fhp, src_offset, dst_fhp, dst_offset, count, status),
401 	TP_STRUCT__entry(
402 		__field(u32, xid)
403 		__field(u32, src_fh_hash)
404 		__field(loff_t, src_offset)
405 		__field(u32, dst_fh_hash)
406 		__field(loff_t, dst_offset)
407 		__field(u64, count)
408 		__field(int, status)
409 	),
410 	TP_fast_assign(
411 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
412 		__entry->src_fh_hash = knfsd_fh_hash(&src_fhp->fh_handle);
413 		__entry->src_offset = src_offset;
414 		__entry->dst_fh_hash = knfsd_fh_hash(&dst_fhp->fh_handle);
415 		__entry->dst_offset = dst_offset;
416 		__entry->count = count;
417 		__entry->status = status;
418 	),
419 	TP_printk("xid=0x%08x src_fh_hash=0x%08x src_offset=%lld "
420 			"dst_fh_hash=0x%08x dst_offset=%lld "
421 			"count=%llu status=%d",
422 		  __entry->xid, __entry->src_fh_hash, __entry->src_offset,
423 		  __entry->dst_fh_hash, __entry->dst_offset,
424 		  (unsigned long long)__entry->count,
425 		  __entry->status)
426 )
427 
428 #define DEFINE_NFSD_COPY_ERR_EVENT(name)		\
429 DEFINE_EVENT(nfsd_copy_err_class, nfsd_##name,		\
430 	TP_PROTO(struct svc_rqst	*rqstp,		\
431 		 struct svc_fh		*src_fhp,	\
432 		 loff_t			src_offset,	\
433 		 struct svc_fh		*dst_fhp,	\
434 		 loff_t			dst_offset,	\
435 		 u64			count,		\
436 		 int			status),	\
437 	TP_ARGS(rqstp, src_fhp, src_offset, dst_fhp, dst_offset, \
438 		count, status))
439 
440 DEFINE_NFSD_COPY_ERR_EVENT(clone_file_range_err);
441 
442 #include "state.h"
443 #include "filecache.h"
444 #include "vfs.h"
445 
446 DECLARE_EVENT_CLASS(nfsd_stateid_class,
447 	TP_PROTO(stateid_t *stp),
448 	TP_ARGS(stp),
449 	TP_STRUCT__entry(
450 		__field(u32, cl_boot)
451 		__field(u32, cl_id)
452 		__field(u32, si_id)
453 		__field(u32, si_generation)
454 	),
455 	TP_fast_assign(
456 		__entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
457 		__entry->cl_id = stp->si_opaque.so_clid.cl_id;
458 		__entry->si_id = stp->si_opaque.so_id;
459 		__entry->si_generation = stp->si_generation;
460 	),
461 	TP_printk("client %08x:%08x stateid %08x:%08x",
462 		__entry->cl_boot,
463 		__entry->cl_id,
464 		__entry->si_id,
465 		__entry->si_generation)
466 )
467 
468 #define DEFINE_STATEID_EVENT(name) \
469 DEFINE_EVENT(nfsd_stateid_class, nfsd_##name, \
470 	TP_PROTO(stateid_t *stp), \
471 	TP_ARGS(stp))
472 
473 DEFINE_STATEID_EVENT(layoutstate_alloc);
474 DEFINE_STATEID_EVENT(layoutstate_unhash);
475 DEFINE_STATEID_EVENT(layoutstate_free);
476 DEFINE_STATEID_EVENT(layout_get_lookup_fail);
477 DEFINE_STATEID_EVENT(layout_commit_lookup_fail);
478 DEFINE_STATEID_EVENT(layout_return_lookup_fail);
479 DEFINE_STATEID_EVENT(layout_recall);
480 DEFINE_STATEID_EVENT(layout_recall_done);
481 DEFINE_STATEID_EVENT(layout_recall_fail);
482 DEFINE_STATEID_EVENT(layout_recall_release);
483 
484 DEFINE_STATEID_EVENT(open);
485 DEFINE_STATEID_EVENT(deleg_read);
486 DEFINE_STATEID_EVENT(deleg_recall);
487 
488 DECLARE_EVENT_CLASS(nfsd_stateseqid_class,
489 	TP_PROTO(u32 seqid, const stateid_t *stp),
490 	TP_ARGS(seqid, stp),
491 	TP_STRUCT__entry(
492 		__field(u32, seqid)
493 		__field(u32, cl_boot)
494 		__field(u32, cl_id)
495 		__field(u32, si_id)
496 		__field(u32, si_generation)
497 	),
498 	TP_fast_assign(
499 		__entry->seqid = seqid;
500 		__entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
501 		__entry->cl_id = stp->si_opaque.so_clid.cl_id;
502 		__entry->si_id = stp->si_opaque.so_id;
503 		__entry->si_generation = stp->si_generation;
504 	),
505 	TP_printk("seqid=%u client %08x:%08x stateid %08x:%08x",
506 		__entry->seqid, __entry->cl_boot, __entry->cl_id,
507 		__entry->si_id, __entry->si_generation)
508 )
509 
510 #define DEFINE_STATESEQID_EVENT(name) \
511 DEFINE_EVENT(nfsd_stateseqid_class, nfsd_##name, \
512 	TP_PROTO(u32 seqid, const stateid_t *stp), \
513 	TP_ARGS(seqid, stp))
514 
515 DEFINE_STATESEQID_EVENT(preprocess);
516 DEFINE_STATESEQID_EVENT(open_confirm);
517 
518 DECLARE_EVENT_CLASS(nfsd_clientid_class,
519 	TP_PROTO(const clientid_t *clid),
520 	TP_ARGS(clid),
521 	TP_STRUCT__entry(
522 		__field(u32, cl_boot)
523 		__field(u32, cl_id)
524 	),
525 	TP_fast_assign(
526 		__entry->cl_boot = clid->cl_boot;
527 		__entry->cl_id = clid->cl_id;
528 	),
529 	TP_printk("client %08x:%08x", __entry->cl_boot, __entry->cl_id)
530 )
531 
532 #define DEFINE_CLIENTID_EVENT(name) \
533 DEFINE_EVENT(nfsd_clientid_class, nfsd_clid_##name, \
534 	TP_PROTO(const clientid_t *clid), \
535 	TP_ARGS(clid))
536 
537 DEFINE_CLIENTID_EVENT(expire_unconf);
538 DEFINE_CLIENTID_EVENT(reclaim_complete);
539 DEFINE_CLIENTID_EVENT(confirmed);
540 DEFINE_CLIENTID_EVENT(destroyed);
541 DEFINE_CLIENTID_EVENT(admin_expired);
542 DEFINE_CLIENTID_EVENT(replaced);
543 DEFINE_CLIENTID_EVENT(purged);
544 DEFINE_CLIENTID_EVENT(renew);
545 DEFINE_CLIENTID_EVENT(stale);
546 
547 DECLARE_EVENT_CLASS(nfsd_net_class,
548 	TP_PROTO(const struct nfsd_net *nn),
549 	TP_ARGS(nn),
550 	TP_STRUCT__entry(
551 		__field(unsigned long long, boot_time)
552 	),
553 	TP_fast_assign(
554 		__entry->boot_time = nn->boot_time;
555 	),
556 	TP_printk("boot_time=%16llx", __entry->boot_time)
557 )
558 
559 #define DEFINE_NET_EVENT(name) \
560 DEFINE_EVENT(nfsd_net_class, nfsd_##name, \
561 	TP_PROTO(const struct nfsd_net *nn), \
562 	TP_ARGS(nn))
563 
564 DEFINE_NET_EVENT(grace_start);
565 DEFINE_NET_EVENT(grace_complete);
566 
567 TRACE_EVENT(nfsd_writeverf_reset,
568 	TP_PROTO(
569 		const struct nfsd_net *nn,
570 		const struct svc_rqst *rqstp,
571 		int error
572 	),
573 	TP_ARGS(nn, rqstp, error),
574 	TP_STRUCT__entry(
575 		__field(unsigned long long, boot_time)
576 		__field(u32, xid)
577 		__field(int, error)
578 		__array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
579 	),
580 	TP_fast_assign(
581 		__entry->boot_time = nn->boot_time;
582 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
583 		__entry->error = error;
584 
585 		/* avoid seqlock inside TP_fast_assign */
586 		memcpy(__entry->verifier, nn->writeverf,
587 		       NFS4_VERIFIER_SIZE);
588 	),
589 	TP_printk("boot_time=%16llx xid=0x%08x error=%d new verifier=0x%s",
590 		__entry->boot_time, __entry->xid, __entry->error,
591 		__print_hex_str(__entry->verifier, NFS4_VERIFIER_SIZE)
592 	)
593 );
594 
595 TRACE_EVENT(nfsd_clid_cred_mismatch,
596 	TP_PROTO(
597 		const struct nfs4_client *clp,
598 		const struct svc_rqst *rqstp
599 	),
600 	TP_ARGS(clp, rqstp),
601 	TP_STRUCT__entry(
602 		__field(u32, cl_boot)
603 		__field(u32, cl_id)
604 		__field(unsigned long, cl_flavor)
605 		__field(unsigned long, new_flavor)
606 		__sockaddr(addr, rqstp->rq_xprt->xpt_remotelen)
607 	),
608 	TP_fast_assign(
609 		__entry->cl_boot = clp->cl_clientid.cl_boot;
610 		__entry->cl_id = clp->cl_clientid.cl_id;
611 		__entry->cl_flavor = clp->cl_cred.cr_flavor;
612 		__entry->new_flavor = rqstp->rq_cred.cr_flavor;
613 		__assign_sockaddr(addr, &rqstp->rq_xprt->xpt_remote,
614 				  rqstp->rq_xprt->xpt_remotelen);
615 	),
616 	TP_printk("client %08x:%08x flavor=%s, conflict=%s from addr=%pISpc",
617 		__entry->cl_boot, __entry->cl_id,
618 		show_nfsd_authflavor(__entry->cl_flavor),
619 		show_nfsd_authflavor(__entry->new_flavor),
620 		__get_sockaddr(addr)
621 	)
622 )
623 
624 TRACE_EVENT(nfsd_clid_verf_mismatch,
625 	TP_PROTO(
626 		const struct nfs4_client *clp,
627 		const struct svc_rqst *rqstp,
628 		const nfs4_verifier *verf
629 	),
630 	TP_ARGS(clp, rqstp, verf),
631 	TP_STRUCT__entry(
632 		__field(u32, cl_boot)
633 		__field(u32, cl_id)
634 		__array(unsigned char, cl_verifier, NFS4_VERIFIER_SIZE)
635 		__array(unsigned char, new_verifier, NFS4_VERIFIER_SIZE)
636 		__sockaddr(addr, rqstp->rq_xprt->xpt_remotelen)
637 	),
638 	TP_fast_assign(
639 		__entry->cl_boot = clp->cl_clientid.cl_boot;
640 		__entry->cl_id = clp->cl_clientid.cl_id;
641 		memcpy(__entry->cl_verifier, (void *)&clp->cl_verifier,
642 		       NFS4_VERIFIER_SIZE);
643 		memcpy(__entry->new_verifier, (void *)verf,
644 		       NFS4_VERIFIER_SIZE);
645 		__assign_sockaddr(addr, &rqstp->rq_xprt->xpt_remote,
646 				  rqstp->rq_xprt->xpt_remotelen);
647 	),
648 	TP_printk("client %08x:%08x verf=0x%s, updated=0x%s from addr=%pISpc",
649 		__entry->cl_boot, __entry->cl_id,
650 		__print_hex_str(__entry->cl_verifier, NFS4_VERIFIER_SIZE),
651 		__print_hex_str(__entry->new_verifier, NFS4_VERIFIER_SIZE),
652 		__get_sockaddr(addr)
653 	)
654 );
655 
656 DECLARE_EVENT_CLASS(nfsd_clid_class,
657 	TP_PROTO(const struct nfs4_client *clp),
658 	TP_ARGS(clp),
659 	TP_STRUCT__entry(
660 		__field(u32, cl_boot)
661 		__field(u32, cl_id)
662 		__array(unsigned char, addr, sizeof(struct sockaddr_in6))
663 		__field(unsigned long, flavor)
664 		__array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
665 		__string_len(name, name, clp->cl_name.len)
666 	),
667 	TP_fast_assign(
668 		__entry->cl_boot = clp->cl_clientid.cl_boot;
669 		__entry->cl_id = clp->cl_clientid.cl_id;
670 		memcpy(__entry->addr, &clp->cl_addr,
671 			sizeof(struct sockaddr_in6));
672 		__entry->flavor = clp->cl_cred.cr_flavor;
673 		memcpy(__entry->verifier, (void *)&clp->cl_verifier,
674 		       NFS4_VERIFIER_SIZE);
675 		__assign_str_len(name, clp->cl_name.data, clp->cl_name.len);
676 	),
677 	TP_printk("addr=%pISpc name='%s' verifier=0x%s flavor=%s client=%08x:%08x",
678 		__entry->addr, __get_str(name),
679 		__print_hex_str(__entry->verifier, NFS4_VERIFIER_SIZE),
680 		show_nfsd_authflavor(__entry->flavor),
681 		__entry->cl_boot, __entry->cl_id)
682 );
683 
684 #define DEFINE_CLID_EVENT(name) \
685 DEFINE_EVENT(nfsd_clid_class, nfsd_clid_##name, \
686 	TP_PROTO(const struct nfs4_client *clp), \
687 	TP_ARGS(clp))
688 
689 DEFINE_CLID_EVENT(fresh);
690 DEFINE_CLID_EVENT(confirmed_r);
691 
692 /*
693  * from fs/nfsd/filecache.h
694  */
695 TRACE_DEFINE_ENUM(NFSD_FILE_HASHED);
696 TRACE_DEFINE_ENUM(NFSD_FILE_PENDING);
697 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_READ);
698 TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_WRITE);
699 TRACE_DEFINE_ENUM(NFSD_FILE_REFERENCED);
700 
701 #define show_nf_flags(val)						\
702 	__print_flags(val, "|",						\
703 		{ 1 << NFSD_FILE_HASHED,	"HASHED" },		\
704 		{ 1 << NFSD_FILE_PENDING,	"PENDING" },		\
705 		{ 1 << NFSD_FILE_BREAK_READ,	"BREAK_READ" },		\
706 		{ 1 << NFSD_FILE_BREAK_WRITE,	"BREAK_WRITE" },	\
707 		{ 1 << NFSD_FILE_REFERENCED,	"REFERENCED"})
708 
709 DECLARE_EVENT_CLASS(nfsd_file_class,
710 	TP_PROTO(struct nfsd_file *nf),
711 	TP_ARGS(nf),
712 	TP_STRUCT__entry(
713 		__field(unsigned int, nf_hashval)
714 		__field(void *, nf_inode)
715 		__field(int, nf_ref)
716 		__field(unsigned long, nf_flags)
717 		__field(unsigned char, nf_may)
718 		__field(struct file *, nf_file)
719 	),
720 	TP_fast_assign(
721 		__entry->nf_hashval = nf->nf_hashval;
722 		__entry->nf_inode = nf->nf_inode;
723 		__entry->nf_ref = refcount_read(&nf->nf_ref);
724 		__entry->nf_flags = nf->nf_flags;
725 		__entry->nf_may = nf->nf_may;
726 		__entry->nf_file = nf->nf_file;
727 	),
728 	TP_printk("hash=0x%x inode=%p ref=%d flags=%s may=%s file=%p",
729 		__entry->nf_hashval,
730 		__entry->nf_inode,
731 		__entry->nf_ref,
732 		show_nf_flags(__entry->nf_flags),
733 		show_nfsd_may_flags(__entry->nf_may),
734 		__entry->nf_file)
735 )
736 
737 #define DEFINE_NFSD_FILE_EVENT(name) \
738 DEFINE_EVENT(nfsd_file_class, name, \
739 	TP_PROTO(struct nfsd_file *nf), \
740 	TP_ARGS(nf))
741 
742 DEFINE_NFSD_FILE_EVENT(nfsd_file_alloc);
743 DEFINE_NFSD_FILE_EVENT(nfsd_file_put_final);
744 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash);
745 DEFINE_NFSD_FILE_EVENT(nfsd_file_put);
746 DEFINE_NFSD_FILE_EVENT(nfsd_file_unhash_and_release_locked);
747 
748 TRACE_EVENT(nfsd_file_acquire,
749 	TP_PROTO(struct svc_rqst *rqstp, unsigned int hash,
750 		 struct inode *inode, unsigned int may_flags,
751 		 struct nfsd_file *nf, __be32 status),
752 
753 	TP_ARGS(rqstp, hash, inode, may_flags, nf, status),
754 
755 	TP_STRUCT__entry(
756 		__field(u32, xid)
757 		__field(unsigned int, hash)
758 		__field(void *, inode)
759 		__field(unsigned long, may_flags)
760 		__field(int, nf_ref)
761 		__field(unsigned long, nf_flags)
762 		__field(unsigned long, nf_may)
763 		__field(struct file *, nf_file)
764 		__field(u32, status)
765 	),
766 
767 	TP_fast_assign(
768 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
769 		__entry->hash = hash;
770 		__entry->inode = inode;
771 		__entry->may_flags = may_flags;
772 		__entry->nf_ref = nf ? refcount_read(&nf->nf_ref) : 0;
773 		__entry->nf_flags = nf ? nf->nf_flags : 0;
774 		__entry->nf_may = nf ? nf->nf_may : 0;
775 		__entry->nf_file = nf ? nf->nf_file : NULL;
776 		__entry->status = be32_to_cpu(status);
777 	),
778 
779 	TP_printk("xid=0x%x hash=0x%x inode=%p may_flags=%s ref=%d nf_flags=%s nf_may=%s nf_file=%p status=%u",
780 			__entry->xid, __entry->hash, __entry->inode,
781 			show_nfsd_may_flags(__entry->may_flags),
782 			__entry->nf_ref, show_nf_flags(__entry->nf_flags),
783 			show_nfsd_may_flags(__entry->nf_may),
784 			__entry->nf_file, __entry->status)
785 );
786 
787 DECLARE_EVENT_CLASS(nfsd_file_search_class,
788 	TP_PROTO(struct inode *inode, unsigned int hash, int found),
789 	TP_ARGS(inode, hash, found),
790 	TP_STRUCT__entry(
791 		__field(struct inode *, inode)
792 		__field(unsigned int, hash)
793 		__field(int, found)
794 	),
795 	TP_fast_assign(
796 		__entry->inode = inode;
797 		__entry->hash = hash;
798 		__entry->found = found;
799 	),
800 	TP_printk("hash=0x%x inode=%p found=%d", __entry->hash,
801 			__entry->inode, __entry->found)
802 );
803 
804 #define DEFINE_NFSD_FILE_SEARCH_EVENT(name)				\
805 DEFINE_EVENT(nfsd_file_search_class, name,				\
806 	TP_PROTO(struct inode *inode, unsigned int hash, int found),	\
807 	TP_ARGS(inode, hash, found))
808 
809 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode_sync);
810 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_close_inode);
811 DEFINE_NFSD_FILE_SEARCH_EVENT(nfsd_file_is_cached);
812 
813 TRACE_EVENT(nfsd_file_fsnotify_handle_event,
814 	TP_PROTO(struct inode *inode, u32 mask),
815 	TP_ARGS(inode, mask),
816 	TP_STRUCT__entry(
817 		__field(struct inode *, inode)
818 		__field(unsigned int, nlink)
819 		__field(umode_t, mode)
820 		__field(u32, mask)
821 	),
822 	TP_fast_assign(
823 		__entry->inode = inode;
824 		__entry->nlink = inode->i_nlink;
825 		__entry->mode = inode->i_mode;
826 		__entry->mask = mask;
827 	),
828 	TP_printk("inode=%p nlink=%u mode=0%ho mask=0x%x", __entry->inode,
829 			__entry->nlink, __entry->mode, __entry->mask)
830 );
831 
832 #include "cache.h"
833 
834 TRACE_DEFINE_ENUM(RC_DROPIT);
835 TRACE_DEFINE_ENUM(RC_REPLY);
836 TRACE_DEFINE_ENUM(RC_DOIT);
837 
838 #define show_drc_retval(x)						\
839 	__print_symbolic(x,						\
840 		{ RC_DROPIT, "DROPIT" },				\
841 		{ RC_REPLY, "REPLY" },					\
842 		{ RC_DOIT, "DOIT" })
843 
844 TRACE_EVENT(nfsd_drc_found,
845 	TP_PROTO(
846 		const struct nfsd_net *nn,
847 		const struct svc_rqst *rqstp,
848 		int result
849 	),
850 	TP_ARGS(nn, rqstp, result),
851 	TP_STRUCT__entry(
852 		__field(unsigned long long, boot_time)
853 		__field(unsigned long, result)
854 		__field(u32, xid)
855 	),
856 	TP_fast_assign(
857 		__entry->boot_time = nn->boot_time;
858 		__entry->result = result;
859 		__entry->xid = be32_to_cpu(rqstp->rq_xid);
860 	),
861 	TP_printk("boot_time=%16llx xid=0x%08x result=%s",
862 		__entry->boot_time, __entry->xid,
863 		show_drc_retval(__entry->result))
864 
865 );
866 
867 TRACE_EVENT(nfsd_drc_mismatch,
868 	TP_PROTO(
869 		const struct nfsd_net *nn,
870 		const struct svc_cacherep *key,
871 		const struct svc_cacherep *rp
872 	),
873 	TP_ARGS(nn, key, rp),
874 	TP_STRUCT__entry(
875 		__field(unsigned long long, boot_time)
876 		__field(u32, xid)
877 		__field(u32, cached)
878 		__field(u32, ingress)
879 	),
880 	TP_fast_assign(
881 		__entry->boot_time = nn->boot_time;
882 		__entry->xid = be32_to_cpu(key->c_key.k_xid);
883 		__entry->cached = (__force u32)key->c_key.k_csum;
884 		__entry->ingress = (__force u32)rp->c_key.k_csum;
885 	),
886 	TP_printk("boot_time=%16llx xid=0x%08x cached-csum=0x%08x ingress-csum=0x%08x",
887 		__entry->boot_time, __entry->xid, __entry->cached,
888 		__entry->ingress)
889 );
890 
891 TRACE_EVENT(nfsd_cb_args,
892 	TP_PROTO(
893 		const struct nfs4_client *clp,
894 		const struct nfs4_cb_conn *conn
895 	),
896 	TP_ARGS(clp, conn),
897 	TP_STRUCT__entry(
898 		__field(u32, cl_boot)
899 		__field(u32, cl_id)
900 		__field(u32, prog)
901 		__field(u32, ident)
902 		__sockaddr(addr, conn->cb_addrlen)
903 	),
904 	TP_fast_assign(
905 		__entry->cl_boot = clp->cl_clientid.cl_boot;
906 		__entry->cl_id = clp->cl_clientid.cl_id;
907 		__entry->prog = conn->cb_prog;
908 		__entry->ident = conn->cb_ident;
909 		__assign_sockaddr(addr, &conn->cb_addr, conn->cb_addrlen);
910 	),
911 	TP_printk("addr=%pISpc client %08x:%08x prog=%u ident=%u",
912 		__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
913 		__entry->prog, __entry->ident)
914 );
915 
916 TRACE_EVENT(nfsd_cb_nodelegs,
917 	TP_PROTO(const struct nfs4_client *clp),
918 	TP_ARGS(clp),
919 	TP_STRUCT__entry(
920 		__field(u32, cl_boot)
921 		__field(u32, cl_id)
922 	),
923 	TP_fast_assign(
924 		__entry->cl_boot = clp->cl_clientid.cl_boot;
925 		__entry->cl_id = clp->cl_clientid.cl_id;
926 	),
927 	TP_printk("client %08x:%08x", __entry->cl_boot, __entry->cl_id)
928 )
929 
930 #define show_cb_state(val)						\
931 	__print_symbolic(val,						\
932 		{ NFSD4_CB_UP,		"UP" },				\
933 		{ NFSD4_CB_UNKNOWN,	"UNKNOWN" },			\
934 		{ NFSD4_CB_DOWN,	"DOWN" },			\
935 		{ NFSD4_CB_FAULT,	"FAULT"})
936 
937 DECLARE_EVENT_CLASS(nfsd_cb_class,
938 	TP_PROTO(const struct nfs4_client *clp),
939 	TP_ARGS(clp),
940 	TP_STRUCT__entry(
941 		__field(unsigned long, state)
942 		__field(u32, cl_boot)
943 		__field(u32, cl_id)
944 		__sockaddr(addr, clp->cl_cb_conn.cb_addrlen)
945 	),
946 	TP_fast_assign(
947 		__entry->state = clp->cl_cb_state;
948 		__entry->cl_boot = clp->cl_clientid.cl_boot;
949 		__entry->cl_id = clp->cl_clientid.cl_id;
950 		__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
951 				  clp->cl_cb_conn.cb_addrlen)
952 	),
953 	TP_printk("addr=%pISpc client %08x:%08x state=%s",
954 		__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
955 		show_cb_state(__entry->state))
956 );
957 
958 #define DEFINE_NFSD_CB_EVENT(name)			\
959 DEFINE_EVENT(nfsd_cb_class, nfsd_cb_##name,		\
960 	TP_PROTO(const struct nfs4_client *clp),	\
961 	TP_ARGS(clp))
962 
963 DEFINE_NFSD_CB_EVENT(state);
964 DEFINE_NFSD_CB_EVENT(probe);
965 DEFINE_NFSD_CB_EVENT(lost);
966 DEFINE_NFSD_CB_EVENT(shutdown);
967 
968 TRACE_DEFINE_ENUM(RPC_AUTH_NULL);
969 TRACE_DEFINE_ENUM(RPC_AUTH_UNIX);
970 TRACE_DEFINE_ENUM(RPC_AUTH_GSS);
971 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5);
972 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5I);
973 TRACE_DEFINE_ENUM(RPC_AUTH_GSS_KRB5P);
974 
975 #define show_nfsd_authflavor(val)					\
976 	__print_symbolic(val,						\
977 		{ RPC_AUTH_NULL,		"none" },		\
978 		{ RPC_AUTH_UNIX,		"sys" },		\
979 		{ RPC_AUTH_GSS,			"gss" },		\
980 		{ RPC_AUTH_GSS_KRB5,		"krb5" },		\
981 		{ RPC_AUTH_GSS_KRB5I,		"krb5i" },		\
982 		{ RPC_AUTH_GSS_KRB5P,		"krb5p" })
983 
984 TRACE_EVENT(nfsd_cb_setup,
985 	TP_PROTO(const struct nfs4_client *clp,
986 		 const char *netid,
987 		 rpc_authflavor_t authflavor
988 	),
989 	TP_ARGS(clp, netid, authflavor),
990 	TP_STRUCT__entry(
991 		__field(u32, cl_boot)
992 		__field(u32, cl_id)
993 		__field(unsigned long, authflavor)
994 		__sockaddr(addr, clp->cl_cb_conn.cb_addrlen)
995 		__array(unsigned char, netid, 8)
996 	),
997 	TP_fast_assign(
998 		__entry->cl_boot = clp->cl_clientid.cl_boot;
999 		__entry->cl_id = clp->cl_clientid.cl_id;
1000 		strlcpy(__entry->netid, netid, sizeof(__entry->netid));
1001 		__entry->authflavor = authflavor;
1002 		__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
1003 				  clp->cl_cb_conn.cb_addrlen)
1004 	),
1005 	TP_printk("addr=%pISpc client %08x:%08x proto=%s flavor=%s",
1006 		__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
1007 		__entry->netid, show_nfsd_authflavor(__entry->authflavor))
1008 );
1009 
1010 TRACE_EVENT(nfsd_cb_setup_err,
1011 	TP_PROTO(
1012 		const struct nfs4_client *clp,
1013 		long error
1014 	),
1015 	TP_ARGS(clp, error),
1016 	TP_STRUCT__entry(
1017 		__field(long, error)
1018 		__field(u32, cl_boot)
1019 		__field(u32, cl_id)
1020 		__sockaddr(addr, clp->cl_cb_conn.cb_addrlen)
1021 	),
1022 	TP_fast_assign(
1023 		__entry->error = error;
1024 		__entry->cl_boot = clp->cl_clientid.cl_boot;
1025 		__entry->cl_id = clp->cl_clientid.cl_id;
1026 		__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
1027 				  clp->cl_cb_conn.cb_addrlen)
1028 	),
1029 	TP_printk("addr=%pISpc client %08x:%08x error=%ld",
1030 		__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
1031 		__entry->error)
1032 );
1033 
1034 TRACE_EVENT_CONDITION(nfsd_cb_recall,
1035 	TP_PROTO(
1036 		const struct nfs4_stid *stid
1037 	),
1038 	TP_ARGS(stid),
1039 	TP_CONDITION(stid->sc_client),
1040 	TP_STRUCT__entry(
1041 		__field(u32, cl_boot)
1042 		__field(u32, cl_id)
1043 		__field(u32, si_id)
1044 		__field(u32, si_generation)
1045 		__sockaddr(addr, stid->sc_client->cl_cb_conn.cb_addrlen)
1046 	),
1047 	TP_fast_assign(
1048 		const stateid_t *stp = &stid->sc_stateid;
1049 		const struct nfs4_client *clp = stid->sc_client;
1050 
1051 		__entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
1052 		__entry->cl_id = stp->si_opaque.so_clid.cl_id;
1053 		__entry->si_id = stp->si_opaque.so_id;
1054 		__entry->si_generation = stp->si_generation;
1055 		__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
1056 				  clp->cl_cb_conn.cb_addrlen)
1057 	),
1058 	TP_printk("addr=%pISpc client %08x:%08x stateid %08x:%08x",
1059 		__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
1060 		__entry->si_id, __entry->si_generation)
1061 );
1062 
1063 TRACE_EVENT(nfsd_cb_notify_lock,
1064 	TP_PROTO(
1065 		const struct nfs4_lockowner *lo,
1066 		const struct nfsd4_blocked_lock *nbl
1067 	),
1068 	TP_ARGS(lo, nbl),
1069 	TP_STRUCT__entry(
1070 		__field(u32, cl_boot)
1071 		__field(u32, cl_id)
1072 		__field(u32, fh_hash)
1073 		__sockaddr(addr, lo->lo_owner.so_client->cl_cb_conn.cb_addrlen)
1074 	),
1075 	TP_fast_assign(
1076 		const struct nfs4_client *clp = lo->lo_owner.so_client;
1077 
1078 		__entry->cl_boot = clp->cl_clientid.cl_boot;
1079 		__entry->cl_id = clp->cl_clientid.cl_id;
1080 		__entry->fh_hash = knfsd_fh_hash(&nbl->nbl_fh);
1081 		__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
1082 				  clp->cl_cb_conn.cb_addrlen)
1083 	),
1084 	TP_printk("addr=%pISpc client %08x:%08x fh_hash=0x%08x",
1085 		__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
1086 		__entry->fh_hash)
1087 );
1088 
1089 TRACE_EVENT(nfsd_cb_offload,
1090 	TP_PROTO(
1091 		const struct nfs4_client *clp,
1092 		const stateid_t *stp,
1093 		const struct knfsd_fh *fh,
1094 		u64 count,
1095 		__be32 status
1096 	),
1097 	TP_ARGS(clp, stp, fh, count, status),
1098 	TP_STRUCT__entry(
1099 		__field(u32, cl_boot)
1100 		__field(u32, cl_id)
1101 		__field(u32, si_id)
1102 		__field(u32, si_generation)
1103 		__field(u32, fh_hash)
1104 		__field(int, status)
1105 		__field(u64, count)
1106 		__sockaddr(addr, clp->cl_cb_conn.cb_addrlen)
1107 	),
1108 	TP_fast_assign(
1109 		__entry->cl_boot = stp->si_opaque.so_clid.cl_boot;
1110 		__entry->cl_id = stp->si_opaque.so_clid.cl_id;
1111 		__entry->si_id = stp->si_opaque.so_id;
1112 		__entry->si_generation = stp->si_generation;
1113 		__entry->fh_hash = knfsd_fh_hash(fh);
1114 		__entry->status = be32_to_cpu(status);
1115 		__entry->count = count;
1116 		__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
1117 				  clp->cl_cb_conn.cb_addrlen)
1118 	),
1119 	TP_printk("addr=%pISpc client %08x:%08x stateid %08x:%08x fh_hash=0x%08x count=%llu status=%d",
1120 		__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
1121 		__entry->si_id, __entry->si_generation,
1122 		__entry->fh_hash, __entry->count, __entry->status)
1123 );
1124 
1125 #endif /* _NFSD_TRACE_H */
1126 
1127 #undef TRACE_INCLUDE_PATH
1128 #define TRACE_INCLUDE_PATH .
1129 #define TRACE_INCLUDE_FILE trace
1130 #include <trace/define_trace.h>
1131