#include "bintree.h"
#define PAGE_SHIFT 12
-#define PAGE_SIZE (2 << PAGE_SHIFT)
+#define PAGE_SIZE (1 << PAGE_SHIFT)
struct maps;
+struct maps_list {
+ struct maps *map;
+ struct list_head list;
+};
+#define list_to_maps_list(list_head) \
+ container_of((list_head), struct maps_list, list)
+
struct pageframe {
struct bintree tree;
- struct maps *maps; /* List to mappings which point to this pfn */
+ struct maps_list *ml; /* List to mappings which point to this pfn */
unsigned long pfn; /* page frame number */
int swap_type;
int swap_offset;
int page_shift;
int page_swapped;
int page_present;
+ int refcount;
};
#define tree_to_pageframe(tree_struct) \
unsigned long end;
unsigned long size;
- /*
- * Name of the mapping, such as library name or something else
- */
+ long int pages_present;
+ long int pages_swapped;
+
+ /* Name of the mapping, such as library name or something else */
char name[128];
+ int pid; /* Process which address space the mapping belongs to */
+ int tid; /* thread id */
};
#define list_to_maps(list_head) \
container_of((list_head), struct maps, list)
struct process {
- struct pageframe *pageframes;
struct maps *maps;
+ struct list_head list;
+ int pid;
+ int tid;
+ char name[256];
+
+ long int pages_present;
+ long int pages_swapped;
+};
+
+#define PARSE_PID 0x1
+#define PARSE_MAP_NAME 0x2
+#define PARSE_PROCESS_NAME 0x4
+
+struct parse_opts {
+ int parse_mask;
+ int pid;
char *name;
+ int with_threads;
};
#endif