lib: Add debugfs file for tracking memory allocations
Add caller information to memory allocation calls and create /sys/kernel/debug/mempool/map to show the current set of allocations across all memory pools. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This commit is contained in:
committed by
Bryan Huntsman
parent
e96f66dd6b
commit
8c78b13c97
@@ -23,6 +23,7 @@ struct mem_pool {
|
||||
unsigned long paddr;
|
||||
unsigned long size;
|
||||
unsigned long free;
|
||||
unsigned int id;
|
||||
};
|
||||
|
||||
struct alloc {
|
||||
@@ -31,6 +32,7 @@ struct alloc {
|
||||
unsigned long paddr;
|
||||
struct mem_pool *mpool;
|
||||
unsigned long len;
|
||||
void *caller;
|
||||
};
|
||||
|
||||
struct mem_pool *initialize_memory_pool(unsigned long start,
|
||||
@@ -39,6 +41,9 @@ struct mem_pool *initialize_memory_pool(unsigned long start,
|
||||
void *allocate_contiguous_memory(unsigned long size,
|
||||
int mem_type, unsigned long align, int cached);
|
||||
|
||||
unsigned long _allocate_contiguous_memory_nomap(unsigned long size,
|
||||
int mem_type, unsigned long align, void *caller);
|
||||
|
||||
unsigned long allocate_contiguous_memory_nomap(unsigned long size,
|
||||
int mem_type, unsigned long align);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user