2778fa09c65088bec2350282db74550dffc3037f
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / include / linux / mm_event.h
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,
11 MM_COMPACTION,
12 MM_RECLAIM,
13 MM_SWP_FAULT,
14 MM_TYPE_NUM,
15 };
16
17 struct mm_event_task {
18 unsigned int count;
19 unsigned int max_lat;
20 u64 accm_lat;
21 } __attribute__ ((packed));
22
23 struct task_struct;
24
25 #ifdef CONFIG_MM_EVENT_STAT
26 void mm_event_task_init(struct task_struct *tsk);
27 void mm_event_start(ktime_t *time);
28 void mm_event_end(enum mm_event_type event, ktime_t start);
29 #else
30 static inline void mm_event_task_init(struct task_struct *tsk) {}
31 static inline void mm_event_start(ktime_t *time) {}
32 static inline void mm_event_end(enum mm_event_type event, ktime_t start) {}
33 #endif /* _LINUX_MM_EVENT_H */
34 #endif