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

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 32 of file mmstat.cpp.

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 38 of file mmstat.cpp.

Referenced by slab_impl_free_page().

◆ mmstat_sysfs_stat()

static bool mmstat_sysfs_stat ( sysfs_file_t * f)
static

Definition at line 46 of file mmstat.cpp.

+ 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 66 of file mmstat.cpp.

+ 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 85 of file mmstat.cpp.

+ 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 100 of file mmstat.cpp.

+ 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.cpp.

+ 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 168 of file mmstat.cpp.

+ 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 22 of file mmstat.cpp.

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.hpp:10
@ MEM_USER
Definition mmstat.hpp:12
@ MEM_PAGETABLE
Definition mmstat.hpp:8
@ MEM_SLAB
Definition mmstat.hpp:9
@ MEM_KERNEL
Definition mmstat.hpp:11

Definition at line 24 of file mmstat.cpp.

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.cpp:100
static bool mmstat_sysfs_stat(sysfs_file_t *f)
Definition mmstat.cpp:46
static bool mmstat_sysfs_phyframe_stat_show(sysfs_file_t *f)
Definition mmstat.cpp:66
static bool mmstat_sysfs_vmaps_show(sysfs_file_t *f)
Definition mmstat.cpp:139
static size_t mmstat_sysfs_phyframe_stat_store(sysfs_file_t *f, const char *buf, size_t count, off_t offset)
Definition mmstat.cpp:85
static size_t mmstat_sysfs_store_pid(sysfs_file_t *f, const char *buf, size_t count, off_t offset)
Definition mmstat.cpp:168
#define SYSFS_RW_ITEM(_name, _show_fn, _store_fn)
Definition sysfs.hpp:43
#define SYSFS_RO_ITEM(_name, _show_fn)
Definition sysfs.hpp:42

Definition at line 184 of file mmstat.cpp.

Referenced by SYSFS_AUTOREGISTER().