Files
Minchan Kim 609a5898ce mm: mm_event: comment about enum event type ordering
Perfetto uses binary tracing so we shouldn't reordring/removing
the event type. Describe it more explicitly.

Bug: 80168800
Change-Id: I7fa415b0ddc803e9ad81590f692a46bb416b2dd9
Signed-off-by: Minchan Kim <minchan@google.com>
(cherry picked from commit ab281c5bf4753b1048d8a059342f89a0d24e9169)
2019-01-30 07:50:15 +09:00

56 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_MM_EVENT_H
#define _LINUX_MM_EVENT_H
/*
* These enums are exposed to userspace via the ftrace trace_pipe_raw endpoint
* and are an ABI. Userspace tools depend on them.
*/
enum mm_event_type {
MM_MIN_FAULT = 0,
MM_MAJ_FAULT = 1,
MM_READ_IO = 2,
MM_COMPACTION = 3,
MM_RECLAIM = 4,
MM_SWP_FAULT = 5,
MM_KERN_ALLOC = 6,
MM_TYPE_NUM = 7,
};
struct mm_event_task {
unsigned int count;
unsigned int max_lat;
u64 accm_lat;
} __attribute__ ((packed));
struct mm_event_vmstat {
unsigned long free;
unsigned long file;
unsigned long anon;
unsigned long ion;
unsigned long slab;
unsigned long ws_refault;
unsigned long ws_activate;
unsigned long mapped;
unsigned long pgin;
unsigned long pgout;
unsigned long swpin;
unsigned long swpout;
unsigned long reclaim_steal;
unsigned long reclaim_scan;
unsigned long compact_scan;
};
#ifdef CONFIG_MM_EVENT_STAT
void mm_event_task_init(struct task_struct *tsk);
void mm_event_start(ktime_t *time);
void mm_event_end(enum mm_event_type event, ktime_t start);
void mm_event_count(enum mm_event_type event, int count);
#else
static inline void mm_event_task_init(struct task_struct *tsk) {}
static inline void mm_event_start(ktime_t *time) {}
static inline void mm_event_end(enum mm_event_type event, ktime_t start) {}
static inline void mm_event_count(enum mm_event_type event, int count) {}
#endif /* _LINUX_MM_EVENT_H */
#endif