mm: introduce per-process mm event tracking feature
[GitHub/moto-9609/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_TYPE_NUM,
14 };
15
16 struct mm_event_task {
17 unsigned int count;
18 unsigned int max_lat;
19 u64 accm_lat;
20 } __attribute__ ((packed));
21
22 struct task_struct;
23
24 #ifdef CONFIG_MM_EVENT_STAT
25 void mm_event_task_init(struct task_struct *tsk);
26 void mm_event_start(ktime_t *time);
27 void mm_event_end(enum mm_event_type event, ktime_t start);
28 #else
29 static inline void mm_event_task_init(struct task_struct *tsk) {}
30 static inline void mm_event_start(ktime_t *time) {}
31 static inline void mm_event_end(enum mm_event_type event, ktime_t start) {}
32 #endif /* _LINUX_MM_EVENT_H */
33 #endif