blob: 1e7c0a0811dee9290a4555cf07b673aa909262e1 [file] [log] [blame]
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM mm
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_MM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_MM_H
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/oom.h>
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
struct cma;
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
TP_PROTO(gfp_t *flags),
TP_ARGS(flags), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_set_gfp_zone_flags,
TP_PROTO(gfp_t *flags),
TP_ARGS(flags), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_set_readahead_gfp_mask,
TP_PROTO(gfp_t *flags),
TP_ARGS(flags), 1);
DECLARE_HOOK(android_vh_cma_alloc_start,
TP_PROTO(s64 *ts),
TP_ARGS(ts));
DECLARE_HOOK(android_vh_cma_alloc_finish,
TP_PROTO(struct cma *cma, struct page *page, unsigned long count,
unsigned int align, gfp_t gfp_mask, s64 ts),
TP_ARGS(cma, page, count, align, gfp_mask, ts));
DECLARE_HOOK(android_vh_rmqueue,
TP_PROTO(struct zone *preferred_zone, struct zone *zone,
unsigned int order, gfp_t gfp_flags,
unsigned int alloc_flags, int migratetype),
TP_ARGS(preferred_zone, zone, order,
gfp_flags, alloc_flags, migratetype));
DECLARE_HOOK(android_vh_pagecache_get_page,
TP_PROTO(struct address_space *mapping, pgoff_t index,
int fgp_flags, gfp_t gfp_mask, struct page *page),
TP_ARGS(mapping, index, fgp_flags, gfp_mask, page));
DECLARE_HOOK(android_vh_filemap_fault_get_page,
TP_PROTO(struct vm_fault *vmf, struct page **page, bool *retry),
TP_ARGS(vmf, page, retry));
DECLARE_HOOK(android_vh_filemap_fault_cache_page,
TP_PROTO(struct vm_fault *vmf, struct page *page),
TP_ARGS(vmf, page));
DECLARE_HOOK(android_vh_meminfo_proc_show,
TP_PROTO(struct seq_file *m),
TP_ARGS(m));
DECLARE_HOOK(android_vh_exit_mm,
TP_PROTO(struct mm_struct *mm),
TP_ARGS(mm));
DECLARE_HOOK(android_vh_get_from_fragment_pool,
TP_PROTO(struct mm_struct *mm, struct vm_unmapped_area_info *info,
unsigned long *addr),
TP_ARGS(mm, info, addr));
DECLARE_HOOK(android_vh_exclude_reserved_zone,
TP_PROTO(struct mm_struct *mm, struct vm_unmapped_area_info *info),
TP_ARGS(mm, info));
DECLARE_HOOK(android_vh_include_reserved_zone,
TP_PROTO(struct mm_struct *mm, struct vm_unmapped_area_info *info,
unsigned long *addr),
TP_ARGS(mm, info, addr));
DECLARE_HOOK(android_vh_show_mem,
TP_PROTO(unsigned int filter, nodemask_t *nodemask),
TP_ARGS(filter, nodemask));
struct slabinfo;
struct dirty_throttle_control;
DECLARE_HOOK(android_vh_mm_dirty_limits,
TP_PROTO(struct dirty_throttle_control *const gdtc, bool strictlimit,
unsigned long dirty, unsigned long bg_thresh,
unsigned long nr_reclaimable, unsigned long pages_dirtied),
TP_ARGS(gdtc, strictlimit, dirty, bg_thresh,
nr_reclaimable, pages_dirtied));
DECLARE_HOOK(android_vh_oom_check_panic,
TP_PROTO(struct oom_control *oc, int *ret),
TP_ARGS(oc, ret));
DECLARE_HOOK(android_vh_save_vmalloc_stack,
TP_PROTO(unsigned long flags, struct vm_struct *vm),
TP_ARGS(flags, vm));
DECLARE_HOOK(android_vh_show_stack_hash,
TP_PROTO(struct seq_file *m, struct vm_struct *v),
TP_ARGS(m, v));
DECLARE_HOOK(android_vh_save_track_hash,
TP_PROTO(bool alloc, unsigned long p),
TP_ARGS(alloc, p));
struct mem_cgroup;
DECLARE_HOOK(android_vh_vmpressure,
TP_PROTO(struct mem_cgroup *memcg, bool *bypass),
TP_ARGS(memcg, bypass));
DECLARE_HOOK(android_vh_mem_cgroup_alloc,
TP_PROTO(struct mem_cgroup *memcg),
TP_ARGS(memcg));
DECLARE_HOOK(android_vh_mem_cgroup_free,
TP_PROTO(struct mem_cgroup *memcg),
TP_ARGS(memcg));
DECLARE_HOOK(android_vh_mem_cgroup_id_remove,
TP_PROTO(struct mem_cgroup *memcg),
TP_ARGS(memcg));
struct cgroup_subsys_state;
DECLARE_HOOK(android_vh_mem_cgroup_css_online,
TP_PROTO(struct cgroup_subsys_state *css, struct mem_cgroup *memcg),
TP_ARGS(css, memcg));
DECLARE_HOOK(android_vh_mem_cgroup_css_offline,
TP_PROTO(struct cgroup_subsys_state *css, struct mem_cgroup *memcg),
TP_ARGS(css, memcg));
DECLARE_HOOK(android_vh_kmalloc_slab,
TP_PROTO(unsigned int index, gfp_t flags, struct kmem_cache **s),
TP_ARGS(index, flags, s));
DECLARE_HOOK(android_vh_mmap_region,
TP_PROTO(struct vm_area_struct *vma, unsigned long addr),
TP_ARGS(vma, addr));
DECLARE_HOOK(android_vh_try_to_unmap_one,
TP_PROTO(struct vm_area_struct *vma, struct page *page, unsigned long addr, bool ret),
TP_ARGS(vma, page, addr, ret));
struct device;
DECLARE_HOOK(android_vh_subpage_dma_contig_alloc,
TP_PROTO(bool *allow_subpage_alloc, struct device *dev, size_t *size),
TP_ARGS(allow_subpage_alloc, dev, size));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */
#include <trace/define_trace.h>