diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index da1b7379dce2..a7d07619a094 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -255,6 +255,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_mutex_list_add); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_unlock_slowpath); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_adjust_alloc_flags); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_adjust_kvmalloc_flags); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_looper_state_registered); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_thread_read); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_free_proc); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index ab479064007c..9221cf9e8ca3 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -168,6 +168,9 @@ struct oom_control; DECLARE_HOOK(android_vh_mm_alloc_pages_may_oom_exit, TP_PROTO(struct oom_control *oc, unsigned long did_some_progress), TP_ARGS(oc, did_some_progress)); +DECLARE_HOOK(android_vh_adjust_kvmalloc_flags, + TP_PROTO(unsigned int order, gfp_t *alloc_flags), + TP_ARGS(order, alloc_flags)); #endif /* _TRACE_HOOK_MM_H */ /* This part must be outside protection */ diff --git a/mm/util.c b/mm/util.c index 4afa7ddffb7e..29c9470aeeef 100644 --- a/mm/util.c +++ b/mm/util.c @@ -25,7 +25,7 @@ #include #include - +#include #include "internal.h" #include "swap.h" @@ -582,6 +582,7 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node) /* nofail semantic is implemented by the vmalloc fallback */ kmalloc_flags &= ~__GFP_NOFAIL; } + trace_android_vh_adjust_kvmalloc_flags(get_order(size), &kmalloc_flags); ret = kmalloc_node(size, kmalloc_flags, node);