1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM mmap_lock
5 #if !defined(_TRACE_MMAP_LOCK_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_MMAP_LOCK_H
8 #include <linux/tracepoint.h>
9 #include <linux/types.h>
13 DECLARE_EVENT_CLASS(mmap_lock
,
15 TP_PROTO(struct mm_struct
*mm
, const char *memcg_path
, bool write
),
17 TP_ARGS(mm
, memcg_path
, write
),
20 __field(struct mm_struct
*, mm
)
21 __string(memcg_path
, memcg_path
)
27 __assign_str(memcg_path
);
28 __entry
->write
= write
;
32 "mm=%p memcg_path=%s write=%s",
34 __get_str(memcg_path
),
35 __entry
->write
? "true" : "false"
39 #define DEFINE_MMAP_LOCK_EVENT(name) \
40 DEFINE_EVENT(mmap_lock, name, \
41 TP_PROTO(struct mm_struct *mm, const char *memcg_path, \
43 TP_ARGS(mm, memcg_path, write))
45 DEFINE_MMAP_LOCK_EVENT(mmap_lock_start_locking
);
46 DEFINE_MMAP_LOCK_EVENT(mmap_lock_released
);
48 TRACE_EVENT(mmap_lock_acquire_returned
,
50 TP_PROTO(struct mm_struct
*mm
, const char *memcg_path
, bool write
,
53 TP_ARGS(mm
, memcg_path
, write
, success
),
56 __field(struct mm_struct
*, mm
)
57 __string(memcg_path
, memcg_path
)
59 __field(bool, success
)
64 __assign_str(memcg_path
);
65 __entry
->write
= write
;
66 __entry
->success
= success
;
70 "mm=%p memcg_path=%s write=%s success=%s",
72 __get_str(memcg_path
),
73 __entry
->write
? "true" : "false",
74 __entry
->success
? "true" : "false"
78 #endif /* _TRACE_MMAP_LOCK_H */
80 /* This part must be outside protection */
81 #include <trace/define_trace.h>