util: add list_sort()

This function sort the list, taken from linux kernel.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie/trace: add graph stat function

This is useful to get how much time each function takes during the trace.

$ collie trace graph stat
   Total (s)   Per Call (ms)   Calls   Name
   100.659       51.356         1960   eventfd_xread
    79.315       68.790         1153   do_process_work
    76.645      348.388          220   do_push_object
    76.637      348.349          220   push_cache_object
    74.611      185.139          403   gateway_create_and_write_obj
    74.338      345.757          215   exec_local_req
    74.276      350.361          212   gateway_forward_request
    35.555       34.722         1024   xpwrite
    35.547        7.119         4993   event_loop
    35.538        7.118         4993   do_event_loop
    34.299      385.380           89   sheep_do_op_work
    33.778      427.565           79   peer_create_and_write_obj
    33.776      427.547           79   default_create_and_write
    26.324     2632.399           10   object_cache_push
    26.259     2917.706            9   do_background_push
     2.525        2.701          935   object_cache_handle_request
...

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie/trace: use macro for the width of thread name

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/func: add common header to tests

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/func: add _vdi_list helper

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/func: fix 068 so that _vdi_list different node in the loop

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
rename collie as dog

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
symlink dog to collie for compatibility

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
fix 'make rpm'

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
tests/functional: add _requirement() to filter testcases

We have several restrictions on which tests can be run.  E.g. 011
cannot be run without a root privilege, 042 cannot be run with -md
option, some cluster tests cannot be passed with shepherd, etc.

This patch generalizes _need_to_be_root() to _requirement() and
enables us to control which tests should be run more flexibly.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/functional: use _requirements to control md tests

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/functional: add support for client cache mode

This enables us to test the object cache feature.

E.g.

 $ sudo env SHEEP_EXTRA_OPTIONS="-w size=100" ./check
 $ sudo env SHEEP_EXTRA_OPTIONS="-w size=100" ./check -writethrough
 $ sudo env SHEEP_EXTRA_OPTIONS="-w size=100" ./check -direct

Note that writeback is default.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/functional: add a script for throughout test

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>