MOS Source Code
Loading...
Searching...
No Matches
mmstat.c File Reference
+ Include dependency graph for mmstat.c:

Go to the source code of this file.

Classes

struct  vmap_global_mstat_t
 

Functions

void mmstat_inc (mmstat_type_t type, size_t size)
 Increment the memory usage statistics.
 
void mmstat_dec (mmstat_type_t type, size_t size)
 Decrement the memory usage statistics.
 
static bool mmstat_sysfs_stat (sysfs_file_t *f)
 
static bool mmstat_sysfs_phyframe_stat_show (sysfs_file_t *f)
 
static size_t mmstat_sysfs_phyframe_stat_store (sysfs_file_t *f, const char *buf, size_t count, off_t offset)
 
static bool mmstat_sysfs_pagetable_show (sysfs_file_t *f)
 
static bool mmstat_sysfs_vmaps_show (sysfs_file_t *f)
 
static size_t mmstat_sysfs_store_pid (sysfs_file_t *f, const char *buf, size_t count, off_t offset)
 
 SYSFS_AUTOREGISTER (mmstat, mmstat_sysfs_items)
 

Variables

static vmap_global_mstat_t stat [_MEM_MAX_TYPES] = { 0 }
 
const char * mem_type_names [_MEM_MAX_TYPES]
 
static sysfs_item_t mmstat_sysfs_items []
 

Function Documentation

◆ mmstat_inc()

void mmstat_inc ( mmstat_type_t type,
size_t size )

Increment the memory usage statistics.

Parameters
typeThe type of memory.
sizeThe size of memory.

Definition at line 33 of file mmstat.c.

Referenced by slab_impl_new_page().

◆ mmstat_dec()

void mmstat_dec ( mmstat_type_t type,
size_t size )

Decrement the memory usage statistics.

Parameters
typeThe type of memory.
sizeThe size of memory.

Definition at line 39 of file mmstat.c.

Referenced by slab_impl_free_page().

◆ mmstat_sysfs_stat()

static bool mmstat_sysfs_stat ( sysfs_file_t * f)
static

Definition at line 47 of file mmstat.c.

+ Here is the call graph for this function:

◆ mmstat_sysfs_phyframe_stat_show()

static bool mmstat_sysfs_phyframe_stat_show ( sysfs_file_t * f)
static

Definition at line 67 of file mmstat.c.

+ Here is the call graph for this function:

◆ mmstat_sysfs_phyframe_stat_store()

static size_t mmstat_sysfs_phyframe_stat_store ( sysfs_file_t * f,
const char * buf,
size_t count,
off_t offset )
static

Definition at line 86 of file mmstat.c.

+ Here is the call graph for this function:

◆ mmstat_sysfs_pagetable_show()

static bool mmstat_sysfs_pagetable_show ( sysfs_file_t * f)
static

Definition at line 101 of file mmstat.c.

+ Here is the call graph for this function:

◆ mmstat_sysfs_vmaps_show()

static bool mmstat_sysfs_vmaps_show ( sysfs_file_t * f)
static

Definition at line 139 of file mmstat.c.

+ Here is the call graph for this function:

◆ mmstat_sysfs_store_pid()

static size_t mmstat_sysfs_store_pid ( sysfs_file_t * f,
const char * buf,
size_t count,
off_t offset )
static

Definition at line 166 of file mmstat.c.

+ Here is the call graph for this function:

◆ SYSFS_AUTOREGISTER()

SYSFS_AUTOREGISTER ( mmstat ,
mmstat_sysfs_items  )

Variable Documentation

◆ stat

vmap_global_mstat_t stat[_MEM_MAX_TYPES] = { 0 }
static

Definition at line 23 of file mmstat.c.

Referenced by i_from_pbfull(), mmstat_dec(), mmstat_inc(), and mmstat_sysfs_stat().

◆ mem_type_names

const char* mem_type_names[_MEM_MAX_TYPES]
Initial value:
= {
[MEM_PAGETABLE] = "PageTable",
[MEM_SLAB] = "Slab",
[MEM_PAGECACHE] = "PageCache",
[MEM_KERNEL] = "Kernel",
[MEM_USER] = "User",
}
@ MEM_PAGECACHE
Definition mmstat.h:10
@ MEM_USER
Definition mmstat.h:12
@ MEM_PAGETABLE
Definition mmstat.h:8
@ MEM_SLAB
Definition mmstat.h:9
@ MEM_KERNEL
Definition mmstat.h:11

Definition at line 25 of file mmstat.c.

Referenced by mmstat_sysfs_stat().

◆ mmstat_sysfs_items

sysfs_item_t mmstat_sysfs_items[]
static
Initial value:
= {
}
static bool mmstat_sysfs_pagetable_show(sysfs_file_t *f)
Definition mmstat.c:101
static bool mmstat_sysfs_stat(sysfs_file_t *f)
Definition mmstat.c:47
static bool mmstat_sysfs_phyframe_stat_show(sysfs_file_t *f)
Definition mmstat.c:67
static bool mmstat_sysfs_vmaps_show(sysfs_file_t *f)
Definition mmstat.c:139
static size_t mmstat_sysfs_phyframe_stat_store(sysfs_file_t *f, const char *buf, size_t count, off_t offset)
Definition mmstat.c:86
static size_t mmstat_sysfs_store_pid(sysfs_file_t *f, const char *buf, size_t count, off_t offset)
Definition mmstat.c:166
#define SYSFS_RW_ITEM(_name, _show_fn, _store_fn)
Definition sysfs.h:49
#define SYSFS_RO_ITEM(_name, _show_fn)
Definition sysfs.h:48

Definition at line 182 of file mmstat.c.