72 pr_warn(
"mmstat: invalid pfn %llu", pfn);
78 sysfs_printf(f,
"type: %s\n", frame->
state == PHYFRAME_FREE ?
"free" : frame->
state == PHYFRAME_ALLOCATED ?
"allocated" :
"reserved");
80 if (frame->
state == PHYFRAME_ALLOCATED)
93 pr_warn(
"mmstat: invalid pfn %llu", pfn);
106 pr_warn(
"mmstat: invalid pid %d", pid);
113 pr_warn(
"mmstat: invalid pid %d", pid);
144 pr_warn(
"mmstat: invalid pid %d", pid);
151 pr_warn(
"mmstat: invalid pid %d", pid);
173 pr_warn(
"mmstat: invalid pid %d", pid);
MOSAPI void format_size(char *buf, size_t buf_size, u64 size)
MOSAPI s64 strntoll(const char *str, char **endptr, int base, size_t n)
#define list_foreach(t, v, h)
Iterate over a list.
#define pfn_phyframe(pfn)
size_t pmm_reserved_frames
size_t pmm_allocated_frames
void pagetable_iter_init(pagetable_iter_t *it, pgd_t pgd, ptr_t vaddr, ptr_t end)
Initialize a pagetable iterator.
pagetable_iter_range_t * pagetable_iter_next(pagetable_iter_t *it)
Get the next page table range.
static bool mmstat_sysfs_pagetable_show(sysfs_file_t *f)
void mmstat_dec(mmstat_type_t type, size_t size)
Decrement the memory usage statistics.
static bool mmstat_sysfs_stat(sysfs_file_t *f)
void mmstat_inc(mmstat_type_t type, size_t size)
Increment the memory usage statistics.
static bool mmstat_sysfs_phyframe_stat_show(sysfs_file_t *f)
static sysfs_item_t mmstat_sysfs_items[]
static bool mmstat_sysfs_vmaps_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 size_t mmstat_sysfs_store_pid(sysfs_file_t *f, const char *buf, size_t count, off_t offset)
const char * mem_type_names[_MEM_MAX_TYPES]
static vmap_global_mstat_t stat[_MEM_MAX_TYPES]
process_t * process_get(pid_t pid)
#define spinlock_acquire(lock)
#define spinlock_release(lock)
spinlock_t mm_lock
protects [pgd] and the [mmaps] list (the list itself, not the vmap_t objects)
atomic_t allocated_refcount
enum phyframe_t::phyframe_state state
void sysfs_file_set_data(sysfs_file_t *file, void *data)
ssize_t sysfs_printf(sysfs_file_t *file, const char *fmt,...)
void * sysfs_file_get_data(sysfs_file_t *file)
#define SYSFS_RW_ITEM(_name, _show_fn, _store_fn)
#define SYSFS_RO_ITEM(_name, _show_fn)
#define SYSFS_AUTOREGISTER(sysfs_name, sysfs_items)