]> git.itanic.dy.fi Git - scan-pagemap/blobdiff - pagemap.h
analyzer: print_pid_stats: Add column for total mem usage
[scan-pagemap] / pagemap.h
index c2a78d9d8e5fd9d37de40d708b591fb6dda0c3d1..cd28c4100e1f05f3dfde9748444cb5e68631aaeb 100644 (file)
--- a/pagemap.h
+++ b/pagemap.h
@@ -6,19 +6,27 @@
 #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)                         \
@@ -32,19 +40,38 @@ struct maps {
        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