diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 1f30d49f345b..b35324b886c0 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -416,6 +416,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_referenced_one_end); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_pswpin); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_pswpout); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_count_swpout_vm_event); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swap_slot_cache_active); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_drain_slots_cache_cpu); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_swap_slot_cache); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_swap_slot); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index c6f0f726392c..ae93f1916273 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -177,6 +177,9 @@ DECLARE_HOOK(android_vh_count_pswpout, DECLARE_HOOK(android_vh_count_swpout_vm_event, TP_PROTO(struct swap_info_struct *sis, struct page *page, bool *skip), TP_ARGS(sis, page, skip)); +DECLARE_HOOK(android_vh_swap_slot_cache_active, + TP_PROTO(bool swap_slot_cache_active), + TP_ARGS(swap_slot_cache_active)); DECLARE_HOOK(android_vh_drain_slots_cache_cpu, TP_PROTO(struct swap_slots_cache *cache, unsigned int type, bool free_slots, bool *skip), diff --git a/mm/swap_slots.c b/mm/swap_slots.c index 365493578163..a200aafc0a36 100644 --- a/mm/swap_slots.c +++ b/mm/swap_slots.c @@ -55,6 +55,7 @@ static void deactivate_swap_slots_cache(void) { mutex_lock(&swap_slots_cache_mutex); swap_slot_cache_active = false; + trace_android_vh_swap_slot_cache_active(false); __drain_swap_slots_cache(SLOTS_CACHE|SLOTS_CACHE_RET); mutex_unlock(&swap_slots_cache_mutex); } @@ -63,6 +64,7 @@ static void reactivate_swap_slots_cache(void) { mutex_lock(&swap_slots_cache_mutex); swap_slot_cache_active = true; + trace_android_vh_swap_slot_cache_active(true); mutex_unlock(&swap_slots_cache_mutex); }