Granary / granary

Dynamic binary translation framework for instrumenting the Linux kernel and its modules
Other
76 stars 6 forks source link

[Compiling ERR]When compiling with 'GR_CLIENT=leak_detector', ERR occurs #21

Closed renzhengeek closed 10 years ago

renzhengeek commented 10 years ago

Hi all, When compiling with 'GR_CLIENT=leak_detector', occurs An ERR: (1)What I do: after start target VM,then do the following steps in Host machine: { make env python scripts/slowload.py --symbols --remote make detach KERNEL=1 make wrappers KERNEL=1 make clean KERNEL=1 make all KERNEL=1 KERNEL_DIR=~/linux-3.8 GR_CLIENT=leak_detector }

(2)What Compiler shows: { TYPES [GR] /home/renzhen/granary/granary/gen/kernel_types.h DETACH [GR] /home/renzhen/granary/granary/gen/kernel_detach.inc TYPES [GR] /home/renzhen/granary/granary/gen/kernel_types.h WRAPPERS [GR] /home/renzhen/granary/granary/gen/kernel_wrappers.h cp /home/renzhen/granary/Makefile /home/renzhen/granary/bin/Makefile ; make -C /lib/modules/3.8.0granary/build M=/home/renzhen/granary/bin GR_KBUILD_SOURCE_DIR=/home/renzhen/granary clean make[1]: coming into /home/renzhen/linux-3.8' make[1]:coming into/home/renzhen/linux-3.8' CC [DR] /home/renzhen/granary/deps/dr/dcontext.c CC [DR] /home/renzhen/granary/deps/dr/x86/instr.c CC [DR] /home/renzhen/granary/deps/dr/x86/decode.c CC [DR] /home/renzhen/granary/deps/dr/x86/decode_fast.c CC [DR] /home/renzhen/granary/deps/dr/x86/decode_table.c CC [DR] /home/renzhen/granary/deps/dr/x86/encode.c CC [DR] /home/renzhen/granary/deps/dr/x86/mangle.c CC [DR] /home/renzhen/granary/deps/dr/x86/proc.c AS [DR] /home/renzhen/granary/deps/dr/x86/x86.asm CXX [MURMUR] /home/renzhen/granary/deps/murmurhash/murmurhash.cc CXX [GR] /home/renzhen/granary/granary/instruction.cc CXX [GR] /home/renzhen/granary/granary/basic_block.cc CXX [GR] /home/renzhen/granary/granary/basic_block_info.cc CXX [GR] /home/renzhen/granary/granary/attach.cc In file included from /home/renzhen/granary/granary/attach.cc:7:0: /home/renzhen/granary/clients/instrument.h:126:5: error: #error "GRANARY_INIT_POLICY not defined; did you forget to include a file in clients/instrument.h?"

error "GRANARY_INIT_POLICY not defined; did you forget to include a file in clients/instrument.h?"

 ^

make: *\ [/home/renzhen/granary/bin/granary/attach.o] ERR 1 }

I looked attach.cc,where clients/instrument.h is included. Did I make things in wrong steps, or other missing?

Thanks in advance :)

renzhengeek commented 10 years ago

Seemingly, there is no 'leak_checker' implementation code. I want to make a really simple heap memory leak checker client using hashtable firstly, for example, just to check kmalloc and kfree.

I am just not clear about What is the framework that should be followed and what should be implemented.

Could you give me some advance about? (1). what's a good steps to do things? (2). and which API and DataStructure that does matters which I can use directly, and what others things should be do myself.

Thanks in advance:)

pgoodman commented 10 years ago

I removed the leak_detector tool some time ago, as there were quite a few changes in Granary that made it not work, and because it wasn't being actively maintained. Here's a version with the tool still in:

https://github.com/Granary/granary/tree/c3be7462f66f07e53f11ce161603522d5bf458eb/clients/watchpoints/clients/leak_detector

renzhengeek commented 10 years ago

Hi pgoodman, The code link can be visited online, but I do't know how to download or do some git-command in my granary repo.

Thank you. :smile:

renzhengeek commented 10 years ago

use command git checkout origin/release.