title: How to dump page table?
body: <p>I am new to linux, C and stack overflow. I was trying to view page tables of all processes running. For this I am using <a href="https://github.com/mmind/rkchrome-kernel/blob/master/arch/s390/mm/dump_pagetables.c" rel="nofollow">dump_pagetable.c</a>.</p>
  
  <p>I tried to run first by normal compiling <code>gcc dump_pagetables.c -o dump_pagetables.out</code>. But it gave me error:</p>
  
  <pre><code>dump_pagetable.c:15:27: fatal error: linux/debugfs.h: No such file or directory #include linux/debugfs.h&gt;&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;Then I tried to use a make command &lt;code&gt;make -C /lib/modules/$(uname -r)/build M=$PWD modules&lt;/code&gt;. So it gave me this error&lt;code&gt;CC [M]  /home/varma/Desktop/TLB/dump_pagetable.o
  /home/varma/Desktop/TLB/dump_pagetable.c:420:1: warning: data definition has no type or storage class
   __initcall(pt_dump_init);
   ^
  /home/varma/Desktop/TLB/dump_pagetable.c:420:1: error: type defaults to ‘int’ in declaration of ‘__initcall’ [-Werror=implicit-int]
  /home/varma/Desktop/TLB/dump_pagetable.c:420:1: warning: parameter names (without types) in function declaration
  /home/varma/Desktop/TLB/dump_pagetable.c:398:12: warning: ‘pt_dump_init’ defined but not used [-Wunused-function]
   static int pt_dump_init(void)
              ^
  cc1: some warnings being treated as errors
  scripts/Makefile.build:263: recipe for target '/home/varma/Desktop/TLB/dump_pagetable.o' failed
  make[1]: *** [/home/varma/Desktop/TLB/dump_pagetable.o] Error 1
  Makefile:1394: recipe for target '_module_/home/varma/Desktop/TLB' failed
  make: *** [_module_/home/varma/Desktop/TLB] Error 2
  make: Leaving directory '/usr/src/linux-headers-3.19.0-23-generic'&lt;/code&gt;
  </code></pre>
  
  <ol>
  <li>How do I get this code running?</li>
  <li>How do modify the <code>dump_pagetables.c</code> So that I can see huge pages also. </li>
  </ol>