[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230614032038.11699-3-Wei-chin.Tsai@mediatek.com>
Date: Wed, 14 Jun 2023 11:20:34 +0800
From: Wei Chin Tsai <Wei-chin.Tsai@...iatek.com>
To: <linux-kernel@...r.kernel.org>,
Russell King <linux@...linux.org.uk>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
CC: <wsd_upstream@...iatek.com>, <wei-chin.tsai@...iatek.com>,
<mel.lee@...iatek.com>, <ivan.tseng@...iatek.com>,
Wei Chin Tsai <Wei-chin.Tsai@...iatek.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-fsdevel@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>
Subject: [PATCH v2 2/3] memory: export symbols for memory related functions
In this patch, we modified 3 files and export symbols
for 2 functions.
Export symbols for "smap_gather_stats" functions so that
user can have an idea for each user process memory's usage.
Export symbols for "arch_vma_name" functions so that
user can know the heap usage for each user process.
According to these two information, user can do the memory
statistics and anaysis.
Signed-off-by: Wei Chin Tsai <Wei-chin.Tsai@...iatek.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
Powered by blists - more mailing lists