From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 02/29] Include generated QAPI headers less
Date: Wed, 7 Aug 2019 11:53:51 +0200 [thread overview]
Message-ID: <f115e089-ee3b-b919-7081-5440237b4aad@redhat.com> (raw)
In-Reply-To: <20190806151435.10740-3-armbru@redhat.com>
On 8/6/19 5:14 PM, Markus Armbruster wrote:
> 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 <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/core/qdev-properties.c | 2 ++
> hw/i386/kvm/i8254.c | 1 +
> hw/ide/qdev.c | 1 +
> include/authz/listfile.h | 1 -
> include/block/block.h | 1 -
> include/hw/acpi/acpi_dev_interface.h | 1 +
> include/hw/mem/memory-device.h | 1 +
> include/hw/ppc/spapr_drc.h | 1 -
> include/hw/qdev-properties.h | 2 --
> include/hw/virtio/virtio-pmem.h | 1 +
> include/migration/global_state.h | 1 -
> include/qemu/job.h | 2 +-
> include/sysemu/arch_init.h | 1 -
> include/ui/egl-helpers.h | 1 -
> monitor/monitor-internal.h | 1 -
> target/i386/monitor.c | 1 +
> target/i386/sev_i386.h | 2 +-
> ui/vnc.h | 1 -
> 18 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index 81c97f48a7..8510ad14b0 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 c29956ab77..27e36a2abf 100644
> --- a/hw/i386/kvm/i8254.c
> +++ b/hw/i386/kvm/i8254.c
> @@ -25,6 +25,7 @@
>
> #include "qemu/osdep.h"
> #include <linux/kvm.h>
> +#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 9d8502785d..eea22c09f4 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"
> diff --git a/include/authz/listfile.h b/include/authz/listfile.h
> index 33b728d873..24ae2e606c 100644
> --- a/include/authz/listfile.h
> +++ b/include/authz/listfile.h
> @@ -22,7 +22,6 @@
> #define QAUTHZ_LISTFILE_H
>
> #include "authz/list.h"
> -#include "qapi/qapi-types-authz.h"
> #include "qemu/filemonitor.h"
>
> #define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
> diff --git a/include/block/block.h b/include/block/block.h
> index 50a07c1c33..ae79b70e2d 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -2,7 +2,6 @@
> #define BLOCK_H
>
> #include "block/aio.h"
> -#include "qapi/qapi-types-block-core.h"
> #include "block/aio-wait.h"
> #include "qemu/iov.h"
> #include "qemu/coroutine.h"
> diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
> index 43ff119179..6465072b7d 100644
> --- a/include/hw/acpi/acpi_dev_interface.h
> +++ b/include/hw/acpi/acpi_dev_interface.h
> @@ -1,6 +1,7 @@
> #ifndef ACPI_DEV_INTERFACE_H
> #define ACPI_DEV_INTERFACE_H
>
> +#include "qapi/qapi-types-misc.h"
> #include "qom/object.h"
> #include "hw/boards.h"
>
> diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h
> index 0293a96abb..2ada6e7bde 100644
> --- a/include/hw/mem/memory-device.h
> +++ b/include/hw/mem/memory-device.h
> @@ -13,6 +13,7 @@
> #ifndef MEMORY_DEVICE_H
> #define MEMORY_DEVICE_H
>
> +#include "qapi/qapi-types-misc.h"
> #include "qom/object.h"
> #include "hw/qdev.h"
>
> diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
> index c2c543a591..576c711b86 100644
> --- a/include/hw/ppc/spapr_drc.h
> +++ b/include/hw/ppc/spapr_drc.h
> @@ -14,7 +14,6 @@
> #define HW_SPAPR_DRC_H
>
> #include <libfdt.h>
> -#include "qapi/qapi-types-run-state.h"
> #include "qom/object.h"
> #include "sysemu/sysemu.h"
> #include "hw/qdev.h"
> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> index 1eae5ab056..bb34a614e2 100644
> --- a/include/hw/qdev-properties.h
> +++ b/include/hw/qdev-properties.h
> @@ -1,8 +1,6 @@
> #ifndef QEMU_QDEV_PROPERTIES_H
> #define QEMU_QDEV_PROPERTIES_H
>
> -#include "qapi/qapi-types-block.h"
> -#include "qapi/qapi-types-misc.h"
> #include "hw/qdev-core.h"
>
> /*** qdev-properties.c ***/
> diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pmem.h
> index 19b6ee6d75..8bf2ae780f 100644
> --- a/include/hw/virtio/virtio-pmem.h
> +++ b/include/hw/virtio/virtio-pmem.h
> @@ -15,6 +15,7 @@
> #define HW_VIRTIO_PMEM_H
>
> #include "hw/virtio/virtio.h"
> +#include "qapi/qapi-types-misc.h"
> #include "sysemu/hostmem.h"
>
> #define TYPE_VIRTIO_PMEM "virtio-pmem"
> diff --git a/include/migration/global_state.h b/include/migration/global_state.h
> index fd22dd3034..d307de8350 100644
> --- a/include/migration/global_state.h
> +++ b/include/migration/global_state.h
> @@ -13,7 +13,6 @@
> #ifndef QEMU_MIGRATION_GLOBAL_STATE_H
> #define QEMU_MIGRATION_GLOBAL_STATE_H
>
> -#include "qapi/qapi-types-run-state.h"
> #include "sysemu/sysemu.h"
>
> void register_global_state(void);
> diff --git a/include/qemu/job.h b/include/qemu/job.h
> index 9e7cd1e4a0..73c67d3175 100644
> --- a/include/qemu/job.h
> +++ b/include/qemu/job.h
> @@ -26,7 +26,7 @@
> #ifndef JOB_H
> #define JOB_H
>
> -#include "qapi/qapi-types-block-core.h"
> +#include "qapi/qapi-types-job.h"
> #include "qemu/queue.h"
> #include "qemu/coroutine.h"
> #include "block/aio.h"
> diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
> index 10cbafe970..62c6fe4cf1 100644
> --- a/include/sysemu/arch_init.h
> +++ b/include/sysemu/arch_init.h
> @@ -1,7 +1,6 @@
> #ifndef QEMU_ARCH_INIT_H
> #define QEMU_ARCH_INIT_H
>
> -#include "qapi/qapi-types-misc.h"
>
> enum {
> QEMU_ARCH_ALL = -1,
> diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h
> index 58bd3a1ec4..dad19e9873 100644
> --- a/include/ui/egl-helpers.h
> +++ b/include/ui/egl-helpers.h
> @@ -4,7 +4,6 @@
> #include <epoxy/gl.h>
> #include <epoxy/egl.h>
> #include <gbm.h>
> -#include "qapi/qapi-types-ui.h"
> #include "ui/console.h"
> #include "ui/shader.h"
>
> diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h
> index 7760b22ba3..d78f5ca190 100644
> --- a/monitor/monitor-internal.h
> +++ b/monitor/monitor-internal.h
> @@ -27,7 +27,6 @@
>
> #include "chardev/char-fe.h"
> #include "monitor/monitor.h"
> -#include "qapi/qapi-types-misc.h"
> #include "qapi/qmp/dispatch.h"
> #include "qapi/qmp/json-parser.h"
> #include "qemu/readline.h"
> diff --git a/target/i386/monitor.c b/target/i386/monitor.c
> index 1f3b532fc2..9fb4d641d5 100644
> --- a/target/i386/monitor.c
> +++ b/target/i386/monitor.c
> @@ -33,6 +33,7 @@
> #include "sysemu/sev.h"
> #include "qapi/error.h"
> #include "sev_i386.h"
> +#include "qapi/qapi-commands-misc-target.h"
> #include "qapi/qapi-commands-misc.h"
>
> /* Perform linear address sign extension */
> diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h
> index 55313441ae..8ada9d385d 100644
> --- a/target/i386/sev_i386.h
> +++ b/target/i386/sev_i386.h
> @@ -19,7 +19,7 @@
> #include "sysemu/kvm.h"
> #include "sysemu/sev.h"
> #include "qemu/error-report.h"
> -#include "qapi/qapi-commands-misc-target.h"
> +#include "qapi/qapi-types-misc-target.h"
>
> #define SEV_POLICY_NODBG 0x1
> #define SEV_POLICY_NOKS 0x2
> diff --git a/ui/vnc.h b/ui/vnc.h
> index 2f84db3142..18f1b1d6d0 100644
> --- a/ui/vnc.h
> +++ b/ui/vnc.h
> @@ -27,7 +27,6 @@
> #ifndef QEMU_VNC_H
> #define QEMU_VNC_H
>
> -#include "qapi/qapi-types-ui.h"
> #include "qemu/queue.h"
> #include "qemu/thread.h"
> #include "ui/console.h"
>
next prev parent reply other threads:[~2019-08-07 9:54 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 15:14 [Qemu-devel] [PATCH v2 00/29] Tame a few "touch this, recompile the world" headers Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 01/29] include: Make headers more self-contained Markus Armbruster
2019-08-07 15:03 ` Alex Bennée
2019-08-07 19:45 ` Markus Armbruster
2019-08-07 21:28 ` Alex Bennée
2019-08-08 4:21 ` Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 02/29] Include generated QAPI headers less Markus Armbruster
2019-08-06 21:50 ` Eric Blake
2019-08-07 9:53 ` Philippe Mathieu-Daudé [this message]
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 03/29] qapi: Split error.json off common.json Markus Armbruster
2019-08-07 9:57 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 04/29] memory: Fix type of IOMMUMemoryRegionClass member @parent_class Markus Armbruster
2019-08-07 10:11 ` Philippe Mathieu-Daudé
2019-08-07 10:16 ` Paolo Bonzini
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 05/29] queue: Drop superfluous #include qemu/atomic.h Markus Armbruster
2019-08-07 10:21 ` Philippe Mathieu-Daudé
2019-08-07 15:40 ` Alex Bennée
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 06/29] trace: Eliminate use of TARGET_FMT_plx Markus Armbruster
2019-08-07 9:29 ` Stefan Hajnoczi
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 07/29] trace: Do not include qom/cpu.h into generated trace.h Markus Armbruster
2019-08-07 9:32 ` Stefan Hajnoczi
2019-08-07 10:30 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 08/29] Include sysemu/reset.h a lot less Markus Armbruster
2019-08-07 10:38 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 09/29] Include migration/qemu-file-types.h " Markus Armbruster
2019-08-07 12:25 ` Philippe Mathieu-Daudé
2019-08-07 17:30 ` Philippe Mathieu-Daudé
2019-08-07 19:46 ` Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 10/29] ide: Include hw/ide/internal a bit less outside hw/ide/ Markus Armbruster
2019-08-06 21:40 ` John Snow
2019-08-07 12:29 ` Philippe Mathieu-Daudé
2019-08-07 14:56 ` John Snow
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 11/29] typedefs: Separate incomplete types and function types Markus Armbruster
2019-08-07 12:31 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 12/29] Include hw/irq.h a lot less Markus Armbruster
2019-08-07 13:04 ` Philippe Mathieu-Daudé
2019-08-07 21:06 ` Eric Blake
2019-08-08 4:27 ` Markus Armbruster
2019-08-08 5:09 ` Richard Henderson
2019-08-08 11:48 ` Eric Blake
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 13/29] Clean up inclusion of exec/cpu-common.h Markus Armbruster
2019-08-07 14:20 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 14/29] migration: Move the VMStateDescription typedef to typedefs.h Markus Armbruster
2019-08-07 15:22 ` Alex Bennée
2019-08-07 17:13 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 15/29] Include migration/vmstate.h less Markus Armbruster
2019-08-07 14:44 ` Philippe Mathieu-Daudé
2019-08-08 11:36 ` Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 16/29] Include exec/memory.h slightly less Markus Armbruster
2019-08-07 14:50 ` Philippe Mathieu-Daudé
2019-08-08 12:16 ` Markus Armbruster
2019-08-08 12:36 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 17/29] Include qom/object.h " Markus Armbruster
2019-08-07 17:11 ` Philippe Mathieu-Daudé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 18/29] Include hw/hw.h exactly where needed Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 19/29] Include qemu/queue.h slightly less Markus Armbruster
2019-08-07 15:57 ` Alex Bennée
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 20/29] Include qemu/main-loop.h less Markus Armbruster
2019-08-07 13:18 ` Philippe Mathieu-Daudé
2019-08-07 13:49 ` Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 21/29] Include hw/qdev-properties.h less Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 22/29] Include hw/boards.h a bit less Markus Armbruster
2019-08-06 21:37 ` Alistair Francis
2019-08-07 17:26 ` Philippe Mathieu-Daudé
2019-08-07 17:57 ` Eduardo Habkost
2019-08-07 18:05 ` Philippe Mathieu-Daudé
2019-08-07 18:19 ` Eduardo Habkost
2019-08-08 11:57 ` Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 23/29] numa: Don't include hw/boards.h into sysemu/numa.h Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 24/29] Include sysemu/hostmem.h less Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 25/29] numa: Move remaining NUMA declarations from sysemu.h to numa.h Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 26/29] Clean up inclusion of sysemu/sysemu.h Markus Armbruster
2019-08-06 21:36 ` Alistair Francis
2019-08-07 15:47 ` Alex Bennée
2019-08-07 20:10 ` Markus Armbruster
2019-08-08 14:21 ` Alex Bennée
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 27/29] Include sysemu/sysemu.h a lot less Markus Armbruster
2019-08-06 21:38 ` Alistair Francis
2019-08-07 9:28 ` Stefan Hajnoczi
2019-08-07 13:24 ` Philippe Mathieu-Daudé
2019-08-07 13:51 ` Markus Armbruster
2019-08-07 17:31 ` Philippe Mathieu-Daudé
2019-08-07 20:16 ` Markus Armbruster
2019-08-07 21:05 ` Philippe Mathieu-Daudé
2019-08-08 4:48 ` [Qemu-devel] Is network backend netmap worth keeping? (was: [PATCH v2 27/29] Include sysemu/sysemu.h a lot less) Markus Armbruster
2019-08-08 5:38 ` [Qemu-devel] Is network backend netmap worth keeping? Jason Wang
2019-08-08 13:36 ` Philippe Mathieu-Daudé
2019-08-08 17:27 ` Vincenzo Maffione
2019-08-08 7:27 ` Giuseppe Lettieri
2019-08-08 11:52 ` Markus Armbruster
2019-08-12 12:32 ` Philippe Mathieu-Daudé
2019-08-12 12:34 ` Philippe Mathieu-Daudé
2019-09-02 20:50 ` Giuseppe Lettieri
2019-09-13 13:04 ` Markus Armbruster
2019-09-16 14:45 ` Giuseppe Lettieri
2019-09-23 11:21 ` Markus Armbruster
2019-10-04 13:02 ` [PATCH] netmap: support git-submodule build otption Giuseppe Lettieri
2019-10-04 13:08 ` Peter Maydell
2019-10-07 10:49 ` Markus Armbruster
2019-10-07 11:58 ` Peter Maydell
2019-10-07 12:35 ` Markus Armbruster
2019-10-07 12:39 ` Peter Maydell
2019-10-08 9:17 ` Daniel P. Berrangé
2019-10-08 11:57 ` Markus Armbruster
2019-10-07 15:37 ` Thomas Huth
2019-10-07 17:53 ` Markus Armbruster
2019-10-07 15:44 ` Markus Armbruster
2019-08-08 8:12 ` [Qemu-devel] Is network backend netmap worth keeping? (was: [PATCH v2 27/29] Include sysemu/sysemu.h a lot less) Stefano Garzarella
2019-10-07 18:21 ` Is network backend vde worth keeping? (was: Is network backend netmap worth keeping?) Markus Armbruster
2019-10-09 9:13 ` Thomas Huth
2019-10-11 6:55 ` Thomas Huth
2019-10-10 17:07 ` Julia Suvorova
2019-10-10 17:39 ` Daniel P. Berrangé
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 28/29] sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h Markus Armbruster
2019-08-07 15:26 ` Alex Bennée
2019-08-07 20:19 ` Markus Armbruster
2019-08-06 15:14 ` [Qemu-devel] [PATCH v2 29/29] sysemu: Split sysemu/runstate.h off sysemu/sysemu.h Markus Armbruster
2019-08-07 4:40 ` Markus Armbruster
2019-08-07 10:15 ` Paolo Bonzini
2019-08-06 16:02 ` [Qemu-devel] [PATCH v2 00/29] Tame a few "touch this, recompile the world" headers no-reply
2019-08-06 16:56 ` no-reply
2019-08-07 16:32 ` Alex Bennée
2019-08-07 20:21 ` Markus Armbruster
2019-08-08 13:21 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f115e089-ee3b-b919-7081-5440237b4aad@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).