sheep, logger: select log formatter before log_init()

sd_printf() series can be called before calling log_init(). In such a
case, segmentation faults can be rised because format in logger.c is
NULL.
e.g. init_path() calls sd_eprintf() before log_init() when it fails
creating directory for sheep process.

This patch adds new function select_log_formatter(). This is only for
selecting formatter and should be called before sd_printf() series.
After applying this patch, sheep calls this function in the loop for
parsing command line options.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
trace: fix deadlock of current code when tracer is enabled

Mark functions that are needed by logger as notrace.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: clean up some sd_printf

These sd_printf aren't informative to ordinary users. We'd better keep them
as debug info to hide from users.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
find double declaration of global variables in sparse check

We do not initialise global variables to 0 or NULL and it allows GCC
to declare them multiple times in different places.  This detects the
unsafe usage when doing sparse check.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
fix double declaration of global variables

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
remove splint check

We use many GCC specific features that splint cannot parse.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Change 'make sparse-check' to 'make sparse' for simplicity

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Merge remote branch 'official/master'