Skip to content

Commit fcb1607

Browse files
committed
SUNLIGHT: Stable 12/27/2023 - ANDROID
Description: - Stable 12/27/2023 - ANDROID Change-Id: Ibbf721de834478c26e521c261c09c8c29618bca1 Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
2 parents 53ecca8 + d8faa0a commit fcb1607

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

drivers/android/vendor_hooks.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <trace/hooks/remoteproc.h>
3535
#include <trace/hooks/timer.h>
3636
#include <trace/hooks/fpsimd.h>
37+
#include <trace/hooks/mm.h>
3738

3839
/*
3940
* Export tracepoints that act as a bare tracehook (ie: have no trace event
@@ -88,3 +89,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery);
8889
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery_set);
8990
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_timer_calc_index);
9091
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save);
92+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_slab_folio_alloced);
93+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kmalloc_large_alloced);

include/trace/hooks/mm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ DECLARE_RESTRICTED_HOOK(android_rvh_set_readahead_gfp_mask,
2121
TP_ARGS(flags), 1);
2222
2323
*/
24+
DECLARE_HOOK(android_vh_slab_folio_alloced,
25+
TP_PROTO(unsigned int order, gfp_t flags),
26+
TP_ARGS(order, flags));
27+
DECLARE_HOOK(android_vh_kmalloc_large_alloced,
28+
TP_PROTO(struct page *page, unsigned int order, gfp_t flags),
29+
TP_ARGS(page, order, flags));
2430
#endif /* _TRACE_HOOK_MM_H */
2531

2632
/* This part must be outside protection */

mm/slab_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
#define CREATE_TRACE_POINTS
3535
#include <trace/events/kmem.h>
36+
#undef CREATE_TRACE_POINTS
37+
#include <trace/hooks/mm.h>
3638

3739
enum slab_state slab_state;
3840
LIST_HEAD(slab_caches);
@@ -1171,6 +1173,8 @@ static void *__kmalloc_large_node(size_t size, gfp_t flags, int node)
11711173
PAGE_SIZE << order);
11721174
}
11731175

1176+
trace_android_vh_kmalloc_large_alloced(page, order, flags);
1177+
11741178
ptr = kasan_kmalloc_large(ptr, size, flags);
11751179
/* As ptr might get tagged, call kmemleak hook after KASAN. */
11761180
kmemleak_alloc(ptr, size, 1, flags);

mm/slub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
#include <linux/debugfs.h>
4646
#include <trace/events/kmem.h>
47+
#include <trace/hooks/mm.h>
4748

4849
#include "internal.h"
4950

@@ -1881,6 +1882,8 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node,
18811882
if (folio_is_pfmemalloc(folio))
18821883
slab_set_pfmemalloc(slab);
18831884

1885+
trace_android_vh_slab_folio_alloced(order, flags);
1886+
18841887
return slab;
18851888
}
18861889

0 commit comments

Comments
 (0)