linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] memory: export symbols for process memory related functions
@ 2023-06-09 11:09 jim.tsai
  2023-06-09 11:20 ` Russell King (Oracle)
  0 siblings, 1 reply; 4+ messages in thread
From: jim.tsai @ 2023-06-09 11:09 UTC (permalink / raw)
  To: linux-kernel, Russell King, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: wsd_upstream, mel.lee, ivan.tseng, jim.tsai, linux-arm-kernel,
	linux-fsdevel, linux-mediatek

Export symbols for arch_vma_name and smap_gather_stats
functions so that we can detect the memory leak issues.
Besides, we can know which memory type is leaked, too.

Signed-off-by: jim.tsai <Wei-chin.Tsai@mediatek.com>
---
 arch/arm/kernel/process.c | 1 +
 fs/proc/task_mmu.c        | 5 +++--
 kernel/signal.c           | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 0e8ff85890ad..df91412a1069 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -343,6 +343,7 @@ const char *arch_vma_name(struct vm_area_struct *vma)
 {
 	return is_gate_vma(vma) ? "[vectors]" : NULL;
 }
+EXPORT_SYMBOL_GPL(arch_vma_name);
 
 /* If possible, provide a placement hint at a random offset from the
  * stack for the sigpage and vdso pages.
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 6259dd432eeb..814d7829a20b 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -773,8 +773,8 @@ static const struct mm_walk_ops smaps_shmem_walk_ops = {
  *
  * Use vm_start of @vma as the beginning address if @start is 0.
  */
-static void smap_gather_stats(struct vm_area_struct *vma,
-		struct mem_size_stats *mss, unsigned long start)
+void smap_gather_stats(struct vm_area_struct *vma,
+		       struct mem_size_stats *mss, unsigned long start)
 {
 	const struct mm_walk_ops *ops = &smaps_walk_ops;
 
@@ -809,6 +809,7 @@ static void smap_gather_stats(struct vm_area_struct *vma,
 	else
 		walk_page_range(vma->vm_mm, start, vma->vm_end, ops, mss);
 }
+EXPORT_SYMBOL_GPL(smap_gather_stats);
 
 #define SEQ_PUT_DEC(str, val) \
 		seq_put_decimal_ull_width(m, str, (val) >> 10, 8)
diff --git a/kernel/signal.c b/kernel/signal.c
index b5370fe5c198..a1abe77fcdc3 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -4700,6 +4700,7 @@ __weak const char *arch_vma_name(struct vm_area_struct *vma)
 {
 	return NULL;
 }
+EXPORT_SYMBOL_GPL(arch_vma_name);
 
 static inline void siginfo_buildtime_checks(void)
 {
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-16  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 11:09 [PATCH v1 1/1] memory: export symbols for process memory related functions jim.tsai
2023-06-09 11:20 ` Russell King (Oracle)
     [not found]   ` <5cc76704214673cf03376d9f10f61325b9ed323f.camel@mediatek.com>
2023-06-10  0:21     ` Matthew Wilcox
     [not found]       ` <c23e1fb3628bf0a32bd0eb491c9370b961e19fd1.camel@mediatek.com>
2023-06-16  9:24         ` Matthias Brugger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).