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

TOMOYO Linux Cross Reference
Linux/include/trace/events/lock.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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 lock
  4 
  5 #if !defined(_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ)
  6 #define _TRACE_LOCK_H
  7 
  8 #include <linux/sched.h>
  9 #include <linux/tracepoint.h>
 10 
 11 /* flags for lock:contention_begin */
 12 #define LCB_F_SPIN      (1U << 0)
 13 #define LCB_F_READ      (1U << 1)
 14 #define LCB_F_WRITE     (1U << 2)
 15 #define LCB_F_RT        (1U << 3)
 16 #define LCB_F_PERCPU    (1U << 4)
 17 #define LCB_F_MUTEX     (1U << 5)
 18 
 19 
 20 #ifdef CONFIG_LOCKDEP
 21 
 22 #include <linux/lockdep.h>
 23 
 24 TRACE_EVENT(lock_acquire,
 25 
 26         TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
 27                 int trylock, int read, int check,
 28                 struct lockdep_map *next_lock, unsigned long ip),
 29 
 30         TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
 31 
 32         TP_STRUCT__entry(
 33                 __field(unsigned int, flags)
 34                 __string(name, lock->name)
 35                 __field(void *, lockdep_addr)
 36         ),
 37 
 38         TP_fast_assign(
 39                 __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0);
 40                 __assign_str(name);
 41                 __entry->lockdep_addr = lock;
 42         ),
 43 
 44         TP_printk("%p %s%s%s", __entry->lockdep_addr,
 45                   (__entry->flags & 1) ? "try " : "",
 46                   (__entry->flags & 2) ? "read " : "",
 47                   __get_str(name))
 48 );
 49 
 50 DECLARE_EVENT_CLASS(lock,
 51 
 52         TP_PROTO(struct lockdep_map *lock, unsigned long ip),
 53 
 54         TP_ARGS(lock, ip),
 55 
 56         TP_STRUCT__entry(
 57                 __string(       name,   lock->name      )
 58                 __field(        void *, lockdep_addr    )
 59         ),
 60 
 61         TP_fast_assign(
 62                 __assign_str(name);
 63                 __entry->lockdep_addr = lock;
 64         ),
 65 
 66         TP_printk("%p %s",  __entry->lockdep_addr, __get_str(name))
 67 );
 68 
 69 DEFINE_EVENT(lock, lock_release,
 70 
 71         TP_PROTO(struct lockdep_map *lock, unsigned long ip),
 72 
 73         TP_ARGS(lock, ip)
 74 );
 75 
 76 #ifdef CONFIG_LOCK_STAT
 77 
 78 DEFINE_EVENT(lock, lock_contended,
 79 
 80         TP_PROTO(struct lockdep_map *lock, unsigned long ip),
 81 
 82         TP_ARGS(lock, ip)
 83 );
 84 
 85 DEFINE_EVENT(lock, lock_acquired,
 86 
 87         TP_PROTO(struct lockdep_map *lock, unsigned long ip),
 88 
 89         TP_ARGS(lock, ip)
 90 );
 91 
 92 #endif /* CONFIG_LOCK_STAT */
 93 #endif /* CONFIG_LOCKDEP */
 94 
 95 TRACE_EVENT(contention_begin,
 96 
 97         TP_PROTO(void *lock, unsigned int flags),
 98 
 99         TP_ARGS(lock, flags),
100 
101         TP_STRUCT__entry(
102                 __field(void *, lock_addr)
103                 __field(unsigned int, flags)
104         ),
105 
106         TP_fast_assign(
107                 __entry->lock_addr = lock;
108                 __entry->flags = flags;
109         ),
110 
111         TP_printk("%p (flags=%s)", __entry->lock_addr,
112                   __print_flags(__entry->flags, "|",
113                                 { LCB_F_SPIN,           "SPIN" },
114                                 { LCB_F_READ,           "READ" },
115                                 { LCB_F_WRITE,          "WRITE" },
116                                 { LCB_F_RT,             "RT" },
117                                 { LCB_F_PERCPU,         "PERCPU" },
118                                 { LCB_F_MUTEX,          "MUTEX" }
119                           ))
120 );
121 
122 TRACE_EVENT(contention_end,
123 
124         TP_PROTO(void *lock, int ret),
125 
126         TP_ARGS(lock, ret),
127 
128         TP_STRUCT__entry(
129                 __field(void *, lock_addr)
130                 __field(int, ret)
131         ),
132 
133         TP_fast_assign(
134                 __entry->lock_addr = lock;
135                 __entry->ret = ret;
136         ),
137 
138         TP_printk("%p (ret=%d)", __entry->lock_addr, __entry->ret)
139 );
140 
141 #endif /* _TRACE_LOCK_H */
142 
143 /* This part must be outside protection */
144 #include <trace/define_trace.h>
145 

~ [ 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