1: #include<linux/init.h>
2: #include<linux/module.h>
3: #include<linux/list.h>
4: #include<linux/sched.h>
5: #include<linux/proc_fs.h>
6: #include<linux/mm_types.h>
7: #include<linux/fs.h>
8: #include<linux/path.h>
9: #include<linux/dcache.h>
10: #include<linux/mm.h>
11: #include<linux/mmzone.h>
12: #include<linux/vmalloc.h>
13:
);
15:
int analyzeUMANode()
17: {
int i,j;
long node_present_pages;
long node_spanned_pages;
struct pglist_data* node_0;
22:
struct zone* pzone;
long start_pfn;
long present_pages;
long spanned_pages;
struct free_area* pfreearea;
28:
);
30:
31: node_0 = NODE_DATA(0);
, node_0);
if (node_0 == NULL)
return 0;
35:
36: node_present_pages = node_0->node_present_pages;
37: node_spanned_pages = node_0->node_spanned_pages;
, node_present_pages);
, node_spanned_pages);
40:
for (i = 0; i < MAX_NR_ZONES; ++i)
42: {
43: pzone = &node_0->node_zones[i];
if (pzone == NULL)
continue;
, i, pzone->name);
47: start_pfn = pzone->zone_start_pfn;
, start_pfn);
49: present_pages = pzone->present_pages;
, present_pages);
51: spanned_pages = pzone->spanned_pages;
, spanned_pages);
, start_pfn * PAGE_SIZE / 1024 / 1024, (start_pfn + spanned_pages) * PAGE_SIZE / 1024 / 1024);
54: pfreearea = &pzone->free_area;
if (pfreearea == NULL)
continue;
for (j = 0; j < MAX_ORDER; ++j)
58: {
, (pfreearea + j)->nr_free);
60: }
);
62: }
return 0;
64: }
65:
int pslist_init()
67: {
68: analyzeUMANode();
69:
70: }
71:
void pslist_exit()
73: {
);
75: }
76:
77: module_init(pslist_init);
78: module_exit(pslist_exit);