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 extern int trace_mmap_lock_reg(void);
14 extern void trace_mmap_lock_unreg(void);
16 TRACE_EVENT_FN(mmap_lock_start_locking,
18 TP_PROTO(struct mm_struct *mm, const char *memcg_path, bool write),
20 TP_ARGS(mm, memcg_path, write),
23 __field(struct mm_struct *, mm)
24 __string(memcg_path, memcg_path)
30 __assign_str(memcg_path, memcg_path);
31 __entry->write = write;
35 "mm=%p memcg_path=%s write=%s\n",
37 __get_str(memcg_path),
38 __entry->write ? "true" : "false"
41 trace_mmap_lock_reg, trace_mmap_lock_unreg
44 TRACE_EVENT_FN(mmap_lock_acquire_returned,
46 TP_PROTO(struct mm_struct *mm, const char *memcg_path, bool write,
49 TP_ARGS(mm, memcg_path, write, success),
52 __field(struct mm_struct *, mm)
53 __string(memcg_path, memcg_path)
55 __field(bool, success)
60 __assign_str(memcg_path, memcg_path);
61 __entry->write = write;
62 __entry->success = success;
66 "mm=%p memcg_path=%s write=%s success=%s\n",
68 __get_str(memcg_path),
69 __entry->write ? "true" : "false",
70 __entry->success ? "true" : "false"
73 trace_mmap_lock_reg, trace_mmap_lock_unreg
76 TRACE_EVENT_FN(mmap_lock_released,
78 TP_PROTO(struct mm_struct *mm, const char *memcg_path, bool write),
80 TP_ARGS(mm, memcg_path, write),
83 __field(struct mm_struct *, mm)
84 __string(memcg_path, memcg_path)
90 __assign_str(memcg_path, memcg_path);
91 __entry->write = write;
95 "mm=%p memcg_path=%s write=%s\n",
97 __get_str(memcg_path),
98 __entry->write ? "true" : "false"
101 trace_mmap_lock_reg, trace_mmap_lock_unreg
104 #endif /* _TRACE_MMAP_LOCK_H */
106 /* This part must be outside protection */
107 #include <trace/define_trace.h>