aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4trace.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-14 17:58:28 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-22 08:58:27 -0400
commit2f92ae343e2358a4936c2470debfc4424b29eb3e (patch)
tree4b26d5165fdaea44f009c8544d54330a31c5ce8a /fs/nfs/nfs4trace.h
parent1037e6eaa37a42cec877f103c091cfe5304f4450 (diff)
NFSv4.1: Add tracepoints for debugging slot table operations
Add tracepoints to nfs41_setup_sequence and nfs41_sequence_done to track session and slot table state changes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4trace.h')
-rw-r--r--fs/nfs/nfs4trace.h139
1 files changed, 139 insertions, 0 deletions
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index b2a2d8a30c66..05b96a6dac5c 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -240,6 +240,145 @@ DEFINE_NFS4_CLIENTID_EVENT(nfs4_destroy_clientid);
240DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session); 240DEFINE_NFS4_CLIENTID_EVENT(nfs4_bind_conn_to_session);
241DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence); 241DEFINE_NFS4_CLIENTID_EVENT(nfs4_sequence);
242DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete); 242DEFINE_NFS4_CLIENTID_EVENT(nfs4_reclaim_complete);
243
244TRACE_EVENT(nfs4_setup_sequence,
245 TP_PROTO(
246 const struct nfs4_session *session,
247 const struct nfs4_sequence_args *args
248 ),
249 TP_ARGS(session, args),
250
251 TP_STRUCT__entry(
252 __field(unsigned int, session)
253 __field(unsigned int, slot_nr)
254 __field(unsigned int, seq_nr)
255 __field(unsigned int, highest_used_slotid)
256 ),
257
258 TP_fast_assign(
259 const struct nfs4_slot *sa_slot = args->sa_slot;
260 __entry->session = nfs_session_id_hash(&session->sess_id);
261 __entry->slot_nr = sa_slot->slot_nr;
262 __entry->seq_nr = sa_slot->seq_nr;
263 __entry->highest_used_slotid =
264 sa_slot->table->highest_used_slotid;
265 ),
266 TP_printk(
267 "session=0x%08x slot_nr=%u seq_nr=%u "
268 "highest_used_slotid=%u",
269 __entry->session,
270 __entry->slot_nr,
271 __entry->seq_nr,
272 __entry->highest_used_slotid
273 )
274);
275
276#define show_nfs4_sequence_status_flags(status) \
277 __print_flags((unsigned long)status, "|", \
278 { SEQ4_STATUS_CB_PATH_DOWN, "CB_PATH_DOWN" }, \
279 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING, \
280 "CB_GSS_CONTEXTS_EXPIRING" }, \
281 { SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED, \
282 "CB_GSS_CONTEXTS_EXPIRED" }, \
283 { SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, \
284 "EXPIRED_ALL_STATE_REVOKED" }, \
285 { SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, \
286 "EXPIRED_SOME_STATE_REVOKED" }, \
287 { SEQ4_STATUS_ADMIN_STATE_REVOKED, \
288 "ADMIN_STATE_REVOKED" }, \
289 { SEQ4_STATUS_RECALLABLE_STATE_REVOKED, \
290 "RECALLABLE_STATE_REVOKED" }, \
291 { SEQ4_STATUS_LEASE_MOVED, "LEASE_MOVED" }, \
292 { SEQ4_STATUS_RESTART_RECLAIM_NEEDED, \
293 "RESTART_RECLAIM_NEEDED" }, \
294 { SEQ4_STATUS_CB_PATH_DOWN_SESSION, \
295 "CB_PATH_DOWN_SESSION" }, \
296 { SEQ4_STATUS_BACKCHANNEL_FAULT, \
297 "BACKCHANNEL_FAULT" })
298
299TRACE_EVENT(nfs4_sequence_done,
300 TP_PROTO(
301 const struct nfs4_session *session,
302 const struct nfs4_sequence_res *res
303 ),
304 TP_ARGS(session, res),
305
306 TP_STRUCT__entry(
307 __field(unsigned int, session)
308 __field(unsigned int, slot_nr)
309 __field(unsigned int, seq_nr)
310 __field(unsigned int, highest_slotid)
311 __field(unsigned int, target_highest_slotid)
312 __field(unsigned int, status_flags)
313 __field(int, error)
314 ),
315
316 TP_fast_assign(
317 const struct nfs4_slot *sr_slot = res->sr_slot;
318 __entry->session = nfs_session_id_hash(&session->sess_id);
319 __entry->slot_nr = sr_slot->slot_nr;
320 __entry->seq_nr = sr_slot->seq_nr;
321 __entry->highest_slotid = res->sr_highest_slotid;
322 __entry->target_highest_slotid =
323 res->sr_target_highest_slotid;
324 __entry->error = res->sr_status;
325 ),
326 TP_printk(
327 "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u "
328 "highest_slotid=%u target_highest_slotid=%u "
329 "status_flags=%u (%s)",
330 __entry->error,
331 show_nfsv4_errors(__entry->error),
332 __entry->session,
333 __entry->slot_nr,
334 __entry->seq_nr,
335 __entry->highest_slotid,
336 __entry->target_highest_slotid,
337 __entry->status_flags,
338 show_nfs4_sequence_status_flags(__entry->status_flags)
339 )
340);
341
342struct cb_sequenceargs;
343struct cb_sequenceres;
344
345TRACE_EVENT(nfs4_cb_sequence,
346 TP_PROTO(
347 const struct cb_sequenceargs *args,
348 const struct cb_sequenceres *res,
349 __be32 status
350 ),
351 TP_ARGS(args, res, status),
352
353 TP_STRUCT__entry(
354 __field(unsigned int, session)
355 __field(unsigned int, slot_nr)
356 __field(unsigned int, seq_nr)
357 __field(unsigned int, highest_slotid)
358 __field(unsigned int, cachethis)
359 __field(int, error)
360 ),
361
362 TP_fast_assign(
363 __entry->session = nfs_session_id_hash(&args->csa_sessionid);
364 __entry->slot_nr = args->csa_slotid;
365 __entry->seq_nr = args->csa_sequenceid;
366 __entry->highest_slotid = args->csa_highestslotid;
367 __entry->cachethis = args->csa_cachethis;
368 __entry->error = -be32_to_cpu(status);
369 ),
370
371 TP_printk(
372 "error=%d (%s) session=0x%08x slot_nr=%u seq_nr=%u "
373 "highest_slotid=%u",
374 __entry->error,
375 show_nfsv4_errors(__entry->error),
376 __entry->session,
377 __entry->slot_nr,
378 __entry->seq_nr,
379 __entry->highest_slotid
380 )
381);
243#endif /* CONFIG_NFS_V4_1 */ 382#endif /* CONFIG_NFS_V4_1 */
244 383
245DECLARE_EVENT_CLASS(nfs4_open_event, 384DECLARE_EVENT_CLASS(nfs4_open_event,