[sheepdog] [PATCH v4 2/2] tests: add a DynamoRIO client for testing the jounaling mechanism

Kai Zhang kyle at zelin.io
Mon Jul 8 11:05:22 CEST 2013


On Jul 8, 2013, at 4:22 PM, Hitoshi Mitake <mitake.hitoshi at gmail.com> wrote:

> At Mon, 8 Jul 2013 16:14:41 +0800,
> Kai Zhang wrote:
>> 
>> 
>> On Jul 5, 2013, at 11:06 AM, Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp> wrote:
>> 
>>> This patch adds a DynamoRIO (often called DR) client for testing the
>>> jounaling mechanism. Because of its nature, the recoverying path is
>>> the most important and hard to test part of the journaling
>>> mechanism. They need to be tested well.
>>> 
>>> But testing targetted recovery paths with traditional tests/ stuff is
>>> hard because:
>>> 1. killing sheeps with kill commands doesn't take into account the
>>>  internal state
>>> 2. inserting exit()s into sheep manually is a painful work
>>> 
>>> So this patch implements a fault injection mechanism with DR. DR
>>> provides rich functionalities of transparent dynamic
>>> instrumentation. One of the functionalities makes inserting function
>>> calls before and after system calls possible. With this mechanism, the
>>> fault injection mechanism lets sheep exit at suitable timings for
>>> testing recovery paths of the journaling.
>>> 
>>> How to use:
>>> 0. preparation
>>>  $ cd
>>>  $ svn checkout http://dynamorio.googlecode.com/svn/trunk/ dynamorio
>>>  $ cd dynamorio
>>>  $ mkdir build
>>>  $ cd build
>>>  $ cmake ..
>>>  $ make
>>> 
>>> (This patch assumes the source code of DR is store in $HOME/dynamorio,
>>> and the build is done in $HOME/dynamorio/build)
>>> 
>> 
>> Is it possible to remove this assumption?
> 
> Currently, no, I think.
> 

At least, I think we should depend on an environment variable like "DYNAMORIO_HOME"
and check it before we use it, both in shell scripts and CMakeList.txt

BTW: my cmake cannot find DynamoRIOConfig.cmake and dynamorio-config.cmake if I didn't call sudo make install 
in $HOME/dynamorio/build

>> 
>> 
>>> 1. build the DR client
>>>  $ cd tests/dynamorio/journaling/
>>>  $ cmake .
>>>  $ make
>>> 
>> 
>> Can we use autotools for compiling?
>> So that we can have a uniformed compile method.
>> Is there a reason that we have to use cmake?
> 
> We have to use cmake because it is the way of DynamoRIO. DR is a
> unique software, and it has no package for major distributions.
> 
> I think preparing a comprehensive build infrastructure for DR clients
> are hard and too costly. Let's think about them if we have many fault
> injectors and their maintenance cost is too high in the future.

The Makefile generated by cmake is something like:
/usr/bin/gcc $(C_DEFINES) $(C_FLAGS) -DX86_64 -DLINUX -fno-stack-protector -o CMakeFiles/journaling.dir/journaling.c.o -c /home/kyle/dev/sheepdog/tests/dynamo\ rio/journaling/journaling.c
which I think is not quite comprehensive. 
And I also found an way for not using cmake at the website of DynamoRIO.

Could you explain what is the hard thing that you pointed?

Thanks,
Kyle




More information about the sheepdog mailing list