Commit | Line | Data |
---|---|---|
be075489 MK |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | #ifndef _LINUX_MM_EVENT_H | |
3 | #define _LINUX_MM_EVENT_H | |
4 | ||
5 | #include <linux/types.h> | |
6 | #include <linux/ktime.h> | |
7 | ||
8 | enum mm_event_type { | |
9 | MM_MIN_FAULT = 0, | |
10 | MM_MAJ_FAULT, | |
68890dfe | 11 | MM_READ_IO, |
be075489 MK |
12 | MM_COMPACTION, |
13 | MM_RECLAIM, | |
1fb0a842 | 14 | MM_SWP_FAULT, |
cee78bb6 | 15 | MM_KERN_ALLOC, |
be075489 MK |
16 | MM_TYPE_NUM, |
17 | }; | |
18 | ||
19 | struct mm_event_task { | |
20 | unsigned int count; | |
21 | unsigned int max_lat; | |
22 | u64 accm_lat; | |
23 | } __attribute__ ((packed)); | |
24 | ||
25 | struct task_struct; | |
26 | ||
27 | #ifdef CONFIG_MM_EVENT_STAT | |
28 | void mm_event_task_init(struct task_struct *tsk); | |
29 | void mm_event_start(ktime_t *time); | |
30 | void mm_event_end(enum mm_event_type event, ktime_t start); | |
cee78bb6 | 31 | void mm_event_count(enum mm_event_type event, int count); |
be075489 MK |
32 | #else |
33 | static inline void mm_event_task_init(struct task_struct *tsk) {} | |
34 | static inline void mm_event_start(ktime_t *time) {} | |
35 | static inline void mm_event_end(enum mm_event_type event, ktime_t start) {} | |
cee78bb6 | 36 | static inline void mm_event_count(enum mm_event_type event, int count) {} |
be075489 MK |
37 | #endif /* _LINUX_MM_EVENT_H */ |
38 | #endif |