]> xenbits.xensource.com Git - qemu-xen.git/commit
log-for-trace.h: Split out parts of log.h used by trace.h
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 13 Feb 2018 14:00:29 +0000 (14:00 +0000)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 12 Mar 2018 11:10:20 +0000 (11:10 +0000)
commitbe0aa7ac8990c7d62f2d41a66e8c50784e7ee9ac
tree2243dd261d3ab1c0b3232cec9a7c983c925fd795
parente4ae62b802cec437f877f2cadc4ef059cc0eca76
log-for-trace.h: Split out parts of log.h used by trace.h

A persistent build problem we see is where a source file
accidentally omits the #include of log.h. This slips through
local developer testing because if you configure with the
default (log) trace backend trace.h will pull in log.h for you.
Compilation fails only if some other backend is selected.

To make this error cause a compile failure regardless of
the configured trace backend, split out the parts of log.h
that trace.h requires into a new log-for-trace.h header.
Since almost all manual uses of the log.h functions will
use constants or functions which aren't in log-for-trace.h,
this will let us catch missing #include "qemu/log.h" more
consistently.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180213140029.8308-1-peter.maydell@linaro.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
include/qemu/log-for-trace.h [new file with mode: 0644]
include/qemu/log.h
scripts/tracetool/backend/log.py