ANDROID: Allow vendor modules perform more operations on memleak detect

Export arch_vma_name, anon_vma_name, vm_normal_page, walk_page_range, pmd_clear_bad,
__pmd_trans_huge_lock,__pte_offset_map_lock functions. Allow vendor modules perform
more operations on memleak detect and debug.It can detect multiple types of memleak,
such as Native,ION,Slub and Vmalloc. Shows detail size of memleak, and shows the stack.

Bug: 365506692
Bug: 342305999
Change-Id: I118efa570e660d0696bf081d00b670760d01bec1
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
(cherry picked from commit 21e76b82444db3635eacb360f0d0206a069de4a8)
This commit is contained in:
Dezhi Huang
2024-05-23 15:10:35 +08:00
committed by Treehugger Robot
parent d3daafbfd2
commit ce0653fd2c
6 changed files with 6 additions and 0 deletions

View File

@@ -4709,6 +4709,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)
{

View File

@@ -2069,6 +2069,7 @@ spinlock_t *__pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma)
spin_unlock(ptl);
return NULL;
}
EXPORT_SYMBOL_GPL(__pmd_trans_huge_lock);
/*
* Returns page table lock pointer if a given pud maps a thp, NULL otherwise.

View File

@@ -103,6 +103,7 @@ struct anon_vma_name *anon_vma_name(struct vm_area_struct *vma)
return vma->anon_name;
}
EXPORT_SYMBOL_GPL(anon_vma_name);
/* mmap_lock should be write-locked */
static int replace_anon_vma_name(struct vm_area_struct *vma,

View File

@@ -688,6 +688,7 @@ check_pfn:
out:
return pfn_to_page(pfn);
}
EXPORT_SYMBOL_GPL(vm_normal_page);
struct folio *vm_normal_folio(struct vm_area_struct *vma, unsigned long addr,
pte_t pte)

View File

@@ -509,6 +509,7 @@ int walk_page_range(struct mm_struct *mm, unsigned long start,
} while (start = next, start < end);
return err;
}
EXPORT_SYMBOL_GPL(walk_page_range);
/**
* walk_page_range_novma - walk a range of pagetables not backed by a vma

View File

@@ -51,6 +51,7 @@ void pmd_clear_bad(pmd_t *pmd)
pmd_ERROR(*pmd);
pmd_clear(pmd);
}
EXPORT_SYMBOL_GPL(pmd_clear_bad);
#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
/*