mm: mm_event: add read io stat
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / include / linux / mm_event.h
CommitLineData
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
8enum 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
19struct mm_event_task {
20 unsigned int count;
21 unsigned int max_lat;
22 u64 accm_lat;
23} __attribute__ ((packed));
24
25struct task_struct;
26
27#ifdef CONFIG_MM_EVENT_STAT
28void mm_event_task_init(struct task_struct *tsk);
29void mm_event_start(ktime_t *time);
30void mm_event_end(enum mm_event_type event, ktime_t start);
cee78bb6 31void mm_event_count(enum mm_event_type event, int count);
be075489
MK
32#else
33static inline void mm_event_task_init(struct task_struct *tsk) {}
34static inline void mm_event_start(ktime_t *time) {}
35static inline void mm_event_end(enum mm_event_type event, ktime_t start) {}
cee78bb6 36static inline void mm_event_count(enum mm_event_type event, int count) {}
be075489
MK
37#endif /* _LINUX_MM_EVENT_H */
38#endif