From 2ae16a6aa4ce688e2ee25dec3ad2f023bece0b14 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:32 +0200 Subject: Include generated QAPI headers less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some of the generated qapi-types-MODULE.h are included all over the place. Changing a QAPI type can trigger massive recompiling. Top scorers recompile more than 1000 out of some 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h): 6300 qapi/qapi-builtin-types.h 5700 qapi/qapi-types-run-state.h 3900 qapi/qapi-types-common.h 3300 qapi/qapi-types-sockets.h 3000 qapi/qapi-types-misc.h 3000 qapi/qapi-types-crypto.h 3000 qapi/qapi-types-job.h 3000 qapi/qapi-types-block-core.h 2800 qapi/qapi-types-block.h 1300 qapi/qapi-types-net.h Clean up headers to include generated QAPI headers only where needed. Impact is negligible except for hw/qdev-properties.h. This header includes qapi/qapi-types-block.h and qapi/qapi-types-misc.h. They are used only in expansions of property definition macros such as DEFINE_PROP_BLOCKDEV_ON_ERROR() and DEFINE_PROP_OFF_AUTO(). Moving their inclusion from hw/qdev-properties.h to the users of these macros avoids pointless recompiles. This is how other property definition macros, such as DEFINE_PROP_NETDEV(), already work. Improves things for some of the top scorers: 3600 qapi/qapi-types-common.h 2800 qapi/qapi-types-sockets.h 900 qapi/qapi-types-misc.h 2200 qapi/qapi-types-crypto.h 2100 qapi/qapi-types-job.h 2100 qapi/qapi-types-block-core.h 270 qapi/qapi-types-block.h Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190812052359.30071-3-armbru@redhat.com> --- hw/core/qdev-properties.c | 2 ++ hw/i386/kvm/i8254.c | 1 + hw/ide/qdev.c | 1 + 3 files changed, 4 insertions(+) (limited to 'hw') diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 81c97f4..8510ad1 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -3,6 +3,8 @@ #include "hw/qdev.h" #include "qapi/error.h" #include "hw/pci/pci.h" +#include "qapi/qapi-types-block.h" +#include "qapi/qapi-types-misc.h" #include "qapi/qmp/qerror.h" #include "qemu/ctype.h" #include "qemu/error-report.h" diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index c29956a..27e36a2 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include +#include "qapi/qapi-types-misc.h" #include "qapi/error.h" #include "qemu/module.h" #include "qemu/timer.h" diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 9d85027..eea22c0 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -21,6 +21,7 @@ #include "hw/hw.h" #include "sysemu/dma.h" #include "qapi/error.h" +#include "qapi/qapi-types-block.h" #include "qemu/error-report.h" #include "qemu/module.h" #include "hw/ide/internal.h" -- cgit v1.1