Merge tag 'iommu-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
[linux/fpc-iii.git] / include / trace / events / lock.h
blobd7512129a324e5de49e1cafb8a7856a63324c989
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM lock
5 #if !defined(_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_LOCK_H
8 #include <linux/lockdep.h>
9 #include <linux/tracepoint.h>
11 #ifdef CONFIG_LOCKDEP
13 TRACE_EVENT(lock_acquire,
15 TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
16 int trylock, int read, int check,
17 struct lockdep_map *next_lock, unsigned long ip),
19 TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
21 TP_STRUCT__entry(
22 __field(unsigned int, flags)
23 __string(name, lock->name)
24 __field(void *, lockdep_addr)
27 TP_fast_assign(
28 __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0);
29 __assign_str(name, lock->name);
30 __entry->lockdep_addr = lock;
33 TP_printk("%p %s%s%s", __entry->lockdep_addr,
34 (__entry->flags & 1) ? "try " : "",
35 (__entry->flags & 2) ? "read " : "",
36 __get_str(name))
39 DECLARE_EVENT_CLASS(lock,
41 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
43 TP_ARGS(lock, ip),
45 TP_STRUCT__entry(
46 __string( name, lock->name )
47 __field( void *, lockdep_addr )
50 TP_fast_assign(
51 __assign_str(name, lock->name);
52 __entry->lockdep_addr = lock;
55 TP_printk("%p %s", __entry->lockdep_addr, __get_str(name))
58 DEFINE_EVENT(lock, lock_release,
60 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
62 TP_ARGS(lock, ip)
65 #ifdef CONFIG_LOCK_STAT
67 DEFINE_EVENT(lock, lock_contended,
69 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
71 TP_ARGS(lock, ip)
74 DEFINE_EVENT(lock, lock_acquired,
76 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
78 TP_ARGS(lock, ip)
81 #endif
82 #endif
84 #endif /* _TRACE_LOCK_H */
86 /* This part must be outside protection */
87 #include <trace/define_trace.h>