Home | History | Annotate | Download | only in libpagemap

Lines Matching refs:map

22 int pm_map_pagemap(pm_map_t *map, uint64_t **pagemap_out, size_t *len) {
23 if (!map)
26 return pm_process_pagemap_range(map->proc, map->start, map->end,
30 int pm_map_usage_flags(pm_map_t *map, pm_memusage_t *usage_out,
38 if (!map || !usage_out)
41 error = pm_map_pagemap(map, &pagemap, &len);
47 usage.vss += map->proc->ker->pagesize;
55 error = pm_kernel_flags(map->proc->ker, PM_PAGEMAP_PFN(pagemap[i]),
63 error = pm_kernel_count(map->proc->ker, PM_PAGEMAP_PFN(pagemap[i]),
67 usage.rss += (count >= 1) ? map->proc->ker->pagesize : (0);
68 usage.pss += (count >= 1) ? (map->proc->ker->pagesize / count) : (0);
69 usage.uss += (count == 1) ? (map->proc->ker->pagesize) : (0);
71 usage.swap += map->proc->ker->pagesize;
85 int pm_map_usage(pm_map_t *map, pm_memusage_t *usage_out) {
86 return pm_map_usage_flags(map, usage_out, 0, 0);
89 int pm_map_workingset(pm_map_t *map, pm_memusage_t *ws_out) {
96 if (!map || !ws_out)
99 error = pm_map_pagemap(map, &pagemap, &len);
105 error = pm_kernel_flags(map->proc->ker, PM_PAGEMAP_PFN(pagemap[i]),
112 error = pm_kernel_count(map->proc->ker, PM_PAGEMAP_PFN(pagemap[i]),
116 ws.vss += map->proc->ker->pagesize;
118 ws.rss += (count >= 1) ? (map->proc->ker->pagesize) : (0);
119 ws.pss += (count >= 1) ? (map->proc->ker->pagesize / count) : (0);
120 ws.uss += (count == 1) ? (map->proc->ker->pagesize) : (0);
133 int pm_map_destroy(pm_map_t *map) {
134 if (!map)
137 free(map->name);
138 free(map);