~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/lockd/trace.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #undef TRACE_SYSTEM
  3 #define TRACE_SYSTEM lockd
  4 
  5 #if !defined(_TRACE_LOCKD_H) || defined(TRACE_HEADER_MULTI_READ)
  6 #define _TRACE_LOCKD_H
  7 
  8 #include <linux/tracepoint.h>
  9 #include <linux/crc32.h>
 10 #include <linux/nfs.h>
 11 #include <linux/lockd/lockd.h>
 12 
 13 #ifdef CONFIG_LOCKD_V4
 14 #define NLM_STATUS_LIST                                 \
 15         nlm_status_code(LCK_GRANTED)                    \
 16         nlm_status_code(LCK_DENIED)                     \
 17         nlm_status_code(LCK_DENIED_NOLOCKS)             \
 18         nlm_status_code(LCK_BLOCKED)                    \
 19         nlm_status_code(LCK_DENIED_GRACE_PERIOD)        \
 20         nlm_status_code(DEADLCK)                        \
 21         nlm_status_code(ROFS)                           \
 22         nlm_status_code(STALE_FH)                       \
 23         nlm_status_code(FBIG)                           \
 24         nlm_status_code_end(FAILED)
 25 #else
 26 #define NLM_STATUS_LIST                                 \
 27         nlm_status_code(LCK_GRANTED)                    \
 28         nlm_status_code(LCK_DENIED)                     \
 29         nlm_status_code(LCK_DENIED_NOLOCKS)             \
 30         nlm_status_code(LCK_BLOCKED)                    \
 31         nlm_status_code_end(LCK_DENIED_GRACE_PERIOD)
 32 #endif
 33 
 34 #undef nlm_status_code
 35 #undef nlm_status_code_end
 36 #define nlm_status_code(x)      TRACE_DEFINE_ENUM(NLM_##x);
 37 #define nlm_status_code_end(x)  TRACE_DEFINE_ENUM(NLM_##x);
 38 
 39 NLM_STATUS_LIST
 40 
 41 #undef nlm_status_code
 42 #undef nlm_status_code_end
 43 #define nlm_status_code(x)      { NLM_##x, #x },
 44 #define nlm_status_code_end(x)  { NLM_##x, #x }
 45 
 46 #define show_nlm_status(x)      __print_symbolic(x, NLM_STATUS_LIST)
 47 
 48 DECLARE_EVENT_CLASS(nlmclnt_lock_event,
 49                 TP_PROTO(
 50                         const struct nlm_lock *lock,
 51                         const struct sockaddr *addr,
 52                         unsigned int addrlen,
 53                         __be32 status
 54                 ),
 55 
 56                 TP_ARGS(lock, addr, addrlen, status),
 57 
 58                 TP_STRUCT__entry(
 59                         __field(u32, oh)
 60                         __field(u32, svid)
 61                         __field(u32, fh)
 62                         __field(unsigned long, status)
 63                         __field(u64, start)
 64                         __field(u64, len)
 65                         __sockaddr(addr, addrlen)
 66                 ),
 67 
 68                 TP_fast_assign(
 69                         __entry->oh = ~crc32_le(0xffffffff, lock->oh.data, lock->oh.len);
 70                         __entry->svid = lock->svid;
 71                         __entry->fh = nfs_fhandle_hash(&lock->fh);
 72                         __entry->start = lock->lock_start;
 73                         __entry->len = lock->lock_len;
 74                         __entry->status = be32_to_cpu(status);
 75                         __assign_sockaddr(addr, addr, addrlen);
 76                 ),
 77 
 78                 TP_printk(
 79                         "addr=%pISpc oh=0x%08x svid=0x%08x fh=0x%08x start=%llu len=%llu status=%s",
 80                         __get_sockaddr(addr), __entry->oh, __entry->svid,
 81                         __entry->fh, __entry->start, __entry->len,
 82                         show_nlm_status(__entry->status)
 83                 )
 84 );
 85 
 86 #define DEFINE_NLMCLNT_EVENT(name)                              \
 87         DEFINE_EVENT(nlmclnt_lock_event, name,                  \
 88                         TP_PROTO(                               \
 89                                 const struct nlm_lock *lock,    \
 90                                 const struct sockaddr *addr,    \
 91                                 unsigned int addrlen,           \
 92                                 __be32  status                  \
 93                         ),                                      \
 94                         TP_ARGS(lock, addr, addrlen, status))
 95 
 96 DEFINE_NLMCLNT_EVENT(nlmclnt_test);
 97 DEFINE_NLMCLNT_EVENT(nlmclnt_lock);
 98 DEFINE_NLMCLNT_EVENT(nlmclnt_unlock);
 99 DEFINE_NLMCLNT_EVENT(nlmclnt_grant);
100 
101 #endif /* _TRACE_LOCKD_H */
102 
103 #undef TRACE_INCLUDE_PATH
104 #define TRACE_INCLUDE_PATH .
105 #define TRACE_INCLUDE_FILE trace
106 #include <trace/define_trace.h>
107 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php