procfs: Remove mallinfo from struct procfs_meminfo_entry_s

let's call mm_mallinfo directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-17 11:20:20 +08:00 committed by Alan Carvalho de Assis
parent 660b80b329
commit c2a1d0f5ae
4 changed files with 6 additions and 9 deletions

View file

@ -148,8 +148,7 @@ FAR struct mm_heap_s *mm_initialize(FAR const char *name,
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO)
heap->mm_procfs.name = name;
heap->mm_procfs.mallinfo = (FAR void *)mm_mallinfo;
heap->mm_procfs.user_data = heap;
heap->mm_procfs.heap = heap;
procfs_register_meminfo(&heap->mm_procfs);
#endif

View file

@ -311,7 +311,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer,
/* Show heap information */
entry->mallinfo(entry->user_data, &minfo);
mm_mallinfo(entry->heap, &minfo);
linesize = procfs_snprintf(procfile->line, MEMINFO_LINELEN,
"%12s:%11lu%11lu%11lu%11lu%7lu%7lu\n",
entry->name,
@ -476,7 +476,7 @@ static ssize_t memdump_write(FAR struct file *filep, FAR const char *buffer,
for (entry = g_procfs_meminfo; entry != NULL; entry = entry->next)
{
mm_memdump(entry->user_data, pid);
mm_memdump(entry->heap, pid);
}
return buflen;

View file

@ -127,12 +127,11 @@ struct procfs_dir_priv_s
/* An entry for procfs_register_meminfo */
struct mm_heap_s;
struct procfs_meminfo_entry_s
{
FAR const char *name;
CODE void (*mallinfo)(FAR void *user_data, FAR struct mallinfo *);
FAR void *user_data;
FAR struct mm_heap_s *heap;
struct procfs_meminfo_entry_s *next;
};

View file

@ -212,8 +212,7 @@ FAR struct mm_heap_s *mm_initialize(FAR const char *name,
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO)
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
heap->mm_procfs.name = name;
heap->mm_procfs.mallinfo = (FAR void *)mm_mallinfo;
heap->mm_procfs.user_data = heap;
heap->mm_procfs.heap = heap;
procfs_register_meminfo(&heap->mm_procfs);
#endif
#endif