vendredi 31 juillet 2015

How to dump page table?

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 dump_pagetable.chttp://ift.tt/1Iv3nlg.

I tried to run first by normal compiling gcc dump_pagetables.c -o dump_pagetables.out. But it gave me error: "dump_pagetable.c:15:27: fatal error: linux/debugfs.h: No such file or directory #include linux/debugfs.h>

Then I tried to use a make command make -C /lib/modules/$(uname -r)/build M=$PWD modules. So it gave me this errorCC [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'

  1. How do I get this code running?
  2. How do modify the dump_pagetables.c So that I can see huge pages also.

Aucun commentaire:

Enregistrer un commentaire