Skip to contentSkip to conversation

Switch all subdirs over to modular trace.h file

PATCH Superseded Daniel P. Berrange 6 participants 83 messages Jan 6, 2017 – Jan 12, 2017

Subsystems (5)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#5 lore raw

PATCH v2 2/47 trace: switch io/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the io/ directory to include the
io/trace.h file instead of the global trace.h
file.

---
 Makefile.objs        | 2 +-
 io/Makefile.objs     | 2 ++
 io/channel-buffer.c  | 2 +-
 io/channel-command.c | 2 +-
 io/channel-file.c    | 2 +-
 io/channel-socket.c  | 2 +-
 io/channel-tls.c     | 2 +-
 io/channel-websock.c | 2 +-
 io/task.c            | 2 +-
 9 files changed, 10 insertions(+), 8 deletions(-)
Makefile.objs +1 -1
index fc398d5..c3f1e45 100644
@@ -122,7 +122,7 @@ trace-events-subdirs =
 trace-events-y = trace-events
 trace-events-y += util/trace-events
 trace-events-y += crypto/trace-events
-trace-events-y += io/trace-events
+trace-events-subdirs += io
 trace-events-y += migration/trace-events
 trace-events-y += block/trace-events
 trace-events-y += hw/block/trace-events
io/Makefile.objs +2 -0
index 9d8337d..94cb74e 100644
@@ -8,3 +8,5 @@ io-obj-y += channel-watch.o
 io-obj-y += channel-websock.o
 io-obj-y += channel-util.o
 io-obj-y += task.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
io/channel-buffer.c +1 -1
index 43d7959..b4e50d6 100644
@@ -22,7 +22,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"
 
 QIOChannelBuffer *
 qio_channel_buffer_new(size_t capacity)
io/channel-command.c +1 -1
index ad25313..7624653 100644
@@ -23,7 +23,7 @@
 #include "io/channel-watch.h"
 #include "qapi/error.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"
 
 
 QIOChannelCommand *
io/channel-file.c +1 -1
index e1da243..7b064ef 100644
@@ -23,7 +23,7 @@
 #include "io/channel-watch.h"
 #include "qapi/error.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"
 
 QIOChannelFile *
 qio_channel_file_new_fd(int fd)
io/channel-socket.c +1 -1
index d7e03f6..8d81d8b 100644
@@ -22,7 +22,7 @@
 #include "qapi/error.h"
 #include "io/channel-socket.h"
 #include "io/channel-watch.h"
-#include "trace.h"
+#include "io/trace.h"
 #include "qapi/clone-visitor.h"
 
 #define SOCKET_MAX_FDS 16
io/channel-tls.c +1 -1
index d24dc8c..a77a6fd 100644
@@ -21,7 +21,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "io/channel-tls.h"
-#include "trace.h"
+#include "io/trace.h"
 
 
 static ssize_t qio_channel_tls_write_handler(const char *buf,
io/channel-websock.c +1 -1
index f45bced..4fa5385 100644
@@ -23,7 +23,7 @@
 #include "qemu/bswap.h"
 #include "io/channel-websock.h"
 #include "crypto/hash.h"
-#include "trace.h"
+#include "io/trace.h"
 
 
 /* Max amount to allow in rawinput/rawoutput buffers */
io/task.c +1 -1
index c7f97a9..d81adf2 100644
@@ -22,7 +22,7 @@
 #include "io/task.h"
 #include "qapi/error.h"
 #include "qemu/thread.h"
-#include "trace.h"
+#include "io/trace.h"
 
 struct QIOTask {
     Object *source;
Signature · 1 line
2.9.3
#0 lore raw

v2 cover Switch all subdirs over to modular trace.h file

This is the final part of my trace events refactoring.

Previously we merged code that split trace-events up into one file per sub-directory. We also merged code to the code-generator that enables us to generate and use multiple independant sets of trace events.

This is the final glue that makes use of these two earlier changes, so that we actually generate a separate trace.h & trace.c file per sub-directory.

The result is that when adding a new trace event to a file, only files in that sub-directory get rebuilt. Theoretically the build is faster too, since each source file includes a much smaller trace.h that only contains probes relevant to it. In reality this speed benefit is probably marginal & lost in the noise.

The first patch introduces the new Makefile rules to handle modular building.

The next 43 patches convert over each sub-directory. They are totally boring and repetative. The only exception is the patch for target/s390x which hit a bit of makefile pain, explained in its commit msg.

The 45th patch removes the old, now unused, Makefile rules for non-modular trace building.

The 46th patch documents the new approach

The final patch is just a small tweak to error reporting, unrelated to the refactoring.

Daniel P. Berrange (47):
trace: introduce some Makefile rules for module code gen
trace: switch io/ directory to modular trace.h file
trace: switch util/ directory to modular trace.h file
trace: switch crypto/ directory to modular trace.h file
trace: switch migration/ directory to modular trace.h file
trace: switch block/ directory to modular trace.h file
trace: switch hw/block/ directory to modular trace.h file
trace: switch hw/char/ directory to modular trace.h file
trace: switch hw/intc/ directory to modular trace.h file
trace: switch hw/net/ directory to modular trace.h file
trace: switch hw/virtio/ directory to modular trace.h file
trace: switch hw/audio/ directory to modular trace.h file
trace: switch hw/misc/ directory to modular trace.h file
trace: switch hw/usb/ directory to modular trace.h file
trace: switch hw/scsi/ directory to modular trace.h file
trace: switch hw/nvram/ directory to modular trace.h file
trace: switch hw/display/ directory to modular trace.h file
trace: switch hw/input/ directory to modular trace.h file
trace: switch hw/timer/ directory to modular trace.h file
trace: switch hw/dma/ directory to modular trace.h file
trace: switch hw/sparc/ directory to modular trace.h file
trace: switch hw/sd/ directory to modular trace.h file
trace: switch hw/isa/ directory to modular trace.h file
trace: switch hw/mem/ directory to modular trace.h file
trace: switch hw/i386/ directory to modular trace.h file
trace: switch hw/9pfs/ directory to modular trace.h file
trace: switch hw/ppc/ directory to modular trace.h file
trace: switch hw/pci/ directory to modular trace.h file
trace: switch hw/s390x/ directory to modular trace.h file
trace: switch hw/vfio/ directory to modular trace.h file
trace: switch hw/acpi/ directory to modular trace.h file
trace: switch hw/arm/ directory to modular trace.h file
trace: switch hw/alpha/ directory to modular trace.h file
trace: switch ui/ directory to modular trace.h file
trace: switch audio/ directory to modular trace.h file
trace: switch net/ directory to modular trace.h file
trace: switch target/arm/ directory to modular trace.h file
trace: switch target/i386/ directory to modular trace.h file
trace: switch target/sparc/ directory to modular trace.h file
trace: switch target/s390x/ directory to modular trace.h file
trace: switch target/ppc/ directory to modular trace.h file
trace: switch qom/ directory to modular trace.h file
trace: switch linux-user/ directory to modular trace.h file
trace: switch qapi/ directory to modular trace.h file
trace: remove the global include/trace.h file
trace: update docs to reflect new code generation approach
trace: improve error reporting when parsing simpletrace header

 .gitignore                               |  14 ++--
 Makefile                                 | 117 ++++++++++++++++++++++++++-----
 Makefile.objs                            |  95 +++++++++++++------------
 Makefile.target                          |  30 +++++++-
 audio/Makefile.objs                      |   2 +
 audio/alsaaudio.c                        |   2 +-
 audio/ossaudio.c                         |   2 +-
 block.c                                  |   2 +-
 block/Makefile.objs                      |   2 +
 block/backup.c                           |   2 +-
 block/block-backend.c                    |   2 +-
 block/commit.c                           |   2 +-
 block/dirty-bitmap.c                     |   2 +-
 block/io.c                               |   2 +-
 block/mirror.c                           |   2 +-
 block/nfs.c                              |   2 +-
 block/qcow2-cache.c                      |   2 +-
 block/qcow2-cluster.c                    |   2 +-
 block/qcow2.c                            |   2 +-
 block/qed-l2-cache.c                     |   2 +-
 block/qed-table.c                        |   2 +-
 block/qed.c                              |   2 +-
 block/raw-posix.c                        |   2 +-
 block/raw-win32.c                        |   2 +-
 block/stream.c                           |   2 +-
 blockdev.c                               |   2 +-
 crypto/Makefile.objs                     |   2 +
 crypto/secret.c                          |   2 +-
 crypto/tlscreds.c                        |   2 +-
 crypto/tlscredsanon.c                    |   2 +-
 crypto/tlscredsx509.c                    |   2 +-
 crypto/tlssession.c                      |   2 +-
 docs/tracing.txt                         |  61 +++++++++++++---
 hw/9pfs/9p.c                             |   2 +-
 hw/9pfs/Makefile.objs                    |   2 +
 hw/acpi/Makefile.objs                    |   2 +
 hw/acpi/cpu.c                            |   2 +-
 hw/acpi/memory_hotplug.c                 |   2 +-
 hw/alpha/Makefile.objs                   |   2 +
 hw/alpha/pci.c                           |   2 +-
 hw/arm/Makefile.objs                     |   2 +
 hw/arm/virt-acpi-build.c                 |   2 +-
 hw/audio/Makefile.objs                   |   3 +
 hw/audio/cs4231.c                        |   2 +-
 hw/audio/milkymist-ac97.c                |   2 +-
 hw/block/Makefile.objs                   |   2 +
 hw/block/dataplane/virtio-blk.c          |   2 +-
 hw/block/hd-geometry.c                   |   2 +-
 hw/block/virtio-blk.c                    |   2 +-
 hw/char/Makefile.objs                    |   2 +
 hw/char/escc.c                           |   2 +-
 hw/char/grlib_apbuart.c                  |   2 +-
 hw/char/lm32_juart.c                     |   2 +-
 hw/char/lm32_uart.c                      |   2 +-
 hw/char/milkymist-uart.c                 |   2 +-
 hw/char/virtio-console.c                 |   2 +-
 hw/char/virtio-serial-bus.c              |   2 +-
 hw/display/Makefile.objs                 |   3 +
 hw/display/g364fb.c                      |   2 +-
 hw/display/jazz_led.c                    |   2 +-
 hw/display/milkymist-tmu2.c              |   2 +-
 hw/display/milkymist-vgafb.c             |   2 +-
 hw/display/qxl-render.c                  |   2 +-
 hw/display/qxl.c                         |   2 +-
 hw/display/vga.c                         |   2 +-
 hw/display/virtio-gpu-3d.c               |   2 +-
 hw/display/virtio-gpu.c                  |   2 +-
 hw/display/vmware_vga.c                  |   2 +-
 hw/display/xenfb.c                       |   2 +-
 hw/dma/Makefile.objs                     |   2 +
 hw/dma/i8257.c                           |   2 +-
 hw/dma/rc4030.c                          |   2 +-
 hw/dma/sparc32_dma.c                     |   2 +-
 hw/dma/sun4m_iommu.c                     |   2 +-
 hw/i386/Makefile.objs                    |   2 +
 hw/i386/x86-iommu.c                      |   2 +-
 hw/i386/xen/xen_platform.c               |   1 +
 hw/i386/xen/xen_pvdevice.c               |   1 +
 hw/input/Makefile.objs                   |   3 +
 hw/input/hid.c                           |   2 +-
 hw/input/milkymist-softusb.c             |   2 +-
 hw/input/ps2.c                           |   2 +-
 hw/input/virtio-input.c                  |   2 +-
 hw/intc/Makefile.objs                    |   2 +
 hw/intc/apic.c                           |   2 +-
 hw/intc/apic_common.c                    |   2 +-
 hw/intc/arm_gic.c                        |   2 +-
 hw/intc/arm_gicv3_cpuif.c                |   2 +-
 hw/intc/arm_gicv3_dist.c                 |   2 +-
 hw/intc/arm_gicv3_redist.c               |   2 +-
 hw/intc/aspeed_vic.c                     |   2 +-
 hw/intc/grlib_irqmp.c                    |   2 +-
 hw/intc/lm32_pic.c                       |   2 +-
 hw/intc/s390_flic.c                      |   2 +-
 hw/intc/s390_flic_kvm.c                  |   2 +-
 hw/intc/slavio_intctl.c                  |   2 +-
 hw/intc/xics.c                           |   2 +-
 hw/intc/xics_kvm.c                       |   2 +-
 hw/intc/xics_spapr.c                     |   2 +-
 hw/isa/Makefile.objs                     |   2 +
 hw/isa/pc87312.c                         |   2 +-
 hw/mem/Makefile.objs                     |   3 +
 hw/mem/pc-dimm.c                         |   2 +-
 hw/misc/Makefile.objs                    |   3 +
 hw/misc/aspeed_scu.c                     |   2 +-
 hw/misc/eccmemctl.c                      |   2 +-
 hw/misc/milkymist-hpdmc.c                |   2 +-
 hw/misc/milkymist-pfpu.c                 |   2 +-
 hw/misc/slavio_misc.c                    |   2 +-
 hw/net/Makefile.objs                     |   3 +
 hw/net/e1000e.c                          |   2 +-
 hw/net/e1000e_core.c                     |   2 +-
 hw/net/e1000x_common.c                   |   2 +-
 hw/net/lance.c                           |   2 +-
 hw/net/milkymist-minimac2.c              |   2 +-
 hw/net/mipsnet.c                         |   2 +-
 hw/net/net_rx_pkt.c                      |   2 +-
 hw/net/opencores_eth.c                   |   2 +-
 hw/net/pcnet-pci.c                       |   2 +-
 hw/net/pcnet.c                           |   2 +-
 hw/nvram/Makefile.objs                   |   2 +
 hw/nvram/ds1225y.c                       |   2 +-
 hw/nvram/fw_cfg.c                        |   2 +-
 hw/pci/Makefile.objs                     |   2 +
 hw/pci/pci.c                             |   2 +-
 hw/pci/pci_host.c                        |   2 +-
 hw/ppc/Makefile.objs                     |   3 +
 hw/ppc/ppc.c                             |   2 +-
 hw/ppc/prep.c                            |   2 +-
 hw/ppc/spapr.c                           |   2 +-
 hw/ppc/spapr_hcall.c                     |   2 +-
 hw/ppc/spapr_iommu.c                     |   2 +-
 hw/ppc/spapr_pci.c                       |   2 +-
 hw/ppc/spapr_rtas_ddw.c                  |   2 +-
 hw/s390x/Makefile.objs                   |   3 +
 hw/s390x/css.c                           |   2 +-
 hw/s390x/virtio-ccw.c                    |   2 +-
 hw/scsi/Makefile.objs                    |   3 +
 hw/scsi/esp-pci.c                        |   2 +-
 hw/scsi/esp.c                            |   2 +-
 hw/scsi/megasas.c                        |   2 +-
 hw/scsi/mptconfig.c                      |   2 +-
 hw/scsi/mptendian.c                      |   2 +-
 hw/scsi/mptsas.c                         |   2 +-
 hw/scsi/scsi-bus.c                       |   2 +-
 hw/scsi/vmw_pvscsi.c                     |   2 +-
 hw/sd/Makefile.objs                      |   2 +
 hw/sd/milkymist-memcard.c                |   2 +-
 hw/sparc/Makefile.objs                   |   2 +
 hw/sparc/leon3.c                         |   2 +-
 hw/sparc/sun4m.c                         |   2 +-
 hw/timer/Makefile.objs                   |   2 +
 hw/timer/aspeed_timer.c                  |   2 +-
 hw/timer/grlib_gptimer.c                 |   2 +-
 hw/timer/lm32_timer.c                    |   2 +-
 hw/timer/milkymist-sysctl.c              |   2 +-
 hw/timer/slavio_timer.c                  |   2 +-
 hw/usb/Makefile.objs                     |   3 +
 hw/usb/bus.c                             |   2 +-
 hw/usb/combined-packet.c                 |   2 +-
 hw/usb/core.c                            |   2 +-
 hw/usb/desc.c                            |   2 +-
 hw/usb/dev-hub.c                         |   2 +-
 hw/usb/dev-mtp.c                         |   2 +-
 hw/usb/dev-uas.c                         |   2 +-
 hw/usb/hcd-ehci.c                        |   2 +-
 hw/usb/hcd-ohci.c                        |   2 +-
 hw/usb/hcd-uhci.c                        |   2 +-
 hw/usb/hcd-xhci.c                        |   2 +-
 hw/usb/host-libusb.c                     |   2 +-
 hw/vfio/Makefile.objs                    |   2 +
 hw/vfio/common.c                         |   2 +-
 hw/vfio/pci-quirks.c                     |   2 +-
 hw/vfio/pci.c                            |   2 +-
 hw/vfio/platform.c                       |   2 +-
 hw/vfio/spapr.c                          |   2 +-
 hw/virtio/Makefile.objs                  |   2 +
 hw/virtio/virtio-balloon.c               |   2 +-
 hw/virtio/virtio-rng.c                   |   2 +-
 hw/virtio/virtio.c                       |   2 +-
 include/trace.h                          |   6 --
 io/Makefile.objs                         |   2 +
 io/channel-buffer.c                      |   2 +-
 io/channel-command.c                     |   2 +-
 io/channel-file.c                        |   2 +-
 io/channel-socket.c                      |   2 +-
 io/channel-tls.c                         |   2 +-
 io/channel-websock.c                     |   2 +-
 io/task.c                                |   2 +-
 linux-user/Makefile.objs                 |   2 +
 linux-user/signal.c                      |   2 +-
 migration/Makefile.objs                  |   2 +
 migration/exec.c                         |   2 +-
 migration/fd.c                           |   2 +-
 migration/migration.c                    |   2 +-
 migration/postcopy-ram.c                 |   2 +-
 migration/qemu-file.c                    |   2 +-
 migration/ram.c                          |   2 +-
 migration/rdma.c                         |   2 +-
 migration/savevm.c                       |   2 +-
 migration/socket.c                       |   2 +-
 migration/tls.c                          |   2 +-
 migration/vmstate.c                      |   2 +-
 net/Makefile.objs                        |   2 +
 net/filter-mirror.c                      |   2 +-
 net/vhost-user.c                         |   2 +-
 qapi/Makefile.objs                       |   2 +
 qapi/qapi-visit-core.c                   |   2 +-
 qom/Makefile.objs                        |   2 +
 qom/object.c                             |   2 +-
 qom/trace-events                         |   7 ++
 scripts/simpletrace.py                   |  10 ++-
 scripts/tracetool/backend/dtrace.py      |   2 +-
 scripts/tracetool/backend/ust.py         |   2 +-
 scripts/tracetool/format/ust_events_c.py |   2 +-
 scripts/tracetool/format/ust_events_h.py |   7 +-
 target/arm/Makefile.objs                 |   2 +
 target/arm/helper.c                      |   2 +-
 target/i386/Makefile.objs                |   2 +
 target/i386/kvm.c                        |   2 +-
 target/ppc/Makefile.objs                 |   2 +
 target/ppc/kvm.c                         |   2 +-
 target/s390x/Makefile.objs               |  21 +-----
 target/s390x/cpu.c                       |   2 +-
 target/s390x/ioinst.c                    |   2 +-
 target/s390x/kvm.c                       |   2 +-
 target/s390x/mmu_helper.c                |   2 +-
 target/sparc/Makefile.objs               |   2 +
 target/sparc/int32_helper.c              |   2 +-
 target/sparc/int64_helper.c              |   2 +-
 target/sparc/mmu_helper.c                |   2 +-
 target/sparc/win_helper.c                |   2 +-
 tests/Makefile.include                   |   2 +-
 trace-events                             |   6 --
 trace/Makefile.objs                      |  81 +--------------------
 ui/Makefile.objs                         |   3 +
 ui/console.c                             |   2 +-
 ui/gtk-egl.c                             |   2 +-
 ui/gtk-gl-area.c                         |   2 +-
 ui/gtk.c                                 |   2 +-
 ui/input.c                               |   2 +-
 ui/spice-display.c                       |   2 +-
 ui/vnc.c                                 |   2 +-
 util/Makefile.objs                       |   2 +
 util/buffer.c                            |   2 +-
 util/hbitmap.c                           |   2 +-
 util/oslib-posix.c                       |   2 +-
 util/oslib-win32.c                       |   2 +-
 util/qemu-coroutine-lock.c               |   2 +-
 util/qemu-coroutine.c                    |   2 +-
 250 files changed, 552 insertions(+), 388 deletions(-)
 delete mode 100644 include/trace.h
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 1/47 trace: introduce some Makefile rules for module code gen

Introduce rules that are able to generate trace.[ch] files in every subdirectory which has a trace-events file.

---
 .gitignore                               |  6 +++
 Makefile                                 | 65 +++++++++++++++++++++++++++-----
 Makefile.objs                            |  5 +++
 Makefile.target                          |  7 +++-
 scripts/tracetool/backend/dtrace.py      |  7 +++-
 scripts/tracetool/backend/ust.py         |  7 +++-
 scripts/tracetool/format/ust_events_c.py |  2 +-
 scripts/tracetool/format/ust_events_h.py |  7 +++-
 tests/Makefile.include                   |  2 +-
 trace/Makefile.objs                      | 23 ++++++++---
 10 files changed, 109 insertions(+), 22 deletions(-)
.gitignore +6 -0
index e43c304..fe6add3 100644
@@ -111,3 +111,9 @@ tags
 TAGS
 docker-src.*
 *~
+trace.h
+trace.c
+trace-events-common
+trace-ust.h
+trace-dtrace.h
+trace-dtrace.dtrace
Makefile +56 -9

111 lines not on this page · raw message

Makefile.objs +5 -0
index 51c36a4..fc398d5 100644
@@ -118,6 +118,7 @@ ivshmem-server-obj-y = contrib/ivshmem-server/
 
 
 ######################################################################
+trace-events-subdirs =
 trace-events-y = trace-events
 trace-events-y += util/trace-events
 trace-events-y += crypto/trace-events
@@ -162,3 +163,7 @@ trace-events-y += target/ppc/trace-events
 trace-events-y += qom/trace-events
 trace-events-y += linux-user/trace-events
 trace-events-y += qapi/trace-events
+
+trace-events-files = $(trace-events-y) $(trace-events-subdirs:%=%/trace-events)
+
+trace-obj-y = $(trace-events-subdirs:%=%/)
Makefile.target +5 -2
index 8ae82cb..b14ab45 100644
@@ -182,7 +182,8 @@ dummy := $(call unnest-vars,.., \
                qom-obj-y \
                io-obj-y \
                common-obj-y \
-               common-obj-m)
+               common-obj-m \
+               trace-obj-y)
 target-obj-y := $(target-obj-y-save)
 all-obj-y += $(common-obj-y)
 all-obj-y += $(target-obj-y)
@@ -194,8 +195,10 @@ all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y)
 
 $(QEMU_PROG_BUILD): config-devices.mak
 
+COMMON_LDADDS = $(trace-obj-y) ../libqemuutil.a ../libqemustub.a
+
 # build either PROG or PROGW
-$(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
+$(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS)
 	$(call LINK, $(filter-out %.mak, $^))
 ifdef CONFIG_DARWIN
 	$(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"REZ","$(TARGET_DIR)$@")
scripts/tracetool/backend/dtrace.py +6 -1
index 79505c6..1319990 100644
@@ -36,7 +36,12 @@ def binary():
 
 
 def generate_h_begin(events, group):
-    out('#include "trace/generated-tracers-dtrace.h"',
+    if group == "common":
+        include = "trace/generated-tracers-dtrace.h"
+    else:
+        include = "trace-dtrace.h"
+
+    out('#include "%s"' % include,
         '')
 
 
scripts/tracetool/backend/ust.py +6 -1
index 4594db6..599c12e 100644
@@ -20,8 +20,13 @@ PUBLIC = True
 
 
 def generate_h_begin(events, group):
+    if group == "common":
+        include = "trace/generated-ust-provider.h"
+    else:
+        include = "trace-ust.h"
+
     out('#include <lttng/tracepoint.h>',
-        '#include "trace/generated-ust-provider.h"',
+        '#include "%s"' % include,
         '')
 
 
scripts/tracetool/format/ust_events_c.py +1 -1
index cd87d8a..8be8116 100644
@@ -32,4 +32,4 @@ def generate(events, backend, group):
         ' */',
         '#pragma GCC diagnostic ignored "-Wredundant-decls"',
         '',
-        '#include "generated-ust-provider.h"')
+        '#include "generated-ust-provider-all.h"')
scripts/tracetool/format/ust_events_h.py +6 -1
index d853155..6fbdb9f 100644
@@ -20,13 +20,18 @@ def generate(events, backend, group):
     events = [e for e in events
               if "disabled" not in e.properties]
 
+    if group == "common":
+        include = "generated-ust-provider.h"
+    else:
+        include = "trace-ust.h"
+
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '',
         '#undef TRACEPOINT_PROVIDER',
         '#define TRACEPOINT_PROVIDER qemu',
         '',
         '#undef TRACEPOINT_INCLUDE_FILE',
-        '#define TRACEPOINT_INCLUDE_FILE ./generated-ust-provider.h',
+        '#define TRACEPOINT_INCLUDE_FILE ./%s' % include,
         '',
         '#if !defined (TRACE_%s_GENERATED_UST_H) || \\'  % group.upper(),
         '     defined(TRACEPOINT_HEADER_MULTI_READ)',
tests/Makefile.include +1 -1
index 4841d58..c255e65 100644
@@ -470,7 +470,7 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tests
 
 
 # Deps that are common to various different sets of tests below
-test-util-obj-y = libqemuutil.a libqemustub.a
+test-util-obj-y = $(trace-obj-y) libqemuutil.a libqemustub.a
 test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
 test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \
 	tests/test-qapi-event.o tests/test-qmp-introspect.o \
trace/Makefile.objs +17 -6
index 1e1ce74..4522914 100644
@@ -8,9 +8,12 @@
 tracetool-y = $(SRC_PATH)/scripts/tracetool.py
 tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
 
-$(BUILD_DIR)/trace-events-all: $(trace-events-y:%=$(SRC_PATH)/%)
+$(BUILD_DIR)/trace-events-all: $(trace-events-files:%=$(SRC_PATH)/%)
 	$(call quiet-command,cat $^ > $@)
 
+$(BUILD_DIR)/trace-events-common: $(trace-events-y:%=$(SRC_PATH)/%) Makefile.objs
+	$(call quiet-command,cat $(trace-events-y:%=$(SRC_PATH)/%) > $@)
+
 ######################################################################
 # Auto-generated event descriptions for LTTng ust code
 
@@ -18,7 +21,15 @@ ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
 
 $(obj)/generated-ust-provider.h: $(obj)/generated-ust-provider.h-timestamp
 	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-ust-provider.h-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
+$(obj)/generated-ust-provider.h-timestamp: $(BUILD_DIR)/trace-events-common $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=ust-events-h \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+
+$(obj)/generated-ust-provider-all.h: $(obj)/generated-ust-provider-all.h-timestamp
+	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
+$(obj)/generated-ust-provider-all.h-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
 	$(call quiet-command,$(TRACETOOL) \
 		--format=ust-events-h \
 		--backends=$(TRACE_BACKENDS) \
@@ -32,7 +43,7 @@ $(obj)/generated-ust.c-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
 		--backends=$(TRACE_BACKENDS) \
 		$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
 
-$(obj)/generated-tracers.h: $(obj)/generated-ust-provider.h
+$(obj)/generated-tracers.h: $(obj)/generated-ust-provider.h $(obj)/generated-ust-provider-all.h
 $(obj)/generated-tracers.c: $(obj)/generated-ust.c
 
 endif
@@ -46,7 +57,7 @@ endif
 
 $(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
 	@cmp -s $< $@ || cp $< $@
-$(obj)/generated-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
+$(obj)/generated-tracers.h-timestamp: $(BUILD_DIR)/trace-events-common $(BUILD_DIR)/config-host.mak $(tracetool-y)
 	$(call quiet-command,$(TRACETOOL) \
 		--format=h \
 		--backends=$(TRACE_BACKENDS) \
@@ -57,7 +68,7 @@ $(obj)/generated-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)
 
 $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
 	@cmp -s $< $@ || cp $< $@
-$(obj)/generated-tracers.c-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
+$(obj)/generated-tracers.c-timestamp: $(BUILD_DIR)/trace-events-common $(BUILD_DIR)/config-host.mak $(tracetool-y)
 	$(call quiet-command,$(TRACETOOL) \
 		--format=c \
 		--backends=$(TRACE_BACKENDS) \
@@ -75,7 +86,7 @@ ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
 
 $(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp
 	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
+$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(BUILD_DIR)/trace-events-common $(BUILD_DIR)/config-host.mak $(tracetool-y)
 	$(call quiet-command,$(TRACETOOL) \
 		--format=d \
 		--backends=$(TRACE_BACKENDS) \
Signature · 1 line
2.9.3
#28 lore raw

PATCH v2 3/47 trace: switch util/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the util/ directory to include the util/trace.h file instead of the global trace.h file.

---
 Makefile.objs              | 2 +-
 util/Makefile.objs         | 2 ++
 util/buffer.c              | 2 +-
 util/hbitmap.c             | 2 +-
 util/oslib-posix.c         | 2 +-
 util/oslib-win32.c         | 2 +-
 util/qemu-coroutine-lock.c | 2 +-
 util/qemu-coroutine.c      | 2 +-
 8 files changed, 9 insertions(+), 7 deletions(-)
Makefile.objs +1 -1
index c3f1e45..e8f060e 100644
@@ -120,7 +120,7 @@ ivshmem-server-obj-y = contrib/ivshmem-server/
 ######################################################################
 trace-events-subdirs =
 trace-events-y = trace-events
-trace-events-y += util/trace-events
+trace-events-subdirs += util
 trace-events-y += crypto/trace-events
 trace-events-subdirs += io
 trace-events-y += migration/trace-events
util/Makefile.objs +2 -0
index ad0f9c7..d196876 100644
@@ -36,3 +36,5 @@ util-obj-y += log.o
 util-obj-y += qdist.o
 util-obj-y += qht.o
 util-obj-y += range.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
util/buffer.c +1 -1
index d8bb874..f59aef9 100644
@@ -21,7 +21,7 @@
 #include "qemu/osdep.h"
 #include "qemu/host-utils.h"
 #include "qemu/buffer.h"
-#include "trace.h"
+#include "util/trace.h"
 
 #define BUFFER_MIN_INIT_SIZE     4096
 #define BUFFER_MIN_SHRINK_SIZE  65536
util/hbitmap.c +1 -1
index 9f691b7..32bb356 100644
@@ -12,7 +12,7 @@
 #include "qemu/osdep.h"
 #include "qemu/hbitmap.h"
 #include "qemu/host-utils.h"
-#include "trace.h"
+#include "util/trace.h"
 
 /* HBitmaps provides an array of bits.  The bits are stored as usual in an
  * array of unsigned longs, but HBitmap is also optimized to provide fast
util/oslib-posix.c +1 -1
index f631464..155309e 100644
@@ -32,7 +32,7 @@
 #include <glib/gprintf.h>
 
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "util/trace.h"
 #include "qapi/error.h"
 #include "qemu/sockets.h"
 #include <libgen.h>
util/oslib-win32.c +1 -1
index d09863c..6ae1681 100644
@@ -34,7 +34,7 @@
 #include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
-#include "trace.h"
+#include "util/trace.h"
 #include "qemu/sockets.h"
 #include "qemu/cutils.h"
 
util/qemu-coroutine-lock.c +1 -1
index 14cf9ce..9e24b66 100644
@@ -27,7 +27,7 @@
 #include "qemu/coroutine.h"
 #include "qemu/coroutine_int.h"
 #include "qemu/queue.h"
-#include "trace.h"
+#include "util/trace.h"
 
 void qemu_co_queue_init(CoQueue *queue)
 {
util/qemu-coroutine.c +1 -1
index 737bffa..8f67487 100644
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "util/trace.h"
 #include "qemu-common.h"
 #include "qemu/thread.h"
 #include "qemu/atomic.h"
Signature · 1 line
2.9.3
#29 lore raw

PATCH v2 4/47 trace: switch crypto/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the crypto/ directory to include the crypto/trace.h file instead of the global trace.h file.

---
 Makefile.objs         | 2 +-
 crypto/Makefile.objs  | 2 ++
 crypto/secret.c       | 2 +-
 crypto/tlscreds.c     | 2 +-
 crypto/tlscredsanon.c | 2 +-
 crypto/tlscredsx509.c | 2 +-
 crypto/tlssession.c   | 2 +-
 7 files changed, 8 insertions(+), 6 deletions(-)
Makefile.objs +1 -1
index e8f060e..735c4a9 100644
@@ -121,7 +121,7 @@ ivshmem-server-obj-y = contrib/ivshmem-server/
 trace-events-subdirs =
 trace-events-y = trace-events
 trace-events-subdirs += util
-trace-events-y += crypto/trace-events
+trace-events-subdirs += crypto
 trace-events-subdirs += io
 trace-events-y += migration/trace-events
 trace-events-y += block/trace-events
crypto/Makefile.objs +2 -0
index 1f749f2..3cd9da0 100644
@@ -30,6 +30,8 @@ crypto-obj-y += xts.o
 crypto-obj-y += block.o
 crypto-obj-y += block-qcow.o
 crypto-obj-y += block-luks.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 # Let the userspace emulators avoid linking gnutls/etc
 crypto-aes-obj-y = aes.o
crypto/secret.c +1 -1
index 285ab7a..b936615 100644
@@ -24,7 +24,7 @@
 #include "qapi/error.h"
 #include "qom/object_interfaces.h"
 #include "qemu/base64.h"
-#include "trace.h"
+#include "crypto/trace.h"
 
 
 static void
crypto/tlscreds.c +1 -1
index a896553..7e7f974 100644
@@ -21,7 +21,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "crypto/tlscredspriv.h"
-#include "trace.h"
+#include "crypto/trace.h"
 
 #define DH_BITS 2048
 
crypto/tlscredsanon.c +1 -1
index 1464220..c94c09b 100644
@@ -23,7 +23,7 @@
 #include "crypto/tlscredspriv.h"
 #include "qapi/error.h"
 #include "qom/object_interfaces.h"
-#include "trace.h"
+#include "crypto/trace.h"
 
 
 #ifdef CONFIG_GNUTLS
crypto/tlscredsx509.c +1 -1
index 50eb54f..2a4c3bc 100644
@@ -24,7 +24,7 @@
 #include "crypto/secret.h"
 #include "qapi/error.h"
 #include "qom/object_interfaces.h"
-#include "trace.h"
+#include "crypto/trace.h"
 
 
 #ifdef CONFIG_GNUTLS
crypto/tlssession.c +1 -1
index 96a02de..95a6bda 100644
@@ -24,7 +24,7 @@
 #include "crypto/tlscredsx509.h"
 #include "qapi/error.h"
 #include "qemu/acl.h"
-#include "trace.h"
+#include "crypto/trace.h"
 
 #ifdef CONFIG_GNUTLS
 
Signature · 1 line
2.9.3
#30 lore raw

PATCH v2 5/47 trace: switch migration/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the migration/ directory to include the migration/trace.h file instead of the global trace.h file.

---
 Makefile.objs            | 2 +-
 migration/Makefile.objs  | 2 ++
 migration/exec.c         | 2 +-
 migration/fd.c           | 2 +-
 migration/migration.c    | 2 +-
 migration/postcopy-ram.c | 2 +-
 migration/qemu-file.c    | 2 +-
 migration/ram.c          | 2 +-
 migration/rdma.c         | 2 +-
 migration/savevm.c       | 2 +-
 migration/socket.c       | 2 +-
 migration/tls.c          | 2 +-
 migration/vmstate.c      | 2 +-
 13 files changed, 14 insertions(+), 12 deletions(-)
Makefile.objs +1 -1
index 735c4a9..91878dd 100644
@@ -123,7 +123,7 @@ trace-events-y = trace-events
 trace-events-subdirs += util
 trace-events-subdirs += crypto
 trace-events-subdirs += io
-trace-events-y += migration/trace-events
+trace-events-subdirs += migration
 trace-events-y += block/trace-events
 trace-events-y += hw/block/trace-events
 trace-events-y += hw/char/trace-events
migration/Makefile.objs +2 -0
index 3f3e237..d0330f0 100644
@@ -12,3 +12,5 @@ common-obj-$(CONFIG_RDMA) += rdma.o
 
 common-obj-y += block.o
 
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
migration/exec.c +1 -1
index 9157721..f8f6ccf 100644
@@ -22,7 +22,7 @@
 #include "qemu-common.h"
 #include "migration/migration.h"
 #include "io/channel-command.h"
-#include "trace.h"
+#include "migration/trace.h"
 
 
 void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp)
migration/fd.c +1 -1
index 58cb51a..695373b 100644
@@ -20,7 +20,7 @@
 #include "migration/migration.h"
 #include "monitor/monitor.h"
 #include "io/channel-util.h"
-#include "trace.h"
+#include "migration/trace.h"
 
 
 void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **errp)
migration/migration.c +1 -1
index f498ab8..4bcf46d 100644
@@ -29,7 +29,7 @@
 #include "migration/postcopy-ram.h"
 #include "qemu/thread.h"
 #include "qmp-commands.h"
-#include "trace.h"
+#include "migration/trace.h"
 #include "qapi-event.h"
 #include "qom/cpu.h"
 #include "exec/memory.h"
migration/postcopy-ram.c +1 -1
index a40dddb..bf5ef8f 100644
@@ -24,7 +24,7 @@
 #include "sysemu/sysemu.h"
 #include "sysemu/balloon.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "migration/trace.h"
 
 /* Arbitrary limit on size of each discard command,
  * keeps them around ~200 bytes
migration/qemu-file.c +1 -1
index e9fae31..b2240cb 100644
@@ -30,7 +30,7 @@
 #include "qemu/coroutine.h"
 #include "migration/migration.h"
 #include "migration/qemu-file.h"
-#include "trace.h"
+#include "migration/trace.h"
 
 #define IO_BUF_SIZE 32768
 #define MAX_IOV_SIZE MIN(IOV_MAX, 64)
migration/ram.c +1 -1
index a1c8089..3c20acb 100644
@@ -40,7 +40,7 @@
 #include "exec/address-spaces.h"
 #include "migration/page_cache.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "migration/trace.h"
 #include "exec/ram_addr.h"
 #include "qemu/rcu_queue.h"
 #include "migration/colo.h"
migration/rdma.c +1 -1
index 674ccab..defc2f9 100644
@@ -29,7 +29,7 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 #include <rdma/rdma_cma.h>
-#include "trace.h"
+#include "migration/trace.h"
 
 /*
  * Print and error on both the Monitor and the Log file.
migration/savevm.c +1 -1
index 0363372..5b2f7bb 100644
@@ -46,7 +46,7 @@
 #include "sysemu/cpus.h"
 #include "exec/memory.h"
 #include "qmp-commands.h"
-#include "trace.h"
+#include "migration/trace.h"
 #include "qemu/bitops.h"
 #include "qemu/iov.h"
 #include "block/snapshot.h"
migration/socket.c +1 -1
index 11f80b1..be70428 100644
@@ -22,7 +22,7 @@
 #include "migration/migration.h"
 #include "migration/qemu-file.h"
 #include "io/channel-socket.h"
-#include "trace.h"
+#include "migration/trace.h"
 
 
 static SocketAddress *tcp_build_address(const char *host_port, Error **errp)
migration/tls.c +1 -1
index 49ca9a8..3f2d094 100644
@@ -24,7 +24,7 @@
 #include "crypto/tlscreds.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
-#include "trace.h"
+#include "migration/trace.h"
 
 static QCryptoTLSCreds *
 migration_tls_get_creds(MigrationState *s,
migration/vmstate.c +1 -1
index 0bc9f35..737fcb6 100644
@@ -5,7 +5,7 @@
 #include "migration/vmstate.h"
 #include "qemu/bitops.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "migration/trace.h"
 
 static void vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,
                                     void *opaque, QJSON *vmdesc);
Signature · 1 line
2.9.3
#31 lore raw

PATCH v2 6/47 trace: switch block/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the block/ directory to include the block/trace.h file instead of the global trace.h file.

---
 Makefile.objs         | 2 +-
 block.c               | 2 +-
 block/Makefile.objs   | 2 ++
 block/backup.c        | 2 +-
 block/block-backend.c | 2 +-
 block/commit.c        | 2 +-
 block/dirty-bitmap.c  | 2 +-
 block/io.c            | 2 +-
 block/mirror.c        | 2 +-
 block/nfs.c           | 2 +-
 block/qcow2-cache.c   | 2 +-
 block/qcow2-cluster.c | 2 +-
 block/qcow2.c         | 2 +-
 block/qed-l2-cache.c  | 2 +-
 block/qed-table.c     | 2 +-
 block/qed.c           | 2 +-
 block/raw-posix.c     | 2 +-
 block/raw-win32.c     | 2 +-
 block/stream.c        | 2 +-
 blockdev.c            | 2 +-
 20 files changed, 21 insertions(+), 19 deletions(-)
Makefile.objs +1 -1
index 91878dd..8a6dfad 100644
@@ -124,7 +124,7 @@ trace-events-subdirs += util
 trace-events-subdirs += crypto
 trace-events-subdirs += io
 trace-events-subdirs += migration
-trace-events-y += block/trace-events
+trace-events-subdirs += block
 trace-events-y += hw/block/trace-events
 trace-events-y += hw/char/trace-events
 trace-events-y += hw/intc/trace-events
block.c +1 -1
index 39ddea3..19b68f8 100644
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
 #include "block/nbd.h"
block/Makefile.objs +2 -0
index 67a036a..9f03d26 100644
@@ -26,6 +26,8 @@ block-obj-y += backup.o
 block-obj-$(CONFIG_REPLICATION) += replication.o
 
 block-obj-y += crypto.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 common-obj-y += stream.o
 
block/backup.c +1 -1
index ea38733..9a1530d 100644
@@ -13,7 +13,7 @@
 
 #include "qemu/osdep.h"
 
-#include "trace.h"
+#include "block/trace.h"
 #include "block/block.h"
 #include "block/block_int.h"
 #include "block/blockjob_int.h"
block/block-backend.c +1 -1
index efbf398..3e2b096 100644
@@ -19,7 +19,7 @@
 #include "sysemu/sysemu.h"
 #include "qapi-event.h"
 #include "qemu/id.h"
-#include "trace.h"
+#include "block/trace.h"
 
 /* Number of coroutines to reserve per attached device model */
 #define COROUTINE_POOL_RESERVATION 64
block/commit.c +1 -1
index c284e85..3eb2e6c 100644
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/block_int.h"
 #include "block/blockjob_int.h"
 #include "qapi/error.h"
block/dirty-bitmap.c +1 -1
index 519737c..e4405ff 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
 
block/io.c +1 -1
index 4f00562..70e1941 100644
@@ -23,7 +23,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "sysemu/block-backend.h"
 #include "block/blockjob.h"
 #include "block/block_int.h"
block/mirror.c +1 -1
index 301ba92..5df7232 100644
@@ -12,7 +12,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/blockjob_int.h"
 #include "block/block_int.h"
 #include "sysemu/block-backend.h"
block/nfs.c +1 -1
index a564340..9399f4a 100644
@@ -30,7 +30,7 @@
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "block/block_int.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "qemu/iov.h"
 #include "qemu/uri.h"
 #include "qemu/cutils.h"
block/qcow2-cache.c +1 -1
index 1d25147..104fb16 100644
@@ -26,7 +26,7 @@
 #include "block/block_int.h"
 #include "qemu-common.h"
 #include "qcow2.h"
-#include "trace.h"
+#include "block/trace.h"
 
 typedef struct Qcow2CachedTable {
     int64_t  offset;
block/qcow2-cluster.c +1 -1
index 928c1e2..67e8f23 100644
@@ -30,7 +30,7 @@
 #include "block/block_int.h"
 #include "block/qcow2.h"
 #include "qemu/bswap.h"
-#include "trace.h"
+#include "block/trace.h"
 
 int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
                         bool exact_size)
block/qcow2.c +1 -1
index 96fb8a8..b9f72b4 100644
@@ -33,7 +33,7 @@
 #include "qapi/util.h"
 #include "qapi/qmp/types.h"
 #include "qapi-event.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "qemu/option_int.h"
 #include "qemu/cutils.h"
 #include "qemu/bswap.h"
block/qed-l2-cache.c +1 -1
index 5cba794..b413753 100644
@@ -51,7 +51,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "qed.h"
 
 /* Each L2 holds 2GB so this let's us fully cache a 100GB disk */
block/qed-table.c +1 -1
index ed443e2..eb173d6 100644
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "qemu/sockets.h" /* for EINPROGRESS on Windows */
 #include "qed.h"
 #include "qemu/bswap.h"
block/qed.c +1 -1
index 1a7ef0a..91ec33c 100644
@@ -16,7 +16,7 @@
 #include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qemu/bswap.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "qed.h"
 #include "qapi/qmp/qerror.h"
 #include "migration/migration.h"
block/raw-posix.c +1 -1
index 28b47d9..1145465 100644
@@ -29,7 +29,7 @@
 #include "qemu/log.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/thread-pool.h"
 #include "qemu/iov.h"
 #include "block/raw-aio.h"
block/raw-win32.c +1 -1
index 800fabd..096ca54 100644
@@ -28,7 +28,7 @@
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "block/raw-aio.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/thread-pool.h"
 #include "qemu/iov.h"
 #include "qapi/qmp/qstring.h"
block/stream.c +1 -1
index 1523ba7..b82bd23 100644
@@ -12,7 +12,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/block_int.h"
 #include "block/blockjob_int.h"
 #include "qapi/error.h"
blockdev.c +1 -1
index 245e1e1..db82ac9 100644
@@ -48,7 +48,7 @@
 #include "sysemu/sysemu.h"
 #include "block/block_int.h"
 #include "qmp-commands.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "sysemu/arch_init.h"
 #include "qemu/cutils.h"
 #include "qemu/help_option.h"
Signature · 1 line
2.9.3
#32 lore raw

PATCH v2 7/47 trace: switch hw/block/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/block/ directory to include the hw/block/trace.h file instead of the global trace.h file.

---
 Makefile.objs                   | 2 +-
 hw/block/Makefile.objs          | 2 ++
 hw/block/dataplane/virtio-blk.c | 2 +-
 hw/block/hd-geometry.c          | 2 +-
 hw/block/virtio-blk.c           | 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)
Makefile.objs +1 -1
index 8a6dfad..90979b0 100644
@@ -125,7 +125,7 @@ trace-events-subdirs += crypto
 trace-events-subdirs += io
 trace-events-subdirs += migration
 trace-events-subdirs += block
-trace-events-y += hw/block/trace-events
+trace-events-subdirs += hw/block
 trace-events-y += hw/char/trace-events
 trace-events-y += hw/intc/trace-events
 trace-events-y += hw/net/trace-events
hw/block/Makefile.objs +2 -0
index d4c3ab7..a2f523d 100644
@@ -8,6 +8,8 @@ common-obj-$(CONFIG_XEN_BACKEND) += xen_disk.o
 common-obj-$(CONFIG_ECC) += ecc.o
 common-obj-$(CONFIG_ONENAND) += onenand.o
 common-obj-$(CONFIG_NVME_PCI) += nvme.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 obj-$(CONFIG_SH4) += tc58128.o
 
hw/block/dataplane/virtio-blk.c +1 -1
index d1f9f63..70991f9 100644
@@ -14,7 +14,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "trace.h"
+#include "hw/block/trace.h"
 #include "qemu/iov.h"
 #include "qemu/thread.h"
 #include "qemu/error-report.h"
hw/block/hd-geometry.c +1 -1
index 57ad501..5d3691a 100644
@@ -34,7 +34,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/bswap.h"
 #include "hw/block/block.h"
-#include "trace.h"
+#include "hw/block/trace.h"
 
 struct partition {
         uint8_t boot_ind;           /* 0x80 - active */
hw/block/virtio-blk.c +1 -1
index 50bb0cb..69e9e2b 100644
@@ -16,7 +16,7 @@
 #include "qemu-common.h"
 #include "qemu/iov.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "hw/block/trace.h"
 #include "hw/block/block.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
Signature · 1 line
2.9.3
#33 lore raw

PATCH v2 8/47 trace: switch hw/char/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/char/ directory to include the hw/char/trace.h file instead of the global trace.h file.

---
 Makefile.objs               | 2 +-
 hw/char/Makefile.objs       | 2 ++
 hw/char/escc.c              | 2 +-
 hw/char/grlib_apbuart.c     | 2 +-
 hw/char/lm32_juart.c        | 2 +-
 hw/char/lm32_uart.c         | 2 +-
 hw/char/milkymist-uart.c    | 2 +-
 hw/char/virtio-console.c    | 2 +-
 hw/char/virtio-serial-bus.c | 2 +-
 9 files changed, 10 insertions(+), 8 deletions(-)
Makefile.objs +1 -1
index 90979b0..6cbee00 100644
@@ -126,7 +126,7 @@ trace-events-subdirs += io
 trace-events-subdirs += migration
 trace-events-subdirs += block
 trace-events-subdirs += hw/block
-trace-events-y += hw/char/trace-events
+trace-events-subdirs += hw/char
 trace-events-y += hw/intc/trace-events
 trace-events-y += hw/net/trace-events
 trace-events-y += hw/virtio/trace-events
hw/char/Makefile.objs +2 -0
index 69a553c..13db97f 100644
@@ -26,5 +26,7 @@ common-obj-$(CONFIG_LM32) += lm32_juart.o
 common-obj-$(CONFIG_LM32) += lm32_uart.o
 common-obj-$(CONFIG_MILKYMIST) += milkymist-uart.o
 common-obj-$(CONFIG_SCLPCONSOLE) += sclpconsole.o sclpconsole-lm.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o
hw/char/escc.c +1 -1
index d6662dc..c3b203f 100644
@@ -29,7 +29,7 @@
 #include "sysemu/char.h"
 #include "ui/console.h"
 #include "ui/input.h"
-#include "trace.h"
+#include "hw/char/trace.h"
 
 /*
  * Chipset docs:
hw/char/grlib_apbuart.c +1 -1
index db686e6..6a1f253 100644
@@ -26,7 +26,7 @@
 #include "hw/sysbus.h"
 #include "sysemu/char.h"
 
-#include "trace.h"
+#include "hw/char/trace.h"
 
 #define UART_REG_SIZE 20     /* Size of memory mapped registers */
 
hw/char/lm32_juart.c +1 -1
index f8c1e0d..ec60f66 100644
@@ -20,7 +20,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/char/trace.h"
 #include "sysemu/char.h"
 
 #include "hw/char/lm32_juart.h"
hw/char/lm32_uart.c +1 -1
index 7f3597c..9304715 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/char/trace.h"
 #include "sysemu/char.h"
 #include "qemu/error-report.h"
 
hw/char/milkymist-uart.c +1 -1
index ae8e2f3..b13504f 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/char/trace.h"
 #include "sysemu/char.h"
 #include "qemu/error-report.h"
 
hw/char/virtio-console.c +1 -1
index 776205b..4267861 100644
@@ -13,7 +13,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/char.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "hw/char/trace.h"
 #include "hw/virtio/virtio-serial.h"
 #include "qapi-event.h"
 
hw/char/virtio-serial-bus.c +1 -1
index 7975c2c..bd6396f 100644
@@ -25,7 +25,7 @@
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/char/trace.h"
 #include "hw/virtio/virtio-serial.h"
 #include "hw/virtio/virtio-access.h"
 
Signature · 1 line
2.9.3
#34 lore raw

PATCH v2 9/47 trace: switch hw/intc/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/intc/ directory to include the hw/intc/trace.h file instead of the global trace.h file.

---
 Makefile.objs              | 2 +-
 hw/intc/Makefile.objs      | 2 ++
 hw/intc/apic.c             | 2 +-
 hw/intc/apic_common.c      | 2 +-
 hw/intc/arm_gic.c          | 2 +-
 hw/intc/arm_gicv3_cpuif.c  | 2 +-
 hw/intc/arm_gicv3_dist.c   | 2 +-
 hw/intc/arm_gicv3_redist.c | 2 +-
 hw/intc/aspeed_vic.c       | 2 +-
 hw/intc/grlib_irqmp.c      | 2 +-
 hw/intc/lm32_pic.c         | 2 +-
 hw/intc/s390_flic.c        | 2 +-
 hw/intc/s390_flic_kvm.c    | 2 +-
 hw/intc/slavio_intctl.c    | 2 +-
 hw/intc/xics.c             | 2 +-
 hw/intc/xics_kvm.c         | 2 +-
 hw/intc/xics_spapr.c       | 2 +-
 17 files changed, 18 insertions(+), 16 deletions(-)
Makefile.objs +1 -1
index 6cbee00..6d30b53 100644
@@ -127,7 +127,7 @@ trace-events-subdirs += migration
 trace-events-subdirs += block
 trace-events-subdirs += hw/block
 trace-events-subdirs += hw/char
-trace-events-y += hw/intc/trace-events
+trace-events-subdirs += hw/intc
 trace-events-y += hw/net/trace-events
 trace-events-y += hw/virtio/trace-events
 trace-events-y += hw/audio/trace-events
hw/intc/Makefile.objs +2 -0
index 2f44a2d..f718d66 100644
@@ -19,6 +19,8 @@ common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_redist.o
 common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_its_common.o
 common-obj-$(CONFIG_OPENPIC) += openpic.o
 common-obj-y += intc.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 obj-$(CONFIG_APIC) += apic.o apic_common.o
 obj-$(CONFIG_ARM_GIC_KVM) += arm_gic_kvm.o
hw/intc/apic.c +1 -1
index fe15fb6..1b2ed92 100644
@@ -25,7 +25,7 @@
 #include "hw/i386/ioapic.h"
 #include "hw/pci/msi.h"
 #include "qemu/host-utils.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "hw/i386/pc.h"
 #include "hw/i386/apic-msidef.h"
 #include "qapi/error.h"
hw/intc/apic_common.c +1 -1
index d78c885..000bc7c 100644
@@ -25,7 +25,7 @@
 #include "qapi/visitor.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/apic_internal.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "sysemu/kvm.h"
 #include "hw/qdev.h"
 #include "hw/sysbus.h"
hw/intc/arm_gic.c +1 -1
index 521aac3..206f098 100644
@@ -24,7 +24,7 @@
 #include "qapi/error.h"
 #include "qom/cpu.h"
 #include "qemu/log.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 
 //#define DEBUG_GIC
 
hw/intc/arm_gicv3_cpuif.c +1 -1
index 35e8eb3..d82e4c9 100644
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "gicv3_internal.h"
 #include "cpu.h"
 
hw/intc/arm_gicv3_dist.c +1 -1
index 3ea3dd0..dc405e9 100644
@@ -11,7 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/log.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "gicv3_internal.h"
 
 /* The GICD_NSACR registers contain a two bit field for each interrupt which
hw/intc/arm_gicv3_redist.c +1 -1
index 77e5cfa..f1a6b08 100644
@@ -11,7 +11,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/log.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "gicv3_internal.h"
 
 static uint32_t mask_group(GICv3CPUState *cs, MemTxAttrs attrs)
hw/intc/aspeed_vic.c +1 -1
index 2370e74..c152d78 100644
@@ -31,7 +31,7 @@
 #include "hw/intc/aspeed_vic.h"
 #include "qemu/bitops.h"
 #include "qemu/log.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 
 #define AVIC_NEW_BASE_OFFSET 0x80
 
hw/intc/grlib_irqmp.c +1 -1
index ac7e63f..26c89af 100644
@@ -30,7 +30,7 @@
 
 #include "hw/sparc/grlib.h"
 
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "qapi/error.h"
 
 #define IRQMP_MAX_CPU 16
hw/intc/lm32_pic.c +1 -1
index 09e1511..68dfb76 100644
@@ -23,7 +23,7 @@
 #include "hw/i386/pc.h"
 #include "monitor/monitor.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "hw/lm32/lm32_pic.h"
 #include "hw/intc/intc.h"
 
hw/intc/s390_flic.c +1 -1
index 6ab29ef..44d3ea4 100644
@@ -15,7 +15,7 @@
 #include "hw/sysbus.h"
 #include "migration/qemu-file.h"
 #include "hw/s390x/s390_flic.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 
 S390FLICState *s390_get_flic(void)
 {
hw/intc/s390_flic_kvm.c +1 -1
index 21ac2e2..3ac885a 100644
@@ -20,7 +20,7 @@
 #include "migration/qemu-file.h"
 #include "hw/s390x/s390_flic.h"
 #include "hw/s390x/adapter.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 
 #define FLIC_SAVE_INITIAL_SIZE getpagesize()
 #define FLIC_FAILED (-1UL)
hw/intc/slavio_intctl.c +1 -1
index 84e0bee..7ad8c80 100644
@@ -27,7 +27,7 @@
 #include "monitor/monitor.h"
 #include "hw/sysbus.h"
 #include "hw/intc/intc.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 
 //#define DEBUG_IRQ_COUNT
 
hw/intc/xics.c +1 -1
index 095c16a..250b381 100644
@@ -30,7 +30,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "qemu/timer.h"
 #include "hw/ppc/xics.h"
 #include "qemu/error-report.h"
hw/intc/xics_kvm.c +1 -1
index 17694ea..d3f0341 100644
@@ -30,7 +30,7 @@
 #include "qemu-common.h"
 #include "cpu.h"
 #include "hw/hw.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "sysemu/kvm.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/xics.h"
hw/intc/xics_spapr.c +1 -1
index 2e3f1c5..b953eee 100644
@@ -28,7 +28,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "hw/hw.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "qemu/timer.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/xics.h"
Signature · 1 line
2.9.3
#35 lore raw

PATCH v2 10/47 trace: switch hw/net/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/net/ directory to include the hw/net/trace.h file instead of the global trace.h file.

---
 Makefile.objs               | 2 +-
 hw/net/Makefile.objs        | 3 +++
 hw/net/e1000e.c             | 2 +-
 hw/net/e1000e_core.c        | 2 +-
 hw/net/e1000x_common.c      | 2 +-
 hw/net/lance.c              | 2 +-
 hw/net/milkymist-minimac2.c | 2 +-
 hw/net/mipsnet.c            | 2 +-
 hw/net/net_rx_pkt.c         | 2 +-
 hw/net/opencores_eth.c      | 2 +-
 hw/net/pcnet-pci.c          | 2 +-
 hw/net/pcnet.c              | 2 +-
 12 files changed, 14 insertions(+), 11 deletions(-)
Makefile.objs +1 -1
index 6d30b53..9c0aefa 100644
@@ -128,7 +128,7 @@ trace-events-subdirs += block
 trace-events-subdirs += hw/block
 trace-events-subdirs += hw/char
 trace-events-subdirs += hw/intc
-trace-events-y += hw/net/trace-events
+trace-events-subdirs += hw/net
 trace-events-y += hw/virtio/trace-events
 trace-events-y += hw/audio/trace-events
 trace-events-y += hw/misc/trace-events
hw/net/Makefile.objs +3 -0
index 610ed3e..da244c2 100644
@@ -43,3 +43,6 @@ common-obj-$(CONFIG_ROCKER) += rocker/rocker.o rocker/rocker_fp.o \
                                rocker/rocker_desc.o rocker/rocker_world.o \
                                rocker/rocker_of_dpa.o
 obj-$(call lnot,$(CONFIG_ROCKER)) += rocker/qmp-norocker.o
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/net/e1000e.c +1 -1
index 4994e1c..9e68bdb 100644
@@ -46,7 +46,7 @@
 #include "e1000x_common.h"
 #include "e1000e_core.h"
 
-#include "trace.h"
+#include "hw/net/trace.h"
 
 #define TYPE_E1000E "e1000e"
 #define E1000E(obj) OBJECT_CHECK(E1000EState, (obj), TYPE_E1000E)
hw/net/e1000e_core.c +1 -1
index 2b11499..4304b6a 100644
@@ -46,7 +46,7 @@
 #include "e1000x_common.h"
 #include "e1000e_core.h"
 
-#include "trace.h"
+#include "hw/net/trace.h"
 
 #define E1000E_MIN_XITR     (500) /* No more then 7813 interrupts per
                                      second according to spec 10.2.4.2 */
hw/net/e1000x_common.c +1 -1
index eb0e097..7b6cfa8 100644
@@ -29,7 +29,7 @@
 
 #include "e1000x_common.h"
 
-#include "trace.h"
+#include "hw/net/trace.h"
 
 bool e1000x_rx_ready(PCIDevice *d, uint32_t *mac)
 {
hw/net/lance.c +1 -1
index 573d724..6e36f9f 100644
@@ -42,7 +42,7 @@
 #include "qemu/sockets.h"
 #include "hw/sparc/sun4m.h"
 #include "pcnet.h"
-#include "trace.h"
+#include "hw/net/trace.h"
 #include "sysemu/sysemu.h"
 
 #define TYPE_LANCE "lance"
hw/net/milkymist-minimac2.c +1 -1
index c3a12e1..0a0d43f 100644
@@ -28,7 +28,7 @@
 #include "cpu.h" /* FIXME: why does this use TARGET_PAGE_ALIGN? */
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/net/trace.h"
 #include "net/net.h"
 #include "qemu/error-report.h"
 
hw/net/mipsnet.c +1 -1
index 5a63df7..5f8fd6a 100644
@@ -1,7 +1,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "net/net.h"
-#include "trace.h"
+#include "hw/net/trace.h"
 #include "hw/sysbus.h"
 
 /* MIPSnet register offsets */
hw/net/net_rx_pkt.c +1 -1
index 1019b50..9ec6e61 100644
@@ -16,7 +16,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "hw/net/trace.h"
 #include "net_rx_pkt.h"
 #include "net/checksum.h"
 #include "net/tap.h"
hw/net/opencores_eth.c +1 -1
index 268d6a7..2a38c05 100644
@@ -37,7 +37,7 @@
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/net/trace.h"
 
 /* RECSMALL is not used because it breaks tap networking in linux:
  * incoming ARP responses are too short
hw/net/pcnet-pci.c +1 -1
index 0acf8a4..6cfc121 100644
@@ -34,7 +34,7 @@
 #include "qemu/timer.h"
 #include "sysemu/dma.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/net/trace.h"
 
 #include "pcnet.h"
 
hw/net/pcnet.c +1 -1
index 6544553..edba914 100644
@@ -41,7 +41,7 @@
 #include "qemu/timer.h"
 #include "qemu/sockets.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/net/trace.h"
 
 #include "pcnet.h"
 
Signature · 1 line
2.9.3
#36 lore raw

PATCH v2 11/47 trace: switch hw/virtio/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/virtio/ directory to include the hw/virtio/trace.h file instead of the global trace.h file.

---
 Makefile.objs              | 2 +-
 hw/virtio/Makefile.objs    | 2 ++
 hw/virtio/virtio-balloon.c | 2 +-
 hw/virtio/virtio-rng.c     | 2 +-
 hw/virtio/virtio.c         | 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)
Makefile.objs +1 -1
index 9c0aefa..f5ecfbf 100644
@@ -129,7 +129,7 @@ trace-events-subdirs += hw/block
 trace-events-subdirs += hw/char
 trace-events-subdirs += hw/intc
 trace-events-subdirs += hw/net
-trace-events-y += hw/virtio/trace-events
+trace-events-subdirs += hw/virtio
 trace-events-y += hw/audio/trace-events
 trace-events-y += hw/misc/trace-events
 trace-events-y += hw/usb/trace-events
hw/virtio/Makefile.objs +2 -0
index 95c4c30..9e5a3a4 100644
@@ -2,6 +2,8 @@ common-obj-y += virtio-rng.o
 common-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
 common-obj-y += virtio-bus.o
 common-obj-y += virtio-mmio.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 obj-y += virtio.o virtio-balloon.o 
 obj-$(CONFIG_LINUX) += vhost.o vhost-backend.o vhost-user.o
hw/virtio/virtio-balloon.c +1 -1
index 884570a..ee6fccd 100644
@@ -25,7 +25,7 @@
 #include "exec/address-spaces.h"
 #include "qapi/visitor.h"
 #include "qapi-event.h"
-#include "trace.h"
+#include "hw/virtio/trace.h"
 
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
hw/virtio/virtio-rng.c +1 -1
index 9639f4e..c19b186 100644
@@ -17,7 +17,7 @@
 #include "hw/virtio/virtio-rng.h"
 #include "sysemu/rng.h"
 #include "qom/object_interfaces.h"
-#include "trace.h"
+#include "hw/virtio/trace.h"
 
 static bool is_guest_ready(VirtIORNG *vrng)
 {
hw/virtio/virtio.c +1 -1
index d40711a..f7502c2 100644
@@ -15,7 +15,7 @@
 #include "qapi/error.h"
 #include "qemu-common.h"
 #include "cpu.h"
-#include "trace.h"
+#include "hw/virtio/trace.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
 #include "hw/virtio/virtio.h"
Signature · 1 line
2.9.3
#37 lore raw

PATCH v2 12/47 trace: switch hw/audio/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/audio/ directory to include the hw/audio/trace.h file instead of the global trace.h file.

---
 Makefile.objs             | 2 +-
 hw/audio/Makefile.objs    | 3 +++
 hw/audio/cs4231.c         | 2 +-
 hw/audio/milkymist-ac97.c | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index f5ecfbf..41ab795 100644
@@ -130,7 +130,7 @@ trace-events-subdirs += hw/char
 trace-events-subdirs += hw/intc
 trace-events-subdirs += hw/net
 trace-events-subdirs += hw/virtio
-trace-events-y += hw/audio/trace-events
+trace-events-subdirs += hw/audio
 trace-events-y += hw/misc/trace-events
 trace-events-y += hw/usb/trace-events
 trace-events-y += hw/scsi/trace-events
hw/audio/Makefile.objs +3 -0
index 7ce85a2..d779550 100644
@@ -16,3 +16,6 @@ common-obj-$(CONFIG_MARVELL_88W8618) += marvell_88w8618.o
 common-obj-$(CONFIG_MILKYMIST) += milkymist-ac97.o
 
 $(obj)/adlib.o $(obj)/fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/audio/cs4231.c +1 -1
index 30690f9..8c7eb1e 100644
@@ -24,7 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/audio/trace.h"
 
 /*
  * In addition to Crystal CS4231 there is a DMA controller on Sparc.
hw/audio/milkymist-ac97.c +1 -1
index bc8db71..fd994b4 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/audio/trace.h"
 #include "audio/audio.h"
 #include "qemu/error-report.h"
 
Signature · 1 line
2.9.3
#38 lore raw

PATCH v2 13/47 trace: switch hw/misc/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/misc/ directory to include the hw/misc/trace.h file instead of the global trace.h file.

---
 Makefile.objs             | 2 +-
 hw/misc/Makefile.objs     | 3 +++
 hw/misc/aspeed_scu.c      | 2 +-
 hw/misc/eccmemctl.c       | 2 +-
 hw/misc/milkymist-hpdmc.c | 2 +-
 hw/misc/milkymist-pfpu.c  | 2 +-
 hw/misc/slavio_misc.c     | 2 +-
 7 files changed, 9 insertions(+), 6 deletions(-)
Makefile.objs +1 -1
index 41ab795..85c412a 100644
@@ -131,7 +131,7 @@ trace-events-subdirs += hw/intc
 trace-events-subdirs += hw/net
 trace-events-subdirs += hw/virtio
 trace-events-subdirs += hw/audio
-trace-events-y += hw/misc/trace-events
+trace-events-subdirs += hw/misc
 trace-events-y += hw/usb/trace-events
 trace-events-y += hw/scsi/trace-events
 trace-events-y += hw/nvram/trace-events
hw/misc/Makefile.objs +3 -0
index 1a89615..ccee974 100644
@@ -53,3 +53,6 @@ obj-$(CONFIG_EDU) += edu.o
 obj-$(CONFIG_HYPERV_TESTDEV) += hyperv_testdev.o
 obj-$(CONFIG_AUX) += auxbus.o
 obj-$(CONFIG_ASPEED_SOC) += aspeed_scu.o aspeed_sdmc.o
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/misc/aspeed_scu.c +1 -1
index 95022d3..36f50d1 100644
@@ -16,7 +16,7 @@
 #include "qapi/visitor.h"
 #include "qemu/bitops.h"
 #include "qemu/log.h"
-#include "trace.h"
+#include "hw/misc/trace.h"
 
 #define TO_REG(offset) ((offset) >> 2)
 
hw/misc/eccmemctl.c +1 -1
index a0071f3..a0424f9 100644
@@ -24,7 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/misc/trace.h"
 
 /* There are 3 versions of this chip used in SMP sun4m systems:
  * MCC (version 0, implementation 0) SS-600MP
hw/misc/milkymist-hpdmc.c +1 -1
index e6140ee..8596437 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/misc/trace.h"
 #include "qemu/error-report.h"
 
 enum {
hw/misc/milkymist-pfpu.c +1 -1
index 3ca2589..7921ab6 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/misc/trace.h"
 #include "qemu/log.h"
 #include "qemu/error-report.h"
 #include <math.h>
hw/misc/slavio_misc.c +1 -1
index edd5de0..a4820c5 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/misc/trace.h"
 
 /*
  * This is the auxio port, chip control and system control part of
Signature · 1 line
2.9.3
#39 lore raw

PATCH v2 14/47 trace: switch hw/usb/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/usb/ directory to include the hw/usb/trace.h file instead of the global trace.h file.

---
 Makefile.objs            | 2 +-
 hw/usb/Makefile.objs     | 3 +++
 hw/usb/bus.c             | 2 +-
 hw/usb/combined-packet.c | 2 +-
 hw/usb/core.c            | 2 +-
 hw/usb/desc.c            | 2 +-
 hw/usb/dev-hub.c         | 2 +-
 hw/usb/dev-mtp.c         | 2 +-
 hw/usb/dev-uas.c         | 2 +-
 hw/usb/hcd-ehci.c        | 2 +-
 hw/usb/hcd-ohci.c        | 2 +-
 hw/usb/hcd-uhci.c        | 2 +-
 hw/usb/hcd-xhci.c        | 2 +-
 hw/usb/host-libusb.c     | 2 +-
 14 files changed, 16 insertions(+), 13 deletions(-)
Makefile.objs +1 -1
index 85c412a..a71e25b 100644
@@ -132,7 +132,7 @@ trace-events-subdirs += hw/net
 trace-events-subdirs += hw/virtio
 trace-events-subdirs += hw/audio
 trace-events-subdirs += hw/misc
-trace-events-y += hw/usb/trace-events
+trace-events-subdirs += hw/usb
 trace-events-y += hw/scsi/trace-events
 trace-events-y += hw/nvram/trace-events
 trace-events-y += hw/display/trace-events
hw/usb/Makefile.objs +3 -0
index 98b5c9d..c7b85c4 100644
@@ -42,3 +42,6 @@ common-obj-y += $(patsubst %,host-%.o,$(HOST_USB))
 ifeq ($(CONFIG_USB_LIBUSB),y)
 common-obj-$(CONFIG_XEN_BACKEND) += xen-usb.o
 endif
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/usb/bus.c +1 -1
index 25913ad..e41cf29 100644
@@ -6,7 +6,7 @@
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
 #include "monitor/monitor.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 #include "qemu/cutils.h"
 
 static void usb_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent);
hw/usb/combined-packet.c +1 -1
index 48cac87..fb5b87f 100644
@@ -23,7 +23,7 @@
 #include "qemu-common.h"
 #include "hw/usb.h"
 #include "qemu/iov.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 
 static void usb_combined_packet_add(USBCombinedPacket *combined, USBPacket *p)
 {
hw/usb/core.c +1 -1
index 45fa00c..68668c3 100644
@@ -27,7 +27,7 @@
 #include "qemu-common.h"
 #include "hw/usb.h"
 #include "qemu/iov.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 
 void usb_pick_speed(USBPort *port)
 {
hw/usb/desc.c +1 -1
index 7828e52..64341c6 100644
@@ -2,7 +2,7 @@
 
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 
 /* ------------------------------------------------------------------ */
 
hw/usb/dev-hub.c +1 -1
index a33f21c..5359688 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
 #include "qemu/error-report.h"
hw/usb/dev-mtp.c +1 -1
index 9cb0f50..d11f0fc 100644
@@ -22,7 +22,7 @@
 
 #include "qemu-common.h"
 #include "qemu/iov.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
 
hw/usb/dev-uas.c +1 -1
index 3a8ff18..46efc5a 100644
@@ -13,7 +13,7 @@
 #include "qemu-common.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 #include "qemu/error-report.h"
 
 #include "hw/usb.h"
hw/usb/hcd-ehci.c +1 -1
index 7622a3a..67c17c9 100644
@@ -31,7 +31,7 @@
 #include "qapi/error.h"
 #include "hw/usb/ehci-regs.h"
 #include "hw/usb/hcd-ehci.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 
 #define FRAME_TIMER_FREQ 1000
 #define FRAME_TIMER_NS   (NANOSECONDS_PER_SECOND / FRAME_TIMER_FREQ)
hw/usb/hcd-ohci.c +1 -1
index c82a92f..864b711 100644
@@ -33,7 +33,7 @@
 #include "hw/pci/pci.h"
 #include "hw/sysbus.h"
 #include "hw/qdev-dma.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 
 /* This causes frames to occur 1000x slower */
 //#define OHCI_TIME_WARP 1
hw/usb/hcd-uhci.c +1 -1
index ca72a80..ee7de68 100644
@@ -34,7 +34,7 @@
 #include "qemu/timer.h"
 #include "qemu/iov.h"
 #include "sysemu/dma.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 #include "qemu/main-loop.h"
 
 #define FRAME_TIMER_FREQ 1000
hw/usb/hcd-xhci.c +1 -1
index 4acf0c6..671e2b2 100644
@@ -26,7 +26,7 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 #include "qapi/error.h"
 
 //#define DEBUG_XHCI
hw/usb/host-libusb.c +1 -1
index bd81d71..131fbb3 100644
@@ -44,7 +44,7 @@
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 
 #include "hw/usb.h"
 
Signature · 1 line
2.9.3
#40 lore raw

PATCH v2 15/47 trace: switch hw/scsi/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/scsi/ directory to include the hw/scsi/trace.h file instead of the global trace.h file.

---
 Makefile.objs         | 2 +-
 hw/scsi/Makefile.objs | 3 +++
 hw/scsi/esp-pci.c     | 2 +-
 hw/scsi/esp.c         | 2 +-
 hw/scsi/megasas.c     | 2 +-
 hw/scsi/mptconfig.c   | 2 +-
 hw/scsi/mptendian.c   | 2 +-
 hw/scsi/mptsas.c      | 2 +-
 hw/scsi/scsi-bus.c    | 2 +-
 hw/scsi/vmw_pvscsi.c  | 2 +-
 10 files changed, 12 insertions(+), 9 deletions(-)
Makefile.objs +1 -1
index a71e25b..0d3b37a 100644
@@ -133,7 +133,7 @@ trace-events-subdirs += hw/virtio
 trace-events-subdirs += hw/audio
 trace-events-subdirs += hw/misc
 trace-events-subdirs += hw/usb
-trace-events-y += hw/scsi/trace-events
+trace-events-subdirs += hw/scsi
 trace-events-y += hw/nvram/trace-events
 trace-events-y += hw/display/trace-events
 trace-events-y += hw/input/trace-events
hw/scsi/Makefile.objs +3 -0
index 5a2248b..cdf229b 100644
@@ -12,3 +12,6 @@ ifeq ($(CONFIG_VIRTIO),y)
 obj-y += virtio-scsi.o virtio-scsi-dataplane.o
 obj-$(CONFIG_VHOST_SCSI) += vhost-scsi.o
 endif
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/scsi/esp-pci.c +1 -1
index 595f88b..1a94cb7 100644
@@ -27,7 +27,7 @@
 #include "hw/pci/pci.h"
 #include "hw/nvram/eeprom93xx.h"
 #include "hw/scsi/esp.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
 
hw/scsi/esp.c +1 -1
index 5a5a4e9..297b5cf 100644
@@ -26,7 +26,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/scsi/esp.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 #include "qapi/error.h"
 #include "qemu/log.h"
 
hw/scsi/megasas.c +1 -1
index 67fc1e7..0874750 100644
@@ -28,7 +28,7 @@
 #include "qemu/iov.h"
 #include "hw/scsi/scsi.h"
 #include "block/scsi.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 #include "qapi/error.h"
 #include "mfi.h"
 
hw/scsi/mptconfig.c +1 -1
index 87a416a..637c261 100644
@@ -22,7 +22,7 @@
 
 #include "mptsas.h"
 #include "mpi.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 
 /* Generic functions for marshaling and unmarshaling.  */
 
hw/scsi/mptendian.c +1 -1
index b7fe2a2..1584246 100644
@@ -29,7 +29,7 @@
 #include "qemu/iov.h"
 #include "hw/scsi/scsi.h"
 #include "block/scsi.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 
 #include "mptsas.h"
 #include "mpi.h"
hw/scsi/mptsas.c +1 -1
index ad87e78..01f1637 100644
@@ -31,7 +31,7 @@
 #include "qemu/iov.h"
 #include "hw/scsi/scsi.h"
 #include "block/scsi.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 #include "qapi/error.h"
 #include "mptsas.h"
 #include "mpi.h"
hw/scsi/scsi-bus.c +1 -1
index 297216d..e79721c 100644
@@ -7,7 +7,7 @@
 #include "hw/qdev.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 #include "sysemu/dma.h"
 #include "qemu/cutils.h"
 
hw/scsi/vmw_pvscsi.c +1 -1
index a5ce7de..b96e4ad 100644
@@ -31,7 +31,7 @@
 #include "block/scsi.h"
 #include "hw/pci/msi.h"
 #include "vmw_pvscsi.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 
 
 #define PVSCSI_USE_64BIT         (true)
Signature · 1 line
2.9.3
#41 lore raw

PATCH v2 16/47 trace: switch hw/nvram/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/nvram/ directory to include the hw/nvram/trace.h file instead of the global trace.h file.

---
 Makefile.objs          | 2 +-
 hw/nvram/Makefile.objs | 2 ++
 hw/nvram/ds1225y.c     | 2 +-
 hw/nvram/fw_cfg.c      | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index 0d3b37a..a08e1f9 100644
@@ -134,7 +134,7 @@ trace-events-subdirs += hw/audio
 trace-events-subdirs += hw/misc
 trace-events-subdirs += hw/usb
 trace-events-subdirs += hw/scsi
-trace-events-y += hw/nvram/trace-events
+trace-events-subdirs += hw/nvram
 trace-events-y += hw/display/trace-events
 trace-events-y += hw/input/trace-events
 trace-events-y += hw/timer/trace-events
hw/nvram/Makefile.objs +2 -0
index c018f6b..212c4cc 100644
@@ -4,3 +4,5 @@ common-obj-y += fw_cfg.o
 common-obj-y += chrp_nvram.o
 common-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
 obj-$(CONFIG_PSERIES) += spapr_nvram.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/nvram/ds1225y.c +1 -1
index 57d5ab2..cb4d4cc 100644
@@ -24,7 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/nvram/trace.h"
 
 typedef struct {
     MemoryRegion iomem;
hw/nvram/fw_cfg.c +1 -1
index 3ebecb2..0247171 100644
@@ -29,7 +29,7 @@
 #include "hw/isa/isa.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/nvram/trace.h"
 #include "qemu/error-report.h"
 #include "qemu/config-file.h"
 #include "qemu/cutils.h"
Signature · 1 line
2.9.3
#42 lore raw

PATCH v2 17/47 trace: switch hw/display/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/display/ directory to include the hw/display/trace.h file instead of the global trace.h file.

---
 Makefile.objs                | 2 +-
 hw/display/Makefile.objs     | 3 +++
 hw/display/g364fb.c          | 2 +-
 hw/display/jazz_led.c        | 2 +-
 hw/display/milkymist-tmu2.c  | 2 +-
 hw/display/milkymist-vgafb.c | 2 +-
 hw/display/qxl-render.c      | 2 +-
 hw/display/qxl.c             | 2 +-
 hw/display/vga.c             | 2 +-
 hw/display/virtio-gpu-3d.c   | 2 +-
 hw/display/virtio-gpu.c      | 2 +-
 hw/display/vmware_vga.c      | 2 +-
 hw/display/xenfb.c           | 2 +-
 13 files changed, 15 insertions(+), 12 deletions(-)
Makefile.objs +1 -1
index a08e1f9..11f7b0d 100644
@@ -135,7 +135,7 @@ trace-events-subdirs += hw/misc
 trace-events-subdirs += hw/usb
 trace-events-subdirs += hw/scsi
 trace-events-subdirs += hw/nvram
-trace-events-y += hw/display/trace-events
+trace-events-subdirs += hw/display
 trace-events-y += hw/input/trace-events
 trace-events-y += hw/timer/trace-events
 trace-events-y += hw/dma/trace-events
hw/display/Makefile.objs +3 -0
index 063889b..8279083 100644
@@ -45,3 +45,6 @@ virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
 virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
 obj-$(CONFIG_DPCD) += dpcd.o
 obj-$(CONFIG_XLNX_ZYNQMP) += xlnx_dp.o
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/display/g364fb.c +1 -1
index 70ef2c7..5342e07 100644
@@ -22,7 +22,7 @@
 #include "qemu/error-report.h"
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 #include "hw/sysbus.h"
 
 typedef struct G364State {
hw/display/jazz_led.c +1 -1
index b72fdb1..a11125c 100644
@@ -26,7 +26,7 @@
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 #include "hw/sysbus.h"
 
 typedef enum {
hw/display/milkymist-tmu2.c +1 -1
index 5c666f9..bb7016a 100644
@@ -27,7 +27,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 
hw/display/milkymist-vgafb.c +1 -1
index 177fdac..2180e6d 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 #include "ui/console.h"
 #include "framebuffer.h"
 #include "ui/pixel_ops.h"
hw/display/qxl-render.c +1 -1
index 9ad9d9e..d1f0db3 100644
@@ -21,7 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "qxl.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 
 static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect)
 {
hw/display/qxl.c +1 -1
index 62d0c80..50f12ae 100644
@@ -26,7 +26,7 @@
 #include "qemu/queue.h"
 #include "qemu/atomic.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 
 #include "qxl.h"
 
hw/display/vga.c +1 -1
index 2a88b3c..8dafd26 100644
@@ -32,7 +32,7 @@
 #include "ui/pixel_ops.h"
 #include "qemu/timer.h"
 #include "hw/xen/xen.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 
 //#define DEBUG_VGA
 //#define DEBUG_VGA_MEM
hw/display/virtio-gpu-3d.c +1 -1
index b13ced3..ba98d1f 100644
@@ -14,7 +14,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/iov.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-gpu.h"
 #include "qapi/error.h"
hw/display/virtio-gpu.c +1 -1
index ca88cf4..8aff8a9 100644
@@ -15,7 +15,7 @@
 #include "qemu-common.h"
 #include "qemu/iov.h"
 #include "ui/console.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-gpu.h"
 #include "hw/virtio/virtio-bus.h"
hw/display/vmware_vga.c +1 -1
index 6599cf0..8974181 100644
@@ -25,7 +25,7 @@
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/loader.h"
-#include "trace.h"
+#include "hw/display/trace.h"
 #include "ui/console.h"
 #include "ui/vnc.h"
 #include "hw/pci/pci.h"
hw/display/xenfb.c +1 -1
index 7a8727a..7c1f93f 100644
@@ -36,7 +36,7 @@
 #include <xen/io/kbdif.h>
 #include <xen/io/protocols.h>
 
-#include "trace.h"
+#include "hw/display/trace.h"
 
 #ifndef BTN_LEFT
 #define BTN_LEFT 0x110 /* from <linux/input.h> */
Signature · 1 line
2.9.3
#43 lore raw

PATCH v2 18/47 trace: switch hw/input/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/input/ directory to include the hw/input/trace.h file instead of the global trace.h file.

---
 Makefile.objs                | 2 +-
 hw/input/Makefile.objs       | 3 +++
 hw/input/hid.c               | 2 +-
 hw/input/milkymist-softusb.c | 2 +-
 hw/input/ps2.c               | 2 +-
 hw/input/virtio-input.c      | 2 +-
 6 files changed, 8 insertions(+), 5 deletions(-)
Makefile.objs +1 -1
index 11f7b0d..3ae5085 100644
@@ -136,7 +136,7 @@ trace-events-subdirs += hw/usb
 trace-events-subdirs += hw/scsi
 trace-events-subdirs += hw/nvram
 trace-events-subdirs += hw/display
-trace-events-y += hw/input/trace-events
+trace-events-subdirs += hw/input
 trace-events-y += hw/timer/trace-events
 trace-events-y += hw/dma/trace-events
 trace-events-y += hw/sparc/trace-events
hw/input/Makefile.objs +3 -0
index 7715d72..fc40638 100644
@@ -17,3 +17,6 @@ endif
 obj-$(CONFIG_MILKYMIST) += milkymist-softusb.o
 obj-$(CONFIG_PXA2XX) += pxa2xx_keypad.o
 obj-$(CONFIG_TSC210X) += tsc210x.o
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/input/hid.c +1 -1
index fa9cc4c..beb595b 100644
@@ -27,7 +27,7 @@
 #include "ui/console.h"
 #include "qemu/timer.h"
 #include "hw/input/hid.h"
-#include "trace.h"
+#include "hw/input/trace.h"
 
 #define HID_USAGE_ERROR_ROLLOVER        0x01
 #define HID_USAGE_POSTFAIL              0x02
hw/input/milkymist-softusb.c +1 -1
index 40dfca1..41f2211 100644
@@ -25,7 +25,7 @@
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/input/trace.h"
 #include "ui/console.h"
 #include "hw/input/hid.h"
 #include "qemu/error-report.h"
hw/input/ps2.c +1 -1
index 0d14de0..845a546 100644
@@ -29,7 +29,7 @@
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 
-#include "trace.h"
+#include "hw/input/trace.h"
 
 /* debug PC keyboard */
 //#define DEBUG_KBD
hw/input/virtio-input.c +1 -1
index b678ee9..517b583 100644
@@ -7,7 +7,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/iov.h"
-#include "trace.h"
+#include "hw/input/trace.h"
 
 #include "hw/qdev.h"
 #include "hw/virtio/virtio.h"
Signature · 1 line
2.9.3
#44 lore raw

PATCH v2 19/47 trace: switch hw/timer/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/timer/ directory to include the hw/timer/trace.h file instead of the global trace.h file.

---
 Makefile.objs               | 2 +-
 hw/timer/Makefile.objs      | 2 ++
 hw/timer/aspeed_timer.c     | 2 +-
 hw/timer/grlib_gptimer.c    | 2 +-
 hw/timer/lm32_timer.c       | 2 +-
 hw/timer/milkymist-sysctl.c | 2 +-
 hw/timer/slavio_timer.c     | 2 +-
 7 files changed, 8 insertions(+), 6 deletions(-)
Makefile.objs +1 -1
index 3ae5085..2c35b95 100644
@@ -137,7 +137,7 @@ trace-events-subdirs += hw/scsi
 trace-events-subdirs += hw/nvram
 trace-events-subdirs += hw/display
 trace-events-subdirs += hw/input
-trace-events-y += hw/timer/trace-events
+trace-events-subdirs += hw/timer
 trace-events-y += hw/dma/trace-events
 trace-events-y += hw/sparc/trace-events
 trace-events-y += hw/sd/trace-events
hw/timer/Makefile.objs +2 -0
index 7ba8c23..e764fc1 100644
@@ -34,3 +34,5 @@ obj-$(CONFIG_ALLWINNER_A10_PIT) += allwinner-a10-pit.o
 
 common-obj-$(CONFIG_STM32F2XX_TIMER) += stm32f2xx_timer.o
 common-obj-$(CONFIG_ASPEED_SOC) += aspeed_timer.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/timer/aspeed_timer.c +1 -1
index 9b70ee0..081e160 100644
@@ -16,7 +16,7 @@
 #include "qemu/bitops.h"
 #include "qemu/timer.h"
 #include "qemu/log.h"
-#include "trace.h"
+#include "hw/timer/trace.h"
 
 #define TIMER_NR_REGS 4
 
hw/timer/grlib_gptimer.c +1 -1
index 4ed96e9..fbd81d4 100644
@@ -28,7 +28,7 @@
 #include "hw/ptimer.h"
 #include "qemu/main-loop.h"
 
-#include "trace.h"
+#include "hw/timer/trace.h"
 
 #define UNIT_REG_SIZE    16     /* Size of memory mapped regs for the unit */
 #define GPTIMER_REG_SIZE 16     /* Size of memory mapped regs for a GPTimer */
hw/timer/lm32_timer.c +1 -1
index 2a07b59..003c68c 100644
@@ -24,7 +24,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/timer/trace.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "qemu/error-report.h"
hw/timer/milkymist-sysctl.c +1 -1
index 4488590..635b179 100644
@@ -25,7 +25,7 @@
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/timer/trace.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "qemu/error-report.h"
hw/timer/slavio_timer.c +1 -1
index bfee1f3..d9ac437 100644
@@ -27,7 +27,7 @@
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/timer/trace.h"
 #include "qemu/main-loop.h"
 
 /*
Signature · 1 line
2.9.3
#45 lore raw

PATCH v2 20/47 trace: switch hw/dma/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/dma/ directory to include the hw/dma/trace.h file instead of the global trace.h file.

---
 Makefile.objs        | 2 +-
 hw/dma/Makefile.objs | 2 ++
 hw/dma/i8257.c       | 2 +-
 hw/dma/rc4030.c      | 2 +-
 hw/dma/sparc32_dma.c | 2 +-
 hw/dma/sun4m_iommu.c | 2 +-
 6 files changed, 7 insertions(+), 5 deletions(-)
Makefile.objs +1 -1
index 2c35b95..2d56890 100644
@@ -138,7 +138,7 @@ trace-events-subdirs += hw/nvram
 trace-events-subdirs += hw/display
 trace-events-subdirs += hw/input
 trace-events-subdirs += hw/timer
-trace-events-y += hw/dma/trace-events
+trace-events-subdirs += hw/dma
 trace-events-y += hw/sparc/trace-events
 trace-events-y += hw/sd/trace-events
 trace-events-y += hw/isa/trace-events
hw/dma/Makefile.objs +2 -0
index 087c8e6..c3f6aae 100644
@@ -14,3 +14,5 @@ obj-$(CONFIG_XLNX_ZYNQMP) += xlnx_dpdma.o
 obj-$(CONFIG_OMAP) += omap_dma.o soc_dma.o
 obj-$(CONFIG_PXA2XX) += pxa2xx_dma.o
 obj-$(CONFIG_RASPI) += bcm2835_dma.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/dma/i8257.c +1 -1
index 8bd82e8..cfc58aa 100644
@@ -26,7 +26,7 @@
 #include "hw/isa/isa.h"
 #include "hw/isa/i8257.h"
 #include "qemu/main-loop.h"
-#include "trace.h"
+#include "hw/dma/trace.h"
 
 #define I8257(obj) \
     OBJECT_CHECK(I8257State, (obj), TYPE_I8257)
hw/dma/rc4030.c +1 -1
index 17c8518..d4ec853 100644
@@ -29,7 +29,7 @@
 #include "qemu/timer.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
-#include "trace.h"
+#include "hw/dma/trace.h"
 
 /********************************************************/
 /* rc4030 emulation                                     */
hw/dma/sparc32_dma.c +1 -1
index 9d545e4..fc2cc94 100644
@@ -30,7 +30,7 @@
 #include "hw/sparc/sparc32_dma.h"
 #include "hw/sparc/sun4m.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/dma/trace.h"
 
 /*
  * This is the DMA controller part of chip STP2000 (Master I/O), also
hw/dma/sun4m_iommu.c +1 -1
index b3cbc54..b7bd15e 100644
@@ -26,7 +26,7 @@
 #include "hw/sparc/sun4m.h"
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
-#include "trace.h"
+#include "hw/dma/trace.h"
 
 /*
  * I/O MMU used by Sun4m systems
Signature · 1 line
2.9.3
#46 lore raw

PATCH v2 21/47 trace: switch hw/sparc/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/sparc/ directory to include the hw/sparc/trace.h file instead of the global trace.h file.

---
 Makefile.objs          | 2 +-
 hw/sparc/Makefile.objs | 2 ++
 hw/sparc/leon3.c       | 2 +-
 hw/sparc/sun4m.c       | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index 2d56890..6c7252f 100644
@@ -139,7 +139,7 @@ trace-events-subdirs += hw/display
 trace-events-subdirs += hw/input
 trace-events-subdirs += hw/timer
 trace-events-subdirs += hw/dma
-trace-events-y += hw/sparc/trace-events
+trace-events-subdirs += hw/sparc
 trace-events-y += hw/sd/trace-events
 trace-events-y += hw/isa/trace-events
 trace-events-y += hw/mem/trace-events
hw/sparc/Makefile.objs +2 -0
index c987b5b..f509dc7 100644
@@ -1 +1,3 @@
 obj-y += sun4m.o leon3.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/sparc/leon3.c +1 -1
index 6e16478..2cc29d4 100644
@@ -34,7 +34,7 @@
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "elf.h"
-#include "trace.h"
+#include "hw/sparc/trace.h"
 #include "exec/address-spaces.h"
 
 #include "hw/sparc/grlib.h"
hw/sparc/sun4m.c +1 -1
index f5b6efd..5b0c31e 100644
@@ -46,7 +46,7 @@
 #include "hw/loader.h"
 #include "elf.h"
 #include "sysemu/block-backend.h"
-#include "trace.h"
+#include "hw/sparc/trace.h"
 #include "qemu/cutils.h"
 
 /*
Signature · 1 line
2.9.3
#47 lore raw

PATCH v2 22/47 trace: switch hw/sd/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/sd/ directory to include the hw/sd/trace.h file instead of the global trace.h file.

---
 Makefile.objs             | 2 +-
 hw/sd/Makefile.objs       | 2 ++
 hw/sd/milkymist-memcard.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index 6c7252f..1d9cdd0 100644
@@ -140,7 +140,7 @@ trace-events-subdirs += hw/input
 trace-events-subdirs += hw/timer
 trace-events-subdirs += hw/dma
 trace-events-subdirs += hw/sparc
-trace-events-y += hw/sd/trace-events
+trace-events-subdirs += hw/sd
 trace-events-y += hw/isa/trace-events
 trace-events-y += hw/mem/trace-events
 trace-events-y += hw/i386/trace-events
hw/sd/Makefile.objs +2 -0
index 31c8330..9fe778a 100644
@@ -6,3 +6,5 @@ common-obj-$(CONFIG_SDHCI) += sdhci.o
 obj-$(CONFIG_MILKYMIST) += milkymist-memcard.o
 obj-$(CONFIG_OMAP) += omap_mmc.o
 obj-$(CONFIG_PXA2XX) += pxa2xx_mmci.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/sd/milkymist-memcard.c +1 -1
index 1f2f0ed..ce93fc2 100644
@@ -25,7 +25,7 @@
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/sd/trace.h"
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
Signature · 1 line
2.9.3
#48 lore raw

PATCH v2 23/47 trace: switch hw/isa/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/isa/ directory to include the hw/isa/trace.h file instead of the global trace.h file.

---
 Makefile.objs        | 2 +-
 hw/isa/Makefile.objs | 2 ++
 hw/isa/pc87312.c     | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index 1d9cdd0..a901f5d 100644
@@ -141,7 +141,7 @@ trace-events-subdirs += hw/timer
 trace-events-subdirs += hw/dma
 trace-events-subdirs += hw/sparc
 trace-events-subdirs += hw/sd
-trace-events-y += hw/isa/trace-events
+trace-events-subdirs += hw/isa
 trace-events-y += hw/mem/trace-events
 trace-events-y += hw/i386/trace-events
 trace-events-y += hw/9pfs/trace-events
hw/isa/Makefile.objs +2 -0
index 9164556..a273afd 100644
@@ -6,3 +6,5 @@ common-obj-$(CONFIG_PIIX4) += piix4.o
 common-obj-$(CONFIG_VT82C686) += vt82c686.o
 
 obj-$(CONFIG_LPC_ICH9) += lpc_ich9.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/isa/pc87312.c +1 -1
index b1c1a0a..d1d13f3 100644
@@ -31,7 +31,7 @@
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/char.h"
-#include "trace.h"
+#include "hw/isa/trace.h"
 
 
 #define REG_FER 0
Signature · 1 line
2.9.3
#49 lore raw

PATCH v2 24/47 trace: switch hw/mem/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/mem/ directory to include the hw/mem/trace.h file instead of the global trace.h file.

---
 Makefile.objs        | 2 +-
 hw/mem/Makefile.objs | 3 +++
 hw/mem/pc-dimm.c     | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index a901f5d..89953e5 100644
@@ -142,7 +142,7 @@ trace-events-subdirs += hw/dma
 trace-events-subdirs += hw/sparc
 trace-events-subdirs += hw/sd
 trace-events-subdirs += hw/isa
-trace-events-y += hw/mem/trace-events
+trace-events-subdirs += hw/mem
 trace-events-y += hw/i386/trace-events
 trace-events-y += hw/9pfs/trace-events
 trace-events-y += hw/ppc/trace-events
hw/mem/Makefile.objs +3 -0
index f12f8b9..ae1f513 100644
@@ -1,2 +1,5 @@
 common-obj-$(CONFIG_MEM_HOTPLUG) += pc-dimm.o
 common-obj-$(CONFIG_NVDIMM) += nvdimm.o
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/mem/pc-dimm.c +1 -1
index 9e8dab0..bcbaa32 100644
@@ -26,7 +26,7 @@
 #include "qemu/range.h"
 #include "sysemu/numa.h"
 #include "sysemu/kvm.h"
-#include "trace.h"
+#include "hw/mem/trace.h"
 #include "hw/virtio/vhost.h"
 
 typedef struct pc_dimms_capacity {
Signature · 1 line
2.9.3
#50 lore raw

PATCH v2 25/47 trace: switch hw/i386/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/i386/ directory to include the hw/i386/trace.h file instead of the global trace.h file.

---
 Makefile.objs              | 2 +-
 hw/i386/Makefile.objs      | 2 ++
 hw/i386/x86-iommu.c        | 2 +-
 hw/i386/xen/xen_platform.c | 1 +
 hw/i386/xen/xen_pvdevice.c | 1 +
 5 files changed, 6 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index 89953e5..14ae798 100644
@@ -143,7 +143,7 @@ trace-events-subdirs += hw/sparc
 trace-events-subdirs += hw/sd
 trace-events-subdirs += hw/isa
 trace-events-subdirs += hw/mem
-trace-events-y += hw/i386/trace-events
+trace-events-subdirs += hw/i386
 trace-events-y += hw/9pfs/trace-events
 trace-events-y += hw/ppc/trace-events
 trace-events-y += hw/pci/trace-events
hw/i386/Makefile.objs +2 -0
index 909ead6..f98d3c0 100644
@@ -9,3 +9,5 @@ obj-$(CONFIG_XEN) += ../xenpv/ xen/
 obj-y += kvmvapic.o
 obj-y += acpi-build.o
 obj-y += pci-assign-load-rom.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/i386/x86-iommu.c +1 -1
index 2278af7..e2ed227 100644
@@ -22,7 +22,7 @@
 #include "hw/boards.h"
 #include "hw/i386/x86-iommu.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "hw/i386/trace.h"
 
 void x86_iommu_iec_register_notifier(X86IOMMUState *iommu,
                                      iec_notify_fn fn, void *data)
hw/i386/xen/xen_platform.c +1 -0
index 2e1e543..2ad1843 100644
@@ -33,6 +33,7 @@
 #include "hw/xen/xen_common.h"
 #include "hw/xen/xen_backend.h"
 #include "trace.h"
+#include "hw/i386/trace.h"
 #include "exec/address-spaces.h"
 #include "sysemu/block-backend.h"
 #include "qemu/error-report.h"
hw/i386/xen/xen_pvdevice.c +1 -0
index c093b34..742a3d9 100644
@@ -34,6 +34,7 @@
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "trace.h"
+#include "hw/i386/trace.h"
 
 #define TYPE_XEN_PV_DEVICE  "xen-pvdevice"
 
Signature · 1 line
2.9.3
#51 lore raw

PATCH v2 26/47 trace: switch hw/9pfs/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/9pfs/ directory to include the hw/9pfs/trace.h file instead of the global trace.h file.

---
 Makefile.objs         | 2 +-
 hw/9pfs/9p.c          | 2 +-
 hw/9pfs/Makefile.objs | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index 14ae798..83906e5 100644
@@ -144,7 +144,7 @@ trace-events-subdirs += hw/sd
 trace-events-subdirs += hw/isa
 trace-events-subdirs += hw/mem
 trace-events-subdirs += hw/i386
-trace-events-y += hw/9pfs/trace-events
+trace-events-subdirs += hw/9pfs
 trace-events-y += hw/ppc/trace-events
 trace-events-y += hw/pci/trace-events
 trace-events-y += hw/s390x/trace-events
hw/9pfs/9p.c +1 -1
index fa58877..bb9428c 100644
@@ -22,7 +22,7 @@
 #include "fsdev/qemu-fsdev.h"
 #include "9p-xattr.h"
 #include "coth.h"
-#include "trace.h"
+#include "hw/9pfs/trace.h"
 #include "migration/migration.h"
 
 int open_fd_hw;
hw/9pfs/Makefile.objs +2 -0
index da0ae0c..28eb2e5 100644
@@ -7,3 +7,5 @@ common-obj-$(CONFIG_OPEN_BY_HANDLE) +=  9p-handle.o
 common-obj-y += 9p-proxy.o
 
 obj-y += virtio-9p-device.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
Signature · 1 line
2.9.3
#52 lore raw

PATCH v2 27/47 trace: switch hw/ppc/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/ppc/ directory to include the hw/ppc/trace.h file instead of the global trace.h file.

---
 Makefile.objs           | 2 +-
 hw/ppc/Makefile.objs    | 3 +++
 hw/ppc/ppc.c            | 2 +-
 hw/ppc/prep.c           | 2 +-
 hw/ppc/spapr.c          | 2 +-
 hw/ppc/spapr_hcall.c    | 2 +-
 hw/ppc/spapr_iommu.c    | 2 +-
 hw/ppc/spapr_pci.c      | 2 +-
 hw/ppc/spapr_rtas_ddw.c | 2 +-
 9 files changed, 11 insertions(+), 8 deletions(-)
Makefile.objs +1 -1
index 83906e5..42cd94e 100644
@@ -145,7 +145,7 @@ trace-events-subdirs += hw/isa
 trace-events-subdirs += hw/mem
 trace-events-subdirs += hw/i386
 trace-events-subdirs += hw/9pfs
-trace-events-y += hw/ppc/trace-events
+trace-events-subdirs += hw/ppc
 trace-events-y += hw/pci/trace-events
 trace-events-y += hw/s390x/trace-events
 trace-events-y += hw/vfio/trace-events
hw/ppc/Makefile.objs +3 -0
index 8025129..071428c 100644
@@ -25,3 +25,6 @@ obj-$(CONFIG_E500) += e500.o mpc8544ds.o e500plat.o
 obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o
 # PowerPC 440 Xilinx ML507 reference board.
 obj-$(CONFIG_XILINX) += virtex_ml507.o
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/ppc/ppc.c +1 -1
index 8945869..53302e8 100644
@@ -37,7 +37,7 @@
 #include "hw/loader.h"
 #include "sysemu/kvm.h"
 #include "kvm_ppc.h"
-#include "trace.h"
+#include "hw/ppc/trace.h"
 
 //#define PPC_DEBUG_IRQ
 //#define PPC_DEBUG_TB
hw/ppc/prep.c +1 -1
index 054af1e..c5c97b1 100644
@@ -45,7 +45,7 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/qtest.h"
 #include "exec/address-spaces.h"
-#include "trace.h"
+#include "hw/ppc/trace.h"
 #include "elf.h"
 #include "qemu/cutils.h"
 
hw/ppc/spapr.c +1 -1
index 208ef7b..ebdcf6f 100644
@@ -61,7 +61,7 @@
 #include "hw/usb.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "hw/ppc/trace.h"
 #include "hw/nmi.h"
 
 #include "hw/compat.h"
hw/ppc/spapr_hcall.c +1 -1
index 9a9bedf..332a49a 100644
@@ -8,7 +8,7 @@
 #include "hw/ppc/spapr.h"
 #include "mmu-hash64.h"
 #include "cpu-models.h"
-#include "trace.h"
+#include "hw/ppc/trace.h"
 #include "sysemu/kvm.h"
 #include "kvm_ppc.h"
 #include "hw/ppc/spapr_ovec.h"
hw/ppc/spapr_iommu.c +1 -1
index ae30bbe..125682d 100644
@@ -25,7 +25,7 @@
 #include "kvm_ppc.h"
 #include "sysemu/dma.h"
 #include "exec/address-spaces.h"
-#include "trace.h"
+#include "hw/ppc/trace.h"
 
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_vio.h"
hw/ppc/spapr_pci.c +1 -1
index fd6fc1d..1acb5b4 100644
@@ -37,7 +37,7 @@
 #include "exec/address-spaces.h"
 #include "exec/ram_addr.h"
 #include <libfdt.h>
-#include "trace.h"
+#include "hw/ppc/trace.h"
 #include "qemu/error-report.h"
 #include "qapi/qmp/qerror.h"
 
hw/ppc/spapr_rtas_ddw.c +1 -1
index 177dcff..3dad98c 100644
@@ -22,7 +22,7 @@
 #include "qemu/error-report.h"
 #include "hw/ppc/spapr.h"
 #include "hw/pci-host/spapr.h"
-#include "trace.h"
+#include "hw/ppc/trace.h"
 
 static int spapr_phb_get_active_win_num_cb(Object *child, void *opaque)
 {
Signature · 1 line
2.9.3
#53 lore raw

PATCH v2 28/47 trace: switch hw/pci/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/pci/ directory to include the hw/pci/trace.h file instead of the global trace.h file.

---
 Makefile.objs        | 2 +-
 hw/pci/Makefile.objs | 2 ++
 hw/pci/pci.c         | 2 +-
 hw/pci/pci_host.c    | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index 42cd94e..66ffeca 100644
@@ -146,7 +146,7 @@ trace-events-subdirs += hw/mem
 trace-events-subdirs += hw/i386
 trace-events-subdirs += hw/9pfs
 trace-events-subdirs += hw/ppc
-trace-events-y += hw/pci/trace-events
+trace-events-subdirs += hw/pci
 trace-events-y += hw/s390x/trace-events
 trace-events-y += hw/vfio/trace-events
 trace-events-y += hw/acpi/trace-events
hw/pci/Makefile.objs +2 -0
index 9f905e6..b075774 100644
@@ -7,3 +7,5 @@ common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
 
 common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o
 common-obj-$(CONFIG_ALL) += pci-stub.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/pci/pci.c +1 -1
index 24fae16..8c1c7b9 100644
@@ -34,7 +34,7 @@
 #include "qemu/error-report.h"
 #include "qemu/range.h"
 #include "qmp-commands.h"
-#include "trace.h"
+#include "hw/pci/trace.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
 #include "exec/address-spaces.h"
hw/pci/pci_host.c +1 -1
index 5eaa935..2ecf5b9 100644
@@ -22,7 +22,7 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_host.h"
 #include "hw/pci/pci_bus.h"
-#include "trace.h"
+#include "hw/pci/trace.h"
 
 /* debug PCI */
 //#define DEBUG_PCI
Signature · 1 line
2.9.3
#54 lore raw

PATCH v2 29/47 trace: switch hw/s390x/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/s390x/ directory to include the hw/s390x/trace.h file instead of the global trace.h file.

---
 Makefile.objs          | 2 +-
 hw/s390x/Makefile.objs | 3 +++
 hw/s390x/css.c         | 2 +-
 hw/s390x/virtio-ccw.c  | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index 66ffeca..8f44164 100644
@@ -147,7 +147,7 @@ trace-events-subdirs += hw/i386
 trace-events-subdirs += hw/9pfs
 trace-events-subdirs += hw/ppc
 trace-events-subdirs += hw/pci
-trace-events-y += hw/s390x/trace-events
+trace-events-subdirs += hw/s390x
 trace-events-y += hw/vfio/trace-events
 trace-events-y += hw/acpi/trace-events
 trace-events-y += hw/arm/trace-events
hw/s390x/Makefile.objs +3 -0
index 41ac4ec..ac66483 100644
@@ -13,3 +13,6 @@ obj-y += ccw-device.o
 obj-y += s390-pci-bus.o s390-pci-inst.o
 obj-y += s390-skeys.o
 obj-$(CONFIG_KVM) += s390-skeys-kvm.o
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/s390x/css.c +1 -1
index 0f2580d..e11ffa3 100644
@@ -18,7 +18,7 @@
 #include "cpu.h"
 #include "hw/s390x/ioinst.h"
 #include "hw/s390x/css.h"
-#include "trace.h"
+#include "hw/s390x/trace.h"
 #include "hw/s390x/s390_flic.h"
 
 typedef struct CrwContainer {
hw/s390x/virtio-ccw.c +1 -1
index f5c1d98..7b8c7fc 100644
@@ -32,7 +32,7 @@
 #include "hw/s390x/ioinst.h"
 #include "hw/s390x/css.h"
 #include "virtio-ccw.h"
-#include "trace.h"
+#include "hw/s390x/trace.h"
 #include "hw/s390x/css-bridge.h"
 
 static void virtio_ccw_bus_new(VirtioBusState *bus, size_t bus_size,
Signature · 1 line
2.9.3
#55 lore raw

PATCH v2 30/47 trace: switch hw/vfio/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/vfio/ directory to include the hw/vfio/trace.h file instead of the global trace.h file.

---
 Makefile.objs         | 2 +-
 hw/vfio/Makefile.objs | 2 ++
 hw/vfio/common.c      | 2 +-
 hw/vfio/pci-quirks.c  | 2 +-
 hw/vfio/pci.c         | 2 +-
 hw/vfio/platform.c    | 2 +-
 hw/vfio/spapr.c       | 2 +-
 7 files changed, 8 insertions(+), 6 deletions(-)
Makefile.objs +1 -1
index 8f44164..cea70ce 100644
@@ -148,7 +148,7 @@ trace-events-subdirs += hw/9pfs
 trace-events-subdirs += hw/ppc
 trace-events-subdirs += hw/pci
 trace-events-subdirs += hw/s390x
-trace-events-y += hw/vfio/trace-events
+trace-events-subdirs += hw/vfio
 trace-events-y += hw/acpi/trace-events
 trace-events-y += hw/arm/trace-events
 trace-events-y += hw/alpha/trace-events
hw/vfio/Makefile.objs +2 -0
index c25e32b..33f7d4f 100644
@@ -5,4 +5,6 @@ obj-$(CONFIG_SOFTMMU) += platform.o
 obj-$(CONFIG_SOFTMMU) += calxeda-xgmac.o
 obj-$(CONFIG_SOFTMMU) += amd-xgbe.o
 obj-$(CONFIG_SOFTMMU) += spapr.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 endif
hw/vfio/common.c +1 -1
index 801578b..0e28500 100644
@@ -33,7 +33,7 @@
 #include "qemu/error-report.h"
 #include "qemu/range.h"
 #include "sysemu/kvm.h"
-#include "trace.h"
+#include "hw/vfio/trace.h"
 #include "qapi/error.h"
 
 struct vfio_group_head vfio_group_list =
hw/vfio/pci-quirks.c +1 -1
index 811eecd..b470ba2 100644
@@ -16,7 +16,7 @@
 #include "qapi/error.h"
 #include "hw/nvram/fw_cfg.h"
 #include "pci.h"
-#include "trace.h"
+#include "hw/vfio/trace.h"
 
 /* Use uin32_t for vendor & device so PCI_ANY_ID expands and cannot match hw */
 static bool vfio_pci_is(VFIOPCIDevice *vdev, uint32_t vendor, uint32_t device)
hw/vfio/pci.c +1 -1
index d7dbe0e..e2d3e7b 100644
@@ -30,7 +30,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
 #include "pci.h"
-#include "trace.h"
+#include "hw/vfio/trace.h"
 #include "qapi/error.h"
 
 #define MSIX_CAP_LENGTH 12
hw/vfio/platform.c +1 -1
index a4663c9..ab9f19d 100644
@@ -26,7 +26,7 @@
 #include "exec/memory.h"
 #include "qemu/queue.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/vfio/trace.h"
 #include "hw/platform-bus.h"
 #include "sysemu/kvm.h"
 
hw/vfio/spapr.c +1 -1
index 4409bcc..5899f6d 100644
@@ -16,7 +16,7 @@
 #include "hw/vfio/vfio-common.h"
 #include "hw/hw.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "hw/vfio/trace.h"
 
 static bool vfio_prereg_listener_skipped_section(MemoryRegionSection *section)
 {
Signature · 1 line
2.9.3
#56 lore raw

PATCH v2 31/47 trace: switch hw/acpi/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/acpi/ directory to include the hw/acpi/trace.h file instead of the global trace.h file.

---
 Makefile.objs            | 2 +-
 hw/acpi/Makefile.objs    | 2 ++
 hw/acpi/cpu.c            | 2 +-
 hw/acpi/memory_hotplug.c | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index cea70ce..86c62cd 100644
@@ -149,7 +149,7 @@ trace-events-subdirs += hw/ppc
 trace-events-subdirs += hw/pci
 trace-events-subdirs += hw/s390x
 trace-events-subdirs += hw/vfio
-trace-events-y += hw/acpi/trace-events
+trace-events-subdirs += hw/acpi
 trace-events-y += hw/arm/trace-events
 trace-events-y += hw/alpha/trace-events
 trace-events-y += ui/trace-events
hw/acpi/Makefile.objs +2 -0
index 489e63b..abdc809 100644
@@ -8,3 +8,5 @@ common-obj-$(CONFIG_ACPI) += acpi_interface.o
 common-obj-$(CONFIG_ACPI) += bios-linker-loader.o
 common-obj-$(CONFIG_ACPI) += aml-build.o
 common-obj-$(call land,$(CONFIG_ACPI),$(CONFIG_IPMI)) += ipmi.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/acpi/cpu.c +1 -1
index 5ac89fe..68e1c0f 100644
@@ -3,7 +3,7 @@
 #include "hw/acpi/cpu.h"
 #include "qapi/error.h"
 #include "qapi-event.h"
-#include "trace.h"
+#include "hw/acpi/trace.h"
 #include "sysemu/numa.h"
 
 #define ACPI_CPU_HOTPLUG_REG_LEN 12
hw/acpi/memory_hotplug.c +1 -1
index ec4e64b..e442970 100644
@@ -4,7 +4,7 @@
 #include "hw/mem/pc-dimm.h"
 #include "hw/boards.h"
 #include "hw/qdev-core.h"
-#include "trace.h"
+#include "hw/acpi/trace.h"
 #include "qapi-event.h"
 
 static ACPIOSTInfo *acpi_memory_device_status(int slot, MemStatus *mdev)
Signature · 1 line
2.9.3
#57 lore raw

PATCH v2 32/47 trace: switch hw/arm/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/arm/ directory to include the hw/arm/trace.h file instead of the global trace.h file.

---
 Makefile.objs            | 2 +-
 hw/arm/Makefile.objs     | 2 ++
 hw/arm/virt-acpi-build.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index 86c62cd..6a0c033 100644
@@ -150,7 +150,7 @@ trace-events-subdirs += hw/pci
 trace-events-subdirs += hw/s390x
 trace-events-subdirs += hw/vfio
 trace-events-subdirs += hw/acpi
-trace-events-y += hw/arm/trace-events
+trace-events-subdirs += hw/arm
 trace-events-y += hw/alpha/trace-events
 trace-events-y += ui/trace-events
 trace-events-y += audio/trace-events
hw/arm/Makefile.objs +2 -0
index 4c5c4ee..0704312 100644
@@ -18,3 +18,5 @@ obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
 obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o
 obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
 obj-$(CONFIG_ASPEED_SOC) += aspeed_soc.o aspeed.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/arm/virt-acpi-build.c +1 -1
index 7102686..915f88d 100644
@@ -31,7 +31,7 @@
 #include "qemu-common.h"
 #include "hw/arm/virt-acpi-build.h"
 #include "qemu/bitmap.h"
-#include "trace.h"
+#include "hw/arm/trace.h"
 #include "qom/cpu.h"
 #include "target/arm/cpu.h"
 #include "hw/acpi/acpi-defs.h"
Signature · 1 line
2.9.3
#58 lore raw

PATCH v2 33/47 trace: switch hw/alpha/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the hw/alpha/ directory to include the hw/alpha/trace.h file instead of the global trace.h file.

---
 Makefile.objs          | 2 +-
 hw/alpha/Makefile.objs | 2 ++
 hw/alpha/pci.c         | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index 6a0c033..3a4abc7 100644
@@ -151,7 +151,7 @@ trace-events-subdirs += hw/s390x
 trace-events-subdirs += hw/vfio
 trace-events-subdirs += hw/acpi
 trace-events-subdirs += hw/arm
-trace-events-y += hw/alpha/trace-events
+trace-events-subdirs += hw/alpha
 trace-events-y += ui/trace-events
 trace-events-y += audio/trace-events
 trace-events-y += net/trace-events
hw/alpha/Makefile.objs +2 -0
index 5c74275..e8e0573 100644
@@ -1 +1,3 @@
 obj-y += dp264.o pci.o typhoon.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
hw/alpha/pci.c +1 -1
index 8dde637..3fafb1b 100644
@@ -11,7 +11,7 @@
 #include "alpha_sys.h"
 #include "qemu/log.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "hw/alpha/trace.h"
 
 
 /* Fallback for unassigned PCI I/O operations.  Avoids MCHK.  */
Signature · 1 line
2.9.3
#59 lore raw

PATCH v2 34/47 trace: switch ui/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the ui/ directory to include the
ui/trace.h file instead of the global trace.h
file.

---
 Makefile.objs      | 2 +-
 ui/Makefile.objs   | 3 +++
 ui/console.c       | 2 +-
 ui/gtk-egl.c       | 2 +-
 ui/gtk-gl-area.c   | 2 +-
 ui/gtk.c           | 2 +-
 ui/input.c         | 2 +-
 ui/spice-display.c | 2 +-
 ui/vnc.c           | 2 +-
 9 files changed, 11 insertions(+), 8 deletions(-)
Makefile.objs +1 -1
index 3a4abc7..355cb78 100644
@@ -152,7 +152,7 @@ trace-events-subdirs += hw/vfio
 trace-events-subdirs += hw/acpi
 trace-events-subdirs += hw/arm
 trace-events-subdirs += hw/alpha
-trace-events-y += ui/trace-events
+trace-events-subdirs += ui
 trace-events-y += audio/trace-events
 trace-events-y += net/trace-events
 trace-events-y += target/arm/trace-events
ui/Makefile.objs +3 -0
index dc936f1..c9d1847 100644
@@ -51,3 +51,6 @@ gtk-egl.o-libs += $(OPENGL_LIBS)
 shader.o-libs += $(OPENGL_LIBS)
 console-gl.o-libs += $(OPENGL_LIBS)
 egl-helpers.o-libs += $(OPENGL_LIBS)
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
ui/console.c +1 -1
index ed888e5..73b8341 100644
@@ -28,7 +28,7 @@
 #include "qemu/timer.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
-#include "trace.h"
+#include "ui/trace.h"
 #include "exec/memory.h"
 
 #define DEFAULT_BACKSCROLL 512
ui/gtk-egl.c +1 -1
index 3f5d328..1c12d34 100644
@@ -14,7 +14,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-#include "trace.h"
+#include "ui/trace.h"
 
 #include "ui/console.h"
 #include "ui/gtk.h"
ui/gtk-gl-area.c +1 -1
index 0df5a36..49c9e00 100644
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-#include "trace.h"
+#include "ui/trace.h"
 
 #include "ui/console.h"
 #include "ui/gtk.h"
ui/gtk.c +1 -1
index a216216..1d71691 100644
@@ -48,7 +48,7 @@
 #endif
 #include <math.h>
 
-#include "trace.h"
+#include "ui/trace.h"
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 #include "qmp-commands.h"
ui/input.c +1 -1
index ed88cda..b3b881b 100644
@@ -4,7 +4,7 @@
 #include "qapi-types.h"
 #include "qemu/error-report.h"
 #include "qmp-commands.h"
-#include "trace.h"
+#include "ui/trace.h"
 #include "ui/input.h"
 #include "ui/console.h"
 #include "sysemu/replay.h"
ui/spice-display.c +1 -1
index 5e6f78a..d8f13db 100644
@@ -22,7 +22,7 @@
 #include "qemu/queue.h"
 #include "ui/console.h"
 #include "sysemu/sysemu.h"
-#include "trace.h"
+#include "ui/trace.h"
 
 #include "ui/spice-display.h"
 
ui/vnc.c +1 -1
index 2c28a59..f715b48 100644
@@ -27,7 +27,7 @@
 #include "qemu/osdep.h"
 #include "vnc.h"
 #include "vnc-jobs.h"
-#include "trace.h"
+#include "ui/trace.h"
 #include "hw/qdev.h"
 #include "sysemu/sysemu.h"
 #include "qemu/error-report.h"
Signature · 1 line
2.9.3
#60 lore raw

PATCH v2 35/47 trace: switch audio/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the audio/ directory to include the audio/trace.h file instead of the global trace.h file.

---
 Makefile.objs       | 2 +-
 audio/Makefile.objs | 2 ++
 audio/alsaaudio.c   | 2 +-
 audio/ossaudio.c    | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index 355cb78..dc3a51e 100644
@@ -153,7 +153,7 @@ trace-events-subdirs += hw/acpi
 trace-events-subdirs += hw/arm
 trace-events-subdirs += hw/alpha
 trace-events-subdirs += ui
-trace-events-y += audio/trace-events
+trace-events-subdirs += audio
 trace-events-y += net/trace-events
 trace-events-y += target/arm/trace-events
 trace-events-y += target/i386/trace-events
audio/Makefile.objs +2 -0
index 481d1aa..4eef4b4 100644
@@ -9,5 +9,7 @@ common-obj-$(CONFIG_PA) += paaudio.o
 common-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
 common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
 common-obj-y += wavcapture.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 sdlaudio.o-cflags := $(SDL_CFLAGS)
audio/alsaaudio.c +1 -1
index 3652a7b..1111b71 100644
@@ -26,7 +26,7 @@
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "audio.h"
-#include "trace.h"
+#include "audio/trace.h"
 
 #if QEMU_GNUC_PREREQ(4, 3)
 #pragma GCC diagnostic ignored "-Waddress"
audio/ossaudio.c +1 -1
index 0edd7ea..c04da5e 100644
@@ -28,7 +28,7 @@
 #include "qemu/main-loop.h"
 #include "qemu/host-utils.h"
 #include "audio.h"
-#include "trace.h"
+#include "audio/trace.h"
 
 #define AUDIO_CAP "oss"
 #include "audio_int.h"
Signature · 1 line
2.9.3
#61 lore raw

PATCH v2 36/47 trace: switch net/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the net/ directory to include the
net/trace.h file instead of the global trace.h
file.

---
 Makefile.objs       | 2 +-
 net/Makefile.objs   | 2 ++
 net/filter-mirror.c | 2 +-
 net/vhost-user.c    | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
Makefile.objs +1 -1
index dc3a51e..d6125a8 100644
@@ -154,7 +154,7 @@ trace-events-subdirs += hw/arm
 trace-events-subdirs += hw/alpha
 trace-events-subdirs += ui
 trace-events-subdirs += audio
-trace-events-y += net/trace-events
+trace-events-subdirs += net
 trace-events-y += target/arm/trace-events
 trace-events-y += target/i386/trace-events
 trace-events-y += target/sparc/trace-events
net/Makefile.objs +2 -0
index 2e2fd43..9cb8f78 100644
@@ -20,3 +20,5 @@ common-obj-y += colo-compare.o
 common-obj-y += colo.o
 common-obj-y += filter-rewriter.o
 common-obj-y += filter-replay.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
net/filter-mirror.c +1 -1
index b7d6456..5e1cb16 100644
@@ -19,7 +19,7 @@
 #include "qom/object.h"
 #include "qemu/main-loop.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "net/trace.h"
 #include "sysemu/char.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
net/vhost-user.c +1 -1
index 7aff77e..c812462 100644
@@ -16,7 +16,7 @@
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "qmp-commands.h"
-#include "trace.h"
+#include "net/trace.h"
 
 typedef struct VhostUserState {
     NetClientState nc;
Signature · 1 line
2.9.3
#62 lore raw

PATCH v2 37/47 trace: switch target/arm/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the target/arm/ directory to include the target/arm/trace.h file instead of the global trace.h file.

---
 Makefile.objs            | 2 +-
 target/arm/Makefile.objs | 2 ++
 target/arm/helper.c      | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index d6125a8..dda2c04 100644
@@ -155,7 +155,7 @@ trace-events-subdirs += hw/alpha
 trace-events-subdirs += ui
 trace-events-subdirs += audio
 trace-events-subdirs += net
-trace-events-y += target/arm/trace-events
+trace-events-subdirs += target/arm
 trace-events-y += target/i386/trace-events
 trace-events-y += target/sparc/trace-events
 trace-events-y += target/s390x/trace-events
target/arm/Makefile.objs +2 -0
index 847fb52..a6bbb0e 100644
@@ -10,3 +10,5 @@ obj-y += gdbstub.o
 obj-$(TARGET_AARCH64) += cpu64.o translate-a64.o helper-a64.o gdbstub64.o
 obj-y += crypto_helper.o
 obj-$(CONFIG_SOFTMMU) += arm-powerctl.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
target/arm/helper.c +1 -1
index 8dcabbf..4b232e9 100644
@@ -1,5 +1,5 @@
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "target/arm/trace.h"
 #include "cpu.h"
 #include "internals.h"
 #include "exec/gdbstub.h"
Signature · 1 line
2.9.3
#63 lore raw

PATCH v2 38/47 trace: switch target/i386/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the target/i386/ directory to include the target/i386/trace.h file instead of the global trace.h file.

---
 Makefile.objs             | 2 +-
 target/i386/Makefile.objs | 2 ++
 target/i386/kvm.c         | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index dda2c04..a1161be 100644
@@ -156,7 +156,7 @@ trace-events-subdirs += ui
 trace-events-subdirs += audio
 trace-events-subdirs += net
 trace-events-subdirs += target/arm
-trace-events-y += target/i386/trace-events
+trace-events-subdirs += target/i386
 trace-events-y += target/sparc/trace-events
 trace-events-y += target/s390x/trace-events
 trace-events-y += target/ppc/trace-events
target/i386/Makefile.objs +2 -0
index b223d79..a73e6f3 100644
@@ -5,3 +5,5 @@ obj-y += gdbstub.o
 obj-$(CONFIG_SOFTMMU) += machine.o arch_memory_mapping.o arch_dump.o monitor.o
 obj-$(CONFIG_KVM) += kvm.o hyperv.o
 obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
target/i386/kvm.c +1 -1
index 10a9cd8..87f4eae 100644
@@ -44,7 +44,7 @@
 #include "hw/pci/msi.h"
 #include "migration/migration.h"
 #include "exec/memattrs.h"
-#include "trace.h"
+#include "target/i386/trace.h"
 
 //#define DEBUG_KVM
 
Signature · 1 line
2.9.3
#64 lore raw

PATCH v2 39/47 trace: switch target/sparc/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the target/sparc/ directory to include the target/sparc/trace.h file instead of the global trace.h file.

---
 Makefile.objs               | 2 +-
 target/sparc/Makefile.objs  | 2 ++
 target/sparc/int32_helper.c | 2 +-
 target/sparc/int64_helper.c | 2 +-
 target/sparc/mmu_helper.c   | 2 +-
 target/sparc/win_helper.c   | 2 +-
 6 files changed, 7 insertions(+), 5 deletions(-)
Makefile.objs +1 -1
index a1161be..cc8f506 100644
@@ -157,7 +157,7 @@ trace-events-subdirs += audio
 trace-events-subdirs += net
 trace-events-subdirs += target/arm
 trace-events-subdirs += target/i386
-trace-events-y += target/sparc/trace-events
+trace-events-subdirs += target/sparc
 trace-events-y += target/s390x/trace-events
 trace-events-y += target/ppc/trace-events
 trace-events-y += qom/trace-events
target/sparc/Makefile.objs +2 -0
index ec90569..0ca6e73 100644
@@ -5,3 +5,5 @@ obj-$(TARGET_SPARC) += int32_helper.o
 obj-$(TARGET_SPARC64) += int64_helper.o
 obj-$(TARGET_SPARC64) += vis_helper.o
 obj-y += gdbstub.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
target/sparc/int32_helper.c +1 -1
index 09afe13..2838eda 100644
@@ -19,7 +19,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "trace.h"
+#include "target/sparc/trace.h"
 #include "sysemu/sysemu.h"
 #include "exec/log.h"
 
target/sparc/int64_helper.c +1 -1
index 29360fa..ad0a16c 100644
@@ -21,7 +21,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/log.h"
-#include "trace.h"
+#include "target/sparc/trace.h"
 
 #define DEBUG_PCALL
 
target/sparc/mmu_helper.c +1 -1
index 044e88c..6f66c4a 100644
@@ -20,7 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
-#include "trace.h"
+#include "target/sparc/trace.h"
 #include "exec/address-spaces.h"
 
 /* Sparc MMU emulation */
target/sparc/win_helper.c +1 -1
index 2d5b546..3b6dd33 100644
@@ -21,7 +21,7 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/helper-proto.h"
-#include "trace.h"
+#include "target/sparc/trace.h"
 
 static inline void memcpy32(target_ulong *dst, const target_ulong *src)
 {
Signature · 1 line
2.9.3
#65 lore raw

PATCH v2 40/47 trace: switch target/s390x/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the target/s390x/ directory to include the target/s390x/trace.h file instead of the global trace.h file.

The make rules for gen-features.{h,c} need to be moved out into the top level Makefile.objs, otherwise make complains about the rules being defined multiple times due to target/s390x/Makefile.objs being included multiple times when expanding different subdir object lists.

---
 Makefile.objs              |  2 +-
 Makefile.target            | 23 +++++++++++++++++++++++
 target/s390x/Makefile.objs | 21 ++-------------------
 target/s390x/cpu.c         |  2 +-
 target/s390x/ioinst.c      |  2 +-
 target/s390x/kvm.c         |  2 +-
 target/s390x/mmu_helper.c  |  2 +-
 7 files changed, 30 insertions(+), 24 deletions(-)
Makefile.objs +1 -1
index cc8f506..5d50645 100644
@@ -158,7 +158,7 @@ trace-events-subdirs += net
 trace-events-subdirs += target/arm
 trace-events-subdirs += target/i386
 trace-events-subdirs += target/sparc
-trace-events-y += target/s390x/trace-events
+trace-events-subdirs += target/s390x
 trace-events-y += target/ppc/trace-events
 trace-events-y += qom/trace-events
 trace-events-y += linux-user/trace-events
Makefile.target +23 -0
index b14ab45..38ef518 100644
@@ -162,6 +162,29 @@ GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h
 
 endif # CONFIG_SOFTMMU
 
+ifeq ($(TARGET_BASE_ARCH),s390x)
+# build and run feature list generator
+feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/
+feat-dst = $(BUILD_DIR)/$(TARGET_DIR)
+ifneq ($(MAKECMDGOALS),clean)
+GENERATED_HEADERS += $(feat-dst)gen-features.h
+endif
+
+$(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp
+	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
+$(feat-dst)gen-features.h-timestamp: $(feat-dst)gen-features
+	$(call quiet-command,$< >$@,"GEN","$(TARGET_DIR)gen-features.h")
+
+$(feat-dst)gen-features: $(feat-src)gen-features.c
+	$(call quiet-command,$(HOST_CC) $(QEMU_INCLUDES) -o $@ $<,"CC","$(TARGET_DIR)gen-features")
+
+clean-target:
+	rm -f gen-features.h-timestamp
+	rm -f gen-features.h
+	rm -f gen-features
+
+endif
+
 # Workaround for http://gcc.gnu.org/PR55489, see configure.
 %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
 
target/s390x/Makefile.objs +2 -19
index c573633..98f6f95 100644
@@ -4,22 +4,5 @@ obj-y += gdbstub.o cpu_models.o cpu_features.o
 obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o
 obj-$(CONFIG_KVM) += kvm.o
 
-# build and run feature list generator
-feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/
-feat-dst = $(BUILD_DIR)/$(TARGET_DIR)
-ifneq ($(MAKECMDGOALS),clean)
-GENERATED_HEADERS += $(feat-dst)gen-features.h
-endif
-
-$(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp
-	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(feat-dst)gen-features.h-timestamp: $(feat-dst)gen-features
-	$(call quiet-command,$< >$@,"GEN","$(TARGET_DIR)gen-features.h")
-
-$(feat-dst)gen-features: $(feat-src)gen-features.c
-	$(call quiet-command,$(HOST_CC) $(QEMU_INCLUDES) -o $@ $<,"CC","$(TARGET_DIR)gen-features")
-
-clean-target:
-	rm -f gen-features.h-timestamp
-	rm -f gen-features.h
-	rm -f gen-features
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
target/s390x/cpu.c +1 -1
index 0a39d31..db92ea1 100644
@@ -30,7 +30,7 @@
 #include "qemu/cutils.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
-#include "trace.h"
+#include "target/s390x/trace.h"
 #include "qapi/visitor.h"
 #include "migration/vmstate.h"
 #include "exec/exec-all.h"
target/s390x/ioinst.c +1 -1
index 590bfa4..b2ff2fc 100644
@@ -13,7 +13,7 @@
 
 #include "cpu.h"
 #include "hw/s390x/ioinst.h"
-#include "trace.h"
+#include "target/s390x/trace.h"
 #include "hw/s390x/s390-pci-bus.h"
 
 int ioinst_disassemble_sch_ident(uint32_t value, int *m, int *cssid, int *ssid,
target/s390x/kvm.c +1 -1
index 97afe02..c861a58 100644
@@ -38,7 +38,7 @@
 #include "qapi/qmp/qjson.h"
 #include "exec/gdbstub.h"
 #include "exec/address-spaces.h"
-#include "trace.h"
+#include "target/s390x/trace.h"
 #include "qapi-event.h"
 #include "hw/s390x/s390-pci-inst.h"
 #include "hw/s390x/s390-pci-bus.h"
target/s390x/mmu_helper.c +1 -1
index b11a027..100f888 100644
@@ -20,7 +20,7 @@
 #include "exec/address-spaces.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
-#include "trace.h"
+#include "target/s390x/trace.h"
 #include "hw/s390x/storage-keys.h"
 
 /* #define DEBUG_S390 */
Signature · 1 line
2.9.3
#69 lore raw

PATCH v2 41/47 trace: switch target/ppc/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the target/ppc/ directory to include the target/ppc/trace.h file instead of the global trace.h file.

---
 Makefile.objs            | 2 +-
 target/ppc/Makefile.objs | 2 ++
 target/ppc/kvm.c         | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index 5d50645..5dbbf6c 100644
@@ -159,7 +159,7 @@ trace-events-subdirs += target/arm
 trace-events-subdirs += target/i386
 trace-events-subdirs += target/sparc
 trace-events-subdirs += target/s390x
-trace-events-y += target/ppc/trace-events
+trace-events-subdirs += target/ppc
 trace-events-y += qom/trace-events
 trace-events-y += linux-user/trace-events
 trace-events-y += qapi/trace-events
target/ppc/Makefile.objs +2 -0
index e667e69..7a71b38 100644
@@ -15,3 +15,5 @@ obj-y += misc_helper.o
 obj-y += mem_helper.o
 obj-$(CONFIG_USER_ONLY) += user_only_helper.o
 obj-y += gdbstub.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
target/ppc/kvm.c +1 -1
index 9c4834c..497c5a6 100644
@@ -39,7 +39,7 @@
 #include "hw/ppc/spapr_cpu_core.h"
 #include "hw/ppc/ppc.h"
 #include "sysemu/watchdog.h"
-#include "trace.h"
+#include "target/ppc/trace.h"
 #include "exec/gdbstub.h"
 #include "exec/memattrs.h"
 #include "sysemu/hostmem.h"
Signature · 1 line
2.9.3
#70 lore raw

PATCH v2 42/47 trace: switch qom/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the qom/ directory to include the
qom/trace.h file instead of the global trace.h
file.

---
 Makefile.objs     | 2 +-
 qom/Makefile.objs | 2 ++
 qom/object.c      | 2 +-
 qom/trace-events  | 7 +++++++
 trace-events      | 6 ------
 5 files changed, 11 insertions(+), 8 deletions(-)
Makefile.objs +1 -1
index 5dbbf6c..cfef83b 100644
@@ -160,7 +160,7 @@ trace-events-subdirs += target/i386
 trace-events-subdirs += target/sparc
 trace-events-subdirs += target/s390x
 trace-events-subdirs += target/ppc
-trace-events-y += qom/trace-events
+trace-events-subdirs += qom
 trace-events-y += linux-user/trace-events
 trace-events-y += qapi/trace-events
 
qom/Makefile.objs +2 -0
index 516349e..8cc7800 100644
@@ -1,4 +1,6 @@
 qom-obj-y = object.o container.o qom-qobject.o
 qom-obj-y += object_interfaces.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 common-obj-y = cpu.o
qom/object.c +1 -1
index 7a05e35..4e50fdd 100644
@@ -20,7 +20,7 @@
 #include "qapi/string-input-visitor.h"
 #include "qapi/string-output-visitor.h"
 #include "qapi/qmp/qerror.h"
-#include "trace.h"
+#include "qom/trace.h"
 
 /* TODO: replace QObject with a simpler visitor to avoid a dependency
  * of the QOM core on QObject?  */
qom/trace-events +7 -0
index 97db357..37c43be 100644
@@ -3,3 +3,10 @@
 # qom/object.c
 object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
 object_class_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
+
+# qom/cpu.c
+# Reset the state of a virtual (guest) CPU
+#
+# Mode: user, softmmu
+# Targets: all
+vcpu guest_cpu_reset(void)
trace-events +0 -6
index 1181486..01cd176 100644
@@ -141,12 +141,6 @@ memory_region_ram_device_write(int cpu_index, void *mr, uint64_t addr, uint64_t
 # Targets: all
 vcpu guest_cpu_enter(void)
 
-# Reset the state of a virtual (guest) CPU
-#
-# Mode: user, softmmu
-# Targets: all
-vcpu guest_cpu_reset(void)
-
 # @vaddr: Access' virtual address.
 # @info : Access' information (see below).
 #
Signature · 1 line
2.9.3
#72 lore raw

PATCH v2 44/47 trace: switch qapi/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the qapi/ directory to include the qapi/trace.h file instead of the global trace.h file.

---
 Makefile.objs          | 2 +-
 qapi/Makefile.objs     | 2 ++
 qapi/qapi-visit-core.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index abdc0a8..e8cbaa2 100644
@@ -162,7 +162,7 @@ trace-events-subdirs += target/s390x
 trace-events-subdirs += target/ppc
 trace-events-subdirs += qom
 trace-events-subdirs += linux-user
-trace-events-y += qapi/trace-events
+trace-events-subdirs += qapi
 
 trace-events-files = $(trace-events-y) $(trace-events-subdirs:%=%/trace-events)
 
qapi/Makefile.objs +2 -0
index 33906ff..3c85604 100644
@@ -4,3 +4,5 @@ util-obj-y += string-input-visitor.o string-output-visitor.o
 util-obj-y += opts-visitor.o qapi-clone-visitor.o
 util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
qapi/qapi-visit-core.c +1 -1
index 63bd97b..052d4e1 100644
@@ -19,7 +19,7 @@
 #include "qapi/qmp/qerror.h"
 #include "qapi/visitor.h"
 #include "qapi/visitor-impl.h"
-#include "trace.h"
+#include "qapi/trace.h"
 
 void visit_complete(Visitor *v, void *opaque)
 {
Signature · 1 line
2.9.3
#71 lore raw

PATCH v2 43/47 trace: switch linux-user/ directory to modular trace.h file

In reply to Daniel P. Berrange

Switch files in the linux-user/ directory to include the linux-user/trace.h file instead of the global trace.h file.

---
 Makefile.objs            | 2 +-
 linux-user/Makefile.objs | 2 ++
 linux-user/signal.c      | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
Makefile.objs +1 -1
index cfef83b..abdc0a8 100644
@@ -161,7 +161,7 @@ trace-events-subdirs += target/sparc
 trace-events-subdirs += target/s390x
 trace-events-subdirs += target/ppc
 trace-events-subdirs += qom
-trace-events-y += linux-user/trace-events
+trace-events-subdirs += linux-user
 trace-events-y += qapi/trace-events
 
 trace-events-files = $(trace-events-y) $(trace-events-subdirs:%=%/trace-events)
linux-user/Makefile.objs +2 -0
index 8c93058..7a05775 100644
@@ -6,3 +6,5 @@ obj-$(TARGET_HAS_BFLT) += flatload.o
 obj-$(TARGET_I386) += vm86.o
 obj-$(TARGET_ARM) += arm/nwfpe/
 obj-$(TARGET_M68K) += m68k-sim.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
linux-user/signal.c +1 -1
index c750053..8bc327c 100644
@@ -24,7 +24,7 @@
 #include "qemu.h"
 #include "qemu-common.h"
 #include "target_signal.h"
-#include "trace.h"
+#include "linux-user/trace.h"
 
 static struct target_sigaltstack target_sigaltstack_used = {
     .ss_sp = 0,
Signature · 1 line
2.9.3
#73 lore raw

PATCH v2 45/47 trace: remove the global include/trace.h file

In reply to Daniel P. Berrange

Switch to generating top level trace.[hc] files, instead of using include/trace.h with trace/generated-tracers.[ch], so the top level directory works in the same manner as all the sub-dirs.

---
 .gitignore                               | 10 ++--
 Makefile                                 | 64 +++++++++++++++++------
 Makefile.objs                            |  8 +--
 include/trace.h                          |  6 ---
 scripts/tracetool/backend/dtrace.py      |  7 +--
 scripts/tracetool/backend/ust.py         |  7 +--
 scripts/tracetool/format/ust_events_c.py |  2 +-
 scripts/tracetool/format/ust_events_h.py |  2 +-
 trace/Makefile.objs                      | 90 --------------------------------
 9 files changed, 61 insertions(+), 135 deletions(-)
 delete mode 100644 include/trace.h
.gitignore +3 -7
index fe6add3..79ae620 100644
@@ -6,18 +6,14 @@
 /config.status
 /config-temp
 /trace-events-all
-/trace/generated-tracers.h
-/trace/generated-tracers.c
-/trace/generated-tracers-dtrace.h
-/trace/generated-tracers.dtrace
 /trace/generated-events.h
 /trace/generated-events.c
 /trace/generated-helpers-wrappers.h
 /trace/generated-helpers.h
 /trace/generated-helpers.c
 /trace/generated-tcg-tracers.h
-/trace/generated-ust-provider.h
-/trace/generated-ust.c
+/trace/trace-ust-all.h
+/trace/trace-ust-all.c
 /ui/shader/texture-blit-frag.h
 /ui/shader/texture-blit-vert.h
 *-timestamp
@@ -113,7 +109,7 @@ docker-src.*
 *~
 trace.h
 trace.c
-trace-events-common
+trace-ust.h
 trace-ust.h
 trace-dtrace.h
 trace-dtrace.dtrace
Makefile +49 -15

90 lines not on this page · raw message

Makefile.objs +5 -3
index e8cbaa2..b53a6fb 100644
@@ -119,7 +119,6 @@ ivshmem-server-obj-y = contrib/ivshmem-server/
 
 ######################################################################
 trace-events-subdirs =
-trace-events-y = trace-events
 trace-events-subdirs += util
 trace-events-subdirs += crypto
 trace-events-subdirs += io
@@ -164,6 +163,9 @@ trace-events-subdirs += qom
 trace-events-subdirs += linux-user
 trace-events-subdirs += qapi
 
-trace-events-files = $(trace-events-y) $(trace-events-subdirs:%=%/trace-events)
+trace-events-files = trace-events $(trace-events-subdirs:%=%/trace-events)
 
-trace-obj-y = $(trace-events-subdirs:%=%/)
+trace-obj-y = trace.o
+trace-obj-$(CONFIG_TRACE_UST) += trace-ust-all.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
+trace-obj-y += $(trace-events-subdirs:%=%/)
include/trace.h deleted +0 -6
deleted file mode 100644
index ac9ff3d..0000000
@@ -1,6 +0,0 @@
-#ifndef TRACE_H
-#define TRACE_H
-
-#include "trace/generated-tracers.h"
-
-#endif /* TRACE_H */
scripts/tracetool/backend/dtrace.py +1 -6
index 1319990..6df33fc 100644
@@ -36,12 +36,7 @@ def binary():
 
 
 def generate_h_begin(events, group):
-    if group == "common":
-        include = "trace/generated-tracers-dtrace.h"
-    else:
-        include = "trace-dtrace.h"
-
-    out('#include "%s"' % include,
+    out('#include "trace-dtrace.h"',
         '')
 
 
scripts/tracetool/backend/ust.py +1 -6
index 599c12e..92b2837 100644
@@ -20,13 +20,8 @@ PUBLIC = True
 
 
 def generate_h_begin(events, group):
-    if group == "common":
-        include = "trace/generated-ust-provider.h"
-    else:
-        include = "trace-ust.h"
-
     out('#include <lttng/tracepoint.h>',
-        '#include "%s"' % include,
+        '#include "trace-ust.h"',
         '')
 
 
scripts/tracetool/format/ust_events_c.py +1 -1
index 8be8116..264784c 100644
@@ -32,4 +32,4 @@ def generate(events, backend, group):
         ' */',
         '#pragma GCC diagnostic ignored "-Wredundant-decls"',
         '',
-        '#include "generated-ust-provider-all.h"')
+        '#include "trace-ust-all.h"')
scripts/tracetool/format/ust_events_h.py +1 -1
index 6fbdb9f..80574ed 100644
@@ -21,7 +21,7 @@ def generate(events, backend, group):
               if "disabled" not in e.properties]
 
     if group == "common":
-        include = "generated-ust-provider.h"
+        include = "trace-ust-all.h"
     else:
         include = "trace-ust.h"
 
trace/Makefile.objs +0 -90

104 lines not on this page · raw message

Signature · 1 line
2.9.3
#74 lore raw

PATCH v2 46/47 trace: update docs to reflect new code generation approach

In reply to Daniel P. Berrange

Describe use of per-subdir trace events files and how it impacts code generation.

---
 docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 52 insertions(+), 9 deletions(-)
docs/tracing.txt +52 -9
index f351998a..3262a61 100644
@@ -27,18 +27,51 @@ for debugging, profiling, and observing execution.
 
 == Trace events ==
 
+=== Sub-directory setup ===
+
 Each directory in the source tree can declare a set of static trace events
-in a "trace-events" file. Each trace event declaration names the event, its
-arguments, and the format string which can be used for pretty-printing:
+in a "trace-events" file. The first (non-comment) statement in the file
+must be "@id_offset(NN)" where NN is an integer that is unique among all
+"trace-events" files in the QEMU source tree. The IDs can be arbitrarily
+chosen, but for extra fun the current "trace-events" files use values from
+the "powerful number" integer sequence :-)
 
-    qemu_vmalloc(size_t size, void *ptr) "size %zu ptr %p"
-    qemu_vfree(void *ptr) "ptr %p"
+Any subdirectory which contains a "trace-events" file must be listed in the
+"trace-events-subdirs" make variable in the top level Makefile.objs. During
+build, the "trace-events" file in each listed subdirectory will be processed
+by the "tracetool" script to generate code for the trace events.
+
+The individual "trace-events" files are merged together into a "trace-events-all"
+file, which is also installed into "/usr/share/qemu" with the name "trace-events".
+This merge file is to be used by the "simpletrace.py" script to later analyse
+traces in the simpletrace data format.
+
+The Makefile.objs in the subdirectory should have two lines added
+
+  trace-obj-y += trace.o
+  trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
+
+In the sub-directory the following files will be automatically generated
+
+ - trace.c - the trace event state declarations
+ - trace.h - the trace event enums and probe functions
+ - trace-dtrace.h - DTrace speci
+ - trace-dtrace.dtrace - DTrace event probe helper declaration
+ - trace-dtrace.o - binary DTrace provider (generated by dtrace)
+ - trace-ust.h - UST event probe helper declarations
+
+Source files in the sub-directory should only #include the 'trace.h'
+file and use the full sub-directory path. eg io/channel-buffer.c
+would do
 
-All "trace-events" files must be listed in the "trace-event-y" make variable
-in the top level Makefile.objs. During build the individual files are combined
-to create a "trace-events-all" file, which is processed by the "tracetool"
-script during build to generate code for the trace events. The
-"trace-events-all" file is also installed into "/usr/share/qemu".
+  #include "io/trace.h"
+
+While it is permited to include a trace.h file from outside a source
+files' own sub-directory, this is discouraged in general. It is strongly
+preferred that all events be declared directly in the sub-directory that
+uses them.
+
+=== Using trace events ===
 
 Trace events are invoked directly from source code like this:
 
@@ -83,6 +116,13 @@ Format strings should reflect the types defined in the trace event.  Take
 special care to use PRId64 and PRIu64 for int64_t and uint64_t types,
 respectively.  This ensures portability between 32- and 64-bit platforms.
 
+Each event declaration will start with the event name, then its arguments,
+finally a format string for pretty-printing. For example:
+
+    qemu_vmalloc(size_t size, void *ptr) "size %zu ptr %p"
+    qemu_vfree(void *ptr) "ptr %p"
+
+
 === Hints for adding new trace events ===
 
 1. Trace state changes in the code.  Interesting points in the code usually
@@ -372,6 +412,9 @@ information. If used together with the "tcg" property, it adds a second
 "TCGv_env" argument that must point to the per-target global TCG register that
 points to the vCPU when guest code is executed (usually the "cpu_env" variable).
 
+All "vcpu" events *must* be declared in the top level "trace-events" file. It
+is not permitted to have them declared in sub-directories.
+
 The following example events:
 
     foo(uint32_t a) "a=%x"
Signature · 1 line
2.9.3
#77 lore raw

PATCH v2 47/47 trace: improve error reporting when parsing simpletrace header

In reply to Daniel P. Berrange

When loading a simpletrace binary file we just report "Not a valid trace file!" which is not very helpful. Report exactly which field we found to be invalid.

---
 scripts/simpletrace.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
scripts/simpletrace.py +7 -3
index 4ca903d..4c99004 100755
@@ -73,10 +73,14 @@ def read_record(edict, idtoname, fobj):
 def read_trace_header(fobj):
     """Read and verify trace file header"""
     header = read_header(fobj, log_header_fmt)
-    if header is None or \
-       header[0] != header_event_id or \
-       header[1] != header_magic:
+    if header is None:
         raise ValueError('Not a valid trace file!')
+    if header[0] != header_event_id:
+        raise ValueError('Not a valid trace file, header id %d != %d' %
+                         (header[0], header_event_id))
+    if header[1] != header_magic:
+        raise ValueError('Not a valid trace file, header magic %d != %d' %
+                         (header[1], header_magic))
 
     log_version = header[2]
     if log_version not in [0, 2, 3, 4]:
Signature · 1 line
2.9.3
#80 lore raw
In reply to Daniel P. Berrange
Quoted 26 lines · Daniel P. Berrange

This is the final part of my trace events refactoring.

Previously we merged code that split trace-events up into one file per sub-directory. We also merged code to the code-generator that enables us to generate and use multiple independant sets of trace events.

This is the final glue that makes use of these two earlier changes, so that we actually generate a separate trace.h & trace.c file per sub-directory.

The result is that when adding a new trace event to a file, only files in that sub-directory get rebuilt. Theoretically the build is faster too, since each source file includes a much smaller trace.h that only contains probes relevant to it. In reality this speed benefit is probably marginal & lost in the noise.

The first patch introduces the new Makefile rules to handle modular building.

The next 43 patches convert over each sub-directory. They are totally boring and repetative. The only exception is the patch for target/s390x which hit a bit of makefile pain, explained in its commit msg.

Quoted 7 lines

The 45th patch removes the old, now unused, Makefile rules for non-modular trace building.

The 46th patch documents the new approach

The final patch is just a small tweak to error reporting, unrelated to the refactoring.

Oh I should say I tested this with

./configure --enable-trace-backends=log,simple,ust,nop,dtrace,ftrace,syslog

ie, all user + system emulators enabled and all trace backends enabled.

Before rebasing to current git master I had also done the same, testing against each patch in the series, so it should be fully bisectable. It's also been through the standard travis tests.

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#81 lore raw
In reply to Daniel P. Berrange
Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

Hi,

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

Subject: [Qemu-devel] [PATCH v2 00/47] Switch all subdirs over to modular trace.h file
Message-id: [email protected]
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=16
make docker-test-quick@centos6
make docker-test-mingw@fedora
make docker-test-build@min-glib
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
eadd34c trace: improve error reporting when parsing simpletrace header 076c183 trace: update docs to reflect new code generation approach 56abbd5 trace: remove the global include/trace.h file 73c3b5d trace: switch qapi/ directory to modular trace.h file 33504fb trace: switch linux-user/ directory to modular trace.h file 6419084 trace: switch qom/ directory to modular trace.h file 7457a87 trace: switch target/ppc/ directory to modular trace.h file 0b41d5c trace: switch target/s390x/ directory to modular trace.h file b42b6c3 trace: switch target/sparc/ directory to modular trace.h file 1307ebe trace: switch target/i386/ directory to modular trace.h file 6e542cd trace: switch target/arm/ directory to modular trace.h file 22ba2b6 trace: switch net/ directory to modular trace.h file b4543ff trace: switch audio/ directory to modular trace.h file db9e252 trace: switch ui/ directory to modular trace.h file 25c8624 trace: switch hw/alpha/ directory to modular trace.h file 49d55bd trace: switch hw/arm/ directory to modular trace.h file 3ba684c trace: switch hw/acpi/ directory to modular trace.h file 8ddce57 trace: switch hw/vfio/ directory to modular trace.h file 1260fe3 trace: switch hw/s390x/ directory to modular trace.h file 7a75eba trace: switch hw/pci/ directory to modular trace.h file f832114 trace: switch hw/ppc/ directory to modular trace.h file 272c571 trace: switch hw/9pfs/ directory to modular trace.h file 4892099 trace: switch hw/i386/ directory to modular trace.h file 91709d5 trace: switch hw/mem/ directory to modular trace.h file 68b9a83 trace: switch hw/isa/ directory to modular trace.h file b5b830d trace: switch hw/sd/ directory to modular trace.h file cb676b1 trace: switch hw/sparc/ directory to modular trace.h file bac0e03 trace: switch hw/dma/ directory to modular trace.h file 76d03a3 trace: switch hw/timer/ directory to modular trace.h file 07da4f5 trace: switch hw/input/ directory to modular trace.h file be5e938 trace: switch hw/display/ directory to modular trace.h file eaf5f53 trace: switch hw/nvram/ directory to modular trace.h file 5a85878 trace: switch hw/scsi/ directory to modular trace.h file 9bcc3ef trace: switch hw/usb/ directory to modular trace.h file 174956d trace: switch hw/misc/ directory to modular trace.h file 00912c2 trace: switch hw/audio/ directory to modular trace.h file cc6dd6e trace: switch hw/virtio/ directory to modular trace.h file 83851d0 trace: switch hw/net/ directory to modular trace.h file c999aa6 trace: switch hw/intc/ directory to modular trace.h file ce8c290 trace: switch hw/char/ directory to modular trace.h file 095ad47 trace: switch hw/block/ directory to modular trace.h file 5e7dfd2 trace: switch block/ directory to modular trace.h file b95f06b trace: switch migration/ directory to modular trace.h file bf46cdf trace: switch crypto/ directory to modular trace.h file 308c34b trace: switch util/ directory to modular trace.h file e0e2728 trace: switch io/ directory to modular trace.h file cabc296 trace: introduce some Makefile rules for module code gen

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc' Cloning into 'dtc'...
Submodule path 'dtc': checked out '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf'
BUILD centos6
make[1]: Entering directory `/var/tmp/patchew-tester-tmp-x9xsss8m/src'
ARCHIVE qemu.tgz
ARCHIVE dtc.tgz
COPY RUNNER
RUN test-quick in qemu:centos6
Packages installed:
SDL-devel-1.2.14-7.el6_7.1.x86_64
ccache-3.1.6-2.el6.x86_64
epel-release-6-8.noarch
gcc-4.4.7-17.el6.x86_64
git-1.7.1-4.el6_7.1.x86_64
glib2-devel-2.28.8-5.el6.x86_64
libfdt-devel-1.4.0-1.el6.x86_64
make-3.81-23.el6.x86_64
package g++ is not installed
pixman-devel-0.32.8-1.el6.x86_64
tar-1.23-15.el6_8.x86_64
zlib-devel-1.2.3-29.el6.x86_64

Environment variables:
PACKAGES=libfdt-devel ccache tar git make gcc g++ zlib-devel glib2-devel SDL-devel pixman-devel epel-release
HOSTNAME=8c2845dd82aa
TERM=xterm
MAKEFLAGS= -j16
HISTSIZE=1000
J=16
USER=root
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
MAIL=/var/spool/mail/root PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/
LANG=en_US.UTF-8
TARGET_LIST=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
FEATURES= dtc
DEBUG=
G_BROKEN_FILENAMES=1
CCACHE_HASHDIR=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/var/tmp/qemu-build/install No C++ compiler available; disabling C++ specific optional code

Install prefix    /var/tmp/qemu-build/install
BIOS directory    /var/tmp/qemu-build/install/share/qemu
binary directory  /var/tmp/qemu-build/install/bin

library directory /var/tmp/qemu-build/install/lib module directory /var/tmp/qemu-build/install/lib/qemu libexec directory /var/tmp/qemu-build/install/libexec include directory /var/tmp/qemu-build/install/include config directory /var/tmp/qemu-build/install/etc
local state directory /var/tmp/qemu-build/install/var
Manual directory /var/tmp/qemu-build/install/share/man ELF interp prefix /usr/gnemul/qemu-%M

Source path       /tmp/qemu-test/src
C compiler        cc
Host C compiler   cc
C++ compiler      
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1    -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
pixman            system
SDL support       yes (1.2.14)
GTK support       no 
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    no
GNUTLS rnd        no
libgcrypt         no
libgcrypt kdf     no
nettle            no 
nettle kdf        no
libtasn1          no
curses support    no
virgl support     no
curl support      no
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
VNC support       yes
VNC SASL support  no
VNC JPEG support  no
VNC PNG support   no
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               yes
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
COLO support      yes
RDMA support      no
TCG interpreter   no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes

libcap-ng support no
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes

Trace backends    log
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no

build guest agent yes
QGA VSS support no
QGA w32 disk info no
QGA MSI support no
seccomp support no
coroutine backend ucontext
coroutine pool yes
debug stack usage no
GlusterFS support no
Archipelago support no

gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   yes
QOM debugging     yes
lzo support       no
snappy support    no
bzip2 support     no

NUMA host support no
tcmalloc support no
jemalloc support no
avx2 optimization no
replication support yes

  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
  GEN     qemu-options.def
  GEN     qmp-commands.h
  GEN     qapi-types.h
  GEN     qapi-visit.h
  GEN     trace.h
  GEN     qapi-event.h
  GEN     qmp-introspect.h
  GEN     module_block.h
  GEN     util/trace.h
  GEN     crypto/trace.h
  GEN     io/trace.h
  GEN     migration/trace.h
  GEN     block/trace.h
  GEN     x86_64-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     hw/block/trace.h
  GEN     hw/char/trace.h
  GEN     hw/intc/trace.h
  GEN     hw/net/trace.h
  GEN     hw/virtio/trace.h
  GEN     hw/audio/trace.h
  GEN     hw/misc/trace.h
  GEN     hw/usb/trace.h
  GEN     hw/scsi/trace.h
  GEN     hw/nvram/trace.h
  GEN     hw/display/trace.h
  GEN     hw/input/trace.h
  GEN     hw/timer/trace.h
  GEN     hw/dma/trace.h
  GEN     hw/sparc/trace.h
  GEN     hw/sd/trace.h
  GEN     hw/isa/trace.h
  GEN     hw/mem/trace.h
  GEN     hw/i386/trace.h
  GEN     hw/9pfs/trace.h
  GEN     hw/ppc/trace.h
  GEN     hw/pci/trace.h
  GEN     hw/s390x/trace.h
  GEN     hw/vfio/trace.h
  GEN     hw/acpi/trace.h
  GEN     hw/arm/trace.h
  GEN     hw/alpha/trace.h
  GEN     ui/trace.h
  GEN     audio/trace.h
  GEN     net/trace.h
  GEN     target/arm/trace.h
  GEN     target/i386/trace.h
  GEN     target/sparc/trace.h
  GEN     target/s390x/trace.h
  GEN     target/ppc/trace.h
  GEN     qom/trace.h
  GEN     linux-user/trace.h
  GEN     qapi/trace.h
  GEN     tests/test-qapi-types.h
  GEN     tests/test-qapi-visit.h
  GEN     tests/test-qmp-commands.h
  GEN     tests/test-qapi-event.h
  GEN     tests/test-qmp-introspect.h
  GEN     config-all-devices.mak
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  CC      tests/qemu-iotests/socket_scm_helper.o
  GEN     qga/qapi-generated/qga-qapi-types.h
  GEN     qga/qapi-generated/qga-qapi-visit.h
  GEN     qga/qapi-generated/qga-qmp-commands.h
  GEN     qga/qapi-generated/qga-qapi-types.c
  GEN     qga/qapi-generated/qga-qapi-visit.c
  GEN     qga/qapi-generated/qga-qmp-marshal.c
  GEN     crypto/trace.c
  GEN     trace.c
  GEN     audio/trace.c
  GEN     block/trace.c
  GEN     hw/9pfs/trace.c
  GEN     hw/acpi/trace.c
  GEN     hw/alpha/trace.c
  GEN     hw/arm/trace.c
  GEN     hw/audio/trace.c
  GEN     hw/block/trace.c
  GEN     hw/char/trace.c
  GEN     hw/display/trace.c
  GEN     hw/dma/trace.c
  GEN     hw/i386/trace.c
  GEN     hw/input/trace.c
  GEN     hw/intc/trace.c
  GEN     hw/isa/trace.c
  GEN     hw/mem/trace.c
  GEN     hw/misc/trace.c
  GEN     hw/net/trace.c
  GEN     hw/nvram/trace.c
  GEN     hw/pci/trace.c
  GEN     hw/ppc/trace.c
  GEN     hw/s390x/trace.c
  GEN     hw/scsi/trace.c
  GEN     hw/sd/trace.c
  GEN     hw/sparc/trace.c
  GEN     hw/timer/trace.c
  GEN     hw/usb/trace.c
  GEN     hw/vfio/trace.c
  GEN     hw/virtio/trace.c
  GEN     io/trace.c
  GEN     linux-user/trace.c
  GEN     migration/trace.c
  GEN     net/trace.c
  GEN     qapi/trace.c
  GEN     qom/trace.c
  GEN     target/arm/trace.c
  GEN     target/i386/trace.c
  GEN     target/ppc/trace.c
  GEN     target/s390x/trace.c
  GEN     target/sparc/trace.c
  GEN     ui/trace.c
  GEN     util/trace.c
  GEN     qmp-introspect.c
  GEN     qapi-types.c
  GEN     qapi-visit.c
  GEN     qapi-event.c
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qint.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qfloat.o
  CC      qobject/qbool.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/compatfd.o
  CC      util/mmap-alloc.o
  CC      util/event_notifier-posix.o
  CC      util/oslib-posix.o
  CC      util/qemu-openpty.o
  CC      util/qemu-thread-posix.o
  CC      util/memfd.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/acl.o
  CC      util/fifo8.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/throttle.o
  CC      util/uuid.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-ucontext.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset-add-fd.o
  CC      stubs/fdset-find-fd.o
  CC      stubs/fdset-get-fd.o
  CC      stubs/fdset-remove-fd.o
  CC      stubs/gdbstub.o
  CC      stubs/get-fd.o
  CC      stubs/get-next-serial.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/mon-is-qmp.o
  CC      stubs/monitor-init.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/replay-user.o
  CC      stubs/reset.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/kvm.o
  CC      stubs/cpus.o
  CC      stubs/qmp_pc_dimm_device_list.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/vhost.o
  CC      stubs/iohandler.o
  CC      stubs/smbios_type_38.o
  CC      stubs/ipmi.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      contrib/ivshmem-client/ivshmem-client.o
  CC      stubs/migration-colo.o
  CC      contrib/ivshmem-server/ivshmem-server.o
  CC      contrib/ivshmem-client/main.o
  CC      contrib/ivshmem-server/main.o
  CC      qemu-nbd.o
  CC      async.o
  CC      thread-pool.o
  CC      block.o
  CC      blockjob.o
  CC      main-loop.o
  CC      iohandler.o
  CC      qemu-timer.o
  CC      aio-posix.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw_bsd.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
  CC      block/cloop.o
  CC      block/bochs.o
  CC      block/vpc.o
  CC      block/vvfat.o
  CC      block/dmg.o
  CC      block/qcow2.o
  CC      block/qcow2-refcount.o
  CC      block/qcow2-cluster.o
  CC      block/qcow2-snapshot.o
  CC      block/qcow2-cache.o
  CC      block/qed.o
  CC      block/qed-gencb.o
  CC      block/qed-l2-cache.o
  CC      block/qed-table.o
  CC      block/qed-cluster.o
  CC      block/qed-check.o
  CC      block/vhdx.o
  CC      block/vhdx-endian.o
  CC      block/vhdx-log.o
  CC      block/quorum.o
  CC      block/parallels.o
  CC      block/blkdebug.o
  CC      block/blkverify.o
  CC      block/blkreplay.o
  CC      block/block-backend.o
  CC      block/snapshot.o
  CC      block/qapi.o
  CC      block/raw-posix.o
  CC      block/null.o
  CC      block/mirror.o
  CC      block/commit.o
  CC      block/io.o
  CC      block/throttle-groups.o
  CC      block/nbd.o
  CC      block/nbd-client.o
  CC      block/sheepdog.o
  CC      block/accounting.o
  CC      block/dirty-bitmap.o
  CC      block/write-threshold.o
  CC      block/backup.o
  CC      block/replication.o
  CC      block/crypto.o
  CC      nbd/server.o
  CC      nbd/client.o
  CC      nbd/common.o
  CC      crypto/init.o
  CC      crypto/hash.o
  CC      crypto/hash-glib.o
  CC      crypto/hmac.o
  CC      crypto/hmac-glib.o
  CC      crypto/desrfb.o
  CC      crypto/aes.o
  CC      crypto/cipher.o
  CC      crypto/tlscreds.o
  CC      crypto/tlscredsanon.o
  CC      crypto/tlscredsx509.o
  CC      crypto/tlssession.o
  CC      crypto/secret.o
  CC      crypto/random-platform.o
  CC      crypto/pbkdf.o
  CC      crypto/ivgen.o
  CC      crypto/ivgen-essiv.o
  CC      crypto/ivgen-plain.o
  CC      crypto/ivgen-plain64.o
  CC      crypto/afsplit.o
  CC      crypto/xts.o
  CC      crypto/block.o
  CC      crypto/block-qcow.o
  CC      crypto/block-luks.o
  CC      io/channel.o
  CC      io/channel-command.o
  CC      io/channel-buffer.o
  CC      io/channel-file.o
  CC      io/channel-socket.o
  CC      io/channel-tls.o
  CC      io/channel-watch.o
  CC      io/channel-websock.o
  CC      io/channel-util.o
  CC      io/task.o
  CC      qom/object.o
  CC      qom/container.o
  CC      qom/qom-qobject.o
  CC      qom/object_interfaces.o
  GEN     qemu-img-cmds.h
  CC      qemu-io.o
  CC      qemu-bridge-helper.o
  CC      blockdev.o
  CC      blockdev-nbd.o
  CC      iothread.o
  CC      qdev-monitor.o
  CC      device-hotplug.o
  CC      os-posix.o
  CC      qemu-char.o
  CC      page_cache.o
  CC      accel.o
  CC      bt-host.o
  CC      bt-vhci.o
  CC      dma-helpers.o
  CC      vl.o
  CC      tpm.o
  GEN     qmp-marshal.c
  CC      device_tree.o
  CC      qmp.o
  CC      hmp.o
  CC      cpus-common.o
  CC      audio/audio.o
  CC      audio/noaudio.o
  CC      audio/wavaudio.o
  CC      audio/mixeng.o
  CC      audio/sdlaudio.o
  CC      audio/ossaudio.o
  CC      audio/wavcapture.o
  CC      backends/rng.o
  CC      backends/rng-egd.o
  CC      backends/rng-random.o
  CC      backends/msmouse.o
  CC      backends/testdev.o
  CC      backends/tpm.o
  CC      backends/hostmem.o
  CC      backends/hostmem-ram.o
  CC      backends/hostmem-file.o
  CC      backends/cryptodev.o
  CC      block/stream.o
  CC      backends/cryptodev-builtin.o
  CC      disas/arm.o
  CC      disas/i386.o
  CC      fsdev/qemu-fsdev-dummy.o
  CC      fsdev/qemu-fsdev-opts.o
  CC      hw/acpi/core.o
  CC      hw/acpi/piix4.o
  CC      hw/acpi/pcihp.o
  CC      hw/acpi/ich9.o
  CC      hw/acpi/tco.o
  CC      hw/acpi/cpu_hotplug.o
  CC      hw/acpi/memory_hotplug.o
  CC      hw/acpi/memory_hotplug_acpi_table.o
  CC      hw/acpi/cpu.o
  CC      hw/acpi/nvdimm.o
  CC      hw/acpi/acpi_interface.o
  CC      hw/acpi/bios-linker-loader.o
  CC      hw/acpi/aml-build.o
  CC      hw/audio/sb16.o
  CC      hw/acpi/ipmi.o
  CC      hw/audio/es1370.o
  CC      hw/audio/ac97.o
  CC      hw/audio/fmopl.o
  CC      hw/audio/adlib.o
  CC      hw/audio/gus.o
  CC      hw/audio/gusemu_hal.o
  CC      hw/audio/gusemu_mixer.o
  CC      hw/audio/cs4231a.o
  CC      hw/audio/hda-codec.o
  CC      hw/audio/intel-hda.o
  CC      hw/audio/pcspk.o
  CC      hw/audio/wm8750.o
  CC      hw/audio/pl041.o
  CC      hw/audio/lm4549.o
  CC      hw/audio/marvell_88w8618.o
  CC      hw/block/block.o
  CC      hw/block/cdrom.o
  CC      hw/block/hd-geometry.o
  CC      hw/block/fdc.o
  CC      hw/block/m25p80.o
  CC      hw/block/pflash_cfi01.o
  CC      hw/block/nand.o
  CC      hw/block/pflash_cfi02.o
  CC      hw/block/ecc.o
  CC      hw/block/onenand.o
  CC      hw/block/nvme.o
  CC      hw/bt/core.o
  CC      hw/bt/l2cap.o
  CC      hw/bt/sdp.o
  CC      hw/bt/hci.o
  CC      hw/bt/hid.o
  CC      hw/bt/hci-csr.o
  CC      hw/char/ipoctal232.o
  CC      hw/char/parallel.o
  CC      hw/char/pl011.o
  CC      hw/char/serial.o
  CC      hw/char/serial-isa.o
  CC      hw/char/serial-pci.o
  CC      hw/char/virtio-console.o
  CC      hw/char/cadence_uart.o
  CC      hw/char/debugcon.o
  CC      hw/char/imx_serial.o
  CC      hw/core/qdev.o
  CC      hw/core/qdev-properties.o
  CC      hw/core/bus.o
  CC      hw/core/fw-path-provider.o
  CC      hw/core/irq.o
  CC      hw/core/hotplug.o
  CC      hw/core/ptimer.o
  CC      hw/core/sysbus.o
  CC      hw/core/machine.o
  CC      hw/core/null-machine.o
  CC      hw/core/loader.o
  CC      hw/core/qdev-properties-system.o
  CC      hw/core/register.o
  CC      hw/core/or-irq.o
  CC      hw/core/platform-bus.o
  CC      hw/display/ads7846.o
  CC      hw/display/cirrus_vga.o
  CC      hw/display/pl110.o
  CC      hw/display/ssd0303.o
  CC      hw/display/ssd0323.o
  CC      hw/display/vga-pci.o
  CC      hw/display/vga-isa.o
  CC      hw/display/vmware_vga.o
  CC      hw/display/blizzard.o
  CC      hw/display/exynos4210_fimd.o
  CC      hw/display/framebuffer.o
  CC      hw/display/tc6393xb.o
  CC      hw/dma/pl080.o
  CC      hw/dma/pl330.o
  CC      hw/dma/i8257.o
  CC      hw/dma/xlnx-zynq-devcfg.o
  CC      hw/gpio/max7310.o
  CC      hw/gpio/pl061.o
  CC      hw/gpio/zaurus.o
  CC      hw/gpio/gpio_key.o
  CC      hw/i2c/core.o
  CC      hw/i2c/smbus.o
  CC      hw/i2c/smbus_eeprom.o
  CC      hw/i2c/i2c-ddc.o
  CC      hw/i2c/versatile_i2c.o
  CC      hw/i2c/smbus_ich9.o
  CC      hw/i2c/pm_smbus.o
  CC      hw/i2c/bitbang_i2c.o
  CC      hw/i2c/exynos4210_i2c.o
  CC      hw/i2c/imx_i2c.o
  CC      hw/i2c/aspeed_i2c.o
  CC      hw/ide/core.o
  CC      hw/ide/atapi.o
  CC      hw/ide/qdev.o
  CC      hw/ide/pci.o
  CC      hw/ide/piix.o
  CC      hw/ide/isa.o
  CC      hw/ide/microdrive.o
  CC      hw/ide/ahci.o
  CC      hw/input/hid.o
  CC      hw/ide/ich.o
  CC      hw/input/lm832x.o
  CC      hw/input/pckbd.o
  CC      hw/input/pl050.o
  CC      hw/input/ps2.o
  CC      hw/input/stellaris_input.o
  CC      hw/input/tsc2005.o
  CC      hw/input/vmmouse.o
  CC      hw/input/virtio-input.o
  CC      hw/input/virtio-input-hid.o
  CC      hw/input/virtio-input-host.o
  CC      hw/intc/i8259_common.o
  CC      hw/intc/i8259.o
  CC      hw/intc/pl190.o
  CC      hw/intc/imx_avic.o
  CC      hw/intc/realview_gic.o
  CC      hw/intc/ioapic_common.o
  CC      hw/intc/arm_gic_common.o
  CC      hw/intc/arm_gic.o
  CC      hw/intc/arm_gicv2m.o
  CC      hw/intc/arm_gicv3_common.o
  CC      hw/intc/arm_gicv3.o
  CC      hw/intc/arm_gicv3_dist.o
  CC      hw/intc/arm_gicv3_redist.o
  CC      hw/intc/arm_gicv3_its_common.o
  CC      hw/intc/intc.o
  CC      hw/ipack/ipack.o
  CC      hw/ipack/tpci200.o
  CC      hw/ipmi/ipmi.o
  CC      hw/ipmi/ipmi_bmc_sim.o
  CC      hw/ipmi/ipmi_bmc_extern.o
  CC      hw/ipmi/isa_ipmi_kcs.o
  CC      hw/ipmi/isa_ipmi_bt.o
  CC      hw/isa/isa-bus.o
  CC      hw/isa/apm.o

/tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_update’:
/tmp/qemu-test/src/hw/char/pl011.c:62: warning: implicit declaration of function ‘trace_pl011_irq_state’ /tmp/qemu-test/src/hw/char/pl011.c:62: warning: nested extern declaration of ‘trace_pl011_irq_state’ /tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_read’:
/tmp/qemu-test/src/hw/char/pl011.c:87: warning: implicit declaration of function ‘trace_pl011_read_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:87: warning: nested extern declaration of ‘trace_pl011_read_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:139: warning: implicit declaration of function ‘trace_pl011_read’ /tmp/qemu-test/src/hw/char/pl011.c:139: warning: nested extern declaration of ‘trace_pl011_read’ /tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_write’:
/tmp/qemu-test/src/hw/char/pl011.c:163: warning: implicit declaration of function ‘trace_pl011_write’ /tmp/qemu-test/src/hw/char/pl011.c:163: warning: nested extern declaration of ‘trace_pl011_write’ /tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_can_receive’:
/tmp/qemu-test/src/hw/char/pl011.c:237: warning: implicit declaration of function ‘trace_pl011_can_receive’ /tmp/qemu-test/src/hw/char/pl011.c:237: warning: nested extern declaration of ‘trace_pl011_can_receive’ /tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_put_fifo’:
/tmp/qemu-test/src/hw/char/pl011.c:252: warning: implicit declaration of function ‘trace_pl011_put_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:252: warning: nested extern declaration of ‘trace_pl011_put_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:254: warning: implicit declaration of function ‘trace_pl011_put_fifo_full’ /tmp/qemu-test/src/hw/char/pl011.c:254: warning: nested extern declaration of ‘trace_pl011_put_fifo_full’

  CC      hw/mem/pc-dimm.o
  CC      hw/mem/nvdimm.o
  CC      hw/misc/applesmc.o
  CC      hw/misc/max111x.o
  CC      hw/misc/tmp105.o
  CC      hw/misc/debugexit.o
  CC      hw/misc/sga.o
  CC      hw/misc/pc-testdev.o
  CC      hw/misc/pci-testdev.o
  CC      hw/misc/arm_l2x0.o
  CC      hw/misc/arm_integrator_debug.o
  CC      hw/misc/a9scu.o
  CC      hw/misc/arm11scu.o
  CC      hw/net/ne2000.o
  CC      hw/net/eepro100.o
  CC      hw/net/pcnet.o
  CC      hw/net/pcnet-pci.o
  CC      hw/net/e1000.o
  CC      hw/net/e1000x_common.o
  CC      hw/net/net_tx_pkt.o
  CC      hw/net/net_rx_pkt.o
  CC      hw/net/e1000e.o
  CC      hw/net/e1000e_core.o
  CC      hw/net/rtl8139.o
  CC      hw/net/vmxnet3.o
  CC      hw/net/smc91c111.o
  CC      hw/net/lan9118.o
  CC      hw/net/ne2000-isa.o
  CC      hw/net/xgmac.o
  CC      hw/net/allwinner_emac.o
  CC      hw/net/imx_fec.o
  CC      hw/net/cadence_gem.o
  CC      hw/net/stellaris_enet.o
  CC      hw/net/rocker/rocker.o
  CC      hw/net/rocker/rocker_fp.o
  CC      hw/net/rocker/rocker_desc.o
  CC      hw/net/rocker/rocker_world.o
  CC      hw/net/rocker/rocker_of_dpa.o
  CC      hw/nvram/eeprom93xx.o
  CC      hw/nvram/chrp_nvram.o
  CC      hw/nvram/fw_cfg.o
  CC      hw/pci-bridge/pci_expander_bridge.o
  CC      hw/pci-bridge/pci_bridge_dev.o
  CC      hw/pci-bridge/xio3130_upstream.o
  CC      hw/pci-bridge/xio3130_downstream.o
  CC      hw/pci-bridge/ioh3420.o
  CC      hw/pci-bridge/i82801b11.o
  CC      hw/pci-host/pam.o
  CC      hw/pci-host/versatile.o
  CC      hw/pci-host/piix.o
  CC      hw/pci-host/q35.o
  CC      hw/pci-host/gpex.o
  CC      hw/pci/pci.o
  CC      hw/pci/pci_bridge.o
  CC      hw/pci/msix.o
  CC      hw/pci/msi.o
  CC      hw/pci/shpc.o
  CC      hw/pci/slotid_cap.o
  CC      hw/pci/pci_host.o
  CC      hw/pci/pcie_host.o
  CC      hw/pci/pcie.o
  CC      hw/pci/pcie_aer.o
  CC      hw/pci/pcie_port.o
  CC      hw/pci/pci-stub.o
  CC      hw/pcmcia/pcmcia.o
  CC      hw/scsi/scsi-disk.o
  CC      hw/scsi/scsi-generic.o
  CC      hw/scsi/scsi-bus.o
  CC      hw/scsi/lsi53c895a.o
  CC      hw/scsi/mptsas.o
  CC      hw/scsi/mptconfig.o
  CC      hw/scsi/mptendian.o
  CC      hw/scsi/megasas.o
  CC      hw/scsi/esp.o
  CC      hw/scsi/vmw_pvscsi.o
  CC      hw/scsi/esp-pci.o
  CC      hw/sd/pl181.o
  CC      hw/sd/ssi-sd.o
  CC      hw/sd/sd.o
  CC      hw/sd/core.o
  CC      hw/sd/sdhci.o
  CC      hw/smbios/smbios.o
  CC      hw/smbios/smbios_type_38.o
  CC      hw/ssi/pl022.o
  CC      hw/ssi/ssi.o
  CC      hw/ssi/xilinx_spips.o
  CC      hw/ssi/aspeed_smc.o
  CC      hw/ssi/stm32f2xx_spi.o
  CC      hw/timer/arm_timer.o
  CC      hw/timer/arm_mptimer.o
  CC      hw/timer/a9gtimer.o
  CC      hw/timer/cadence_ttc.o
  CC      hw/timer/ds1338.o
  CC      hw/timer/hpet.o
  CC      hw/timer/i8254_common.o
  CC      hw/timer/i8254.o
  CC      hw/timer/pl031.o
  CC      hw/timer/twl92230.o
  CC      hw/timer/imx_epit.o
  CC      hw/timer/imx_gpt.o
  CC      hw/timer/stm32f2xx_timer.o
  CC      hw/timer/aspeed_timer.o
  CC      hw/tpm/tpm_tis.o
  CC      hw/tpm/tpm_passthrough.o
  CC      hw/tpm/tpm_util.o
  CC      hw/usb/core.o
  CC      hw/usb/combined-packet.o
  CC      hw/usb/bus.o
  CC      hw/usb/libhw.o
/tmp/qemu-test/src/hw/nvram/fw_cfg.c: In function ‘fw_cfg_dma_transfer’:
/tmp/qemu-test/src/hw/nvram/fw_cfg.c:329: warning: ‘read’ may be used uninitialized in this function
  CC      hw/usb/desc.o
  CC      hw/usb/desc-msos.o
  CC      hw/usb/hcd-uhci.o
  CC      hw/usb/hcd-ohci.o
  CC      hw/usb/hcd-ehci.o
  CC      hw/usb/hcd-ehci-pci.o
  CC      hw/usb/hcd-ehci-sysbus.o
  CC      hw/usb/hcd-xhci.o
  CC      hw/usb/hcd-musb.o
  CC      hw/usb/dev-hub.o
  CC      hw/usb/dev-hid.o
  CC      hw/usb/dev-wacom.o
  CC      hw/usb/dev-storage.o
  CC      hw/usb/dev-uas.o
  CC      hw/usb/dev-serial.o
  CC      hw/usb/dev-audio.o
  CC      hw/usb/dev-network.o
  CC      hw/usb/dev-bluetooth.o
  CC      hw/usb/dev-smartcard-reader.o
  CC      hw/usb/dev-mtp.o
  CC      hw/usb/host-stub.o
  CC      hw/virtio/virtio-rng.o
  CC      hw/virtio/virtio-pci.o
  CC      hw/virtio/virtio-bus.o
  CC      hw/virtio/virtio-mmio.o
  CC      hw/watchdog/watchdog.o
  CC      hw/watchdog/wdt_i6300esb.o
  CC      hw/watchdog/wdt_ib700.o
  CC      migration/migration.o
  CC      migration/socket.o
  CC      migration/fd.o
  CC      migration/exec.o
  CC      migration/tls.o
  CC      migration/colo-comm.o
  CC      migration/colo.o
  CC      migration/colo-failover.o
  CC      migration/vmstate.o
  CC      migration/qemu-file.o
  CC      migration/qemu-file-channel.o
  CC      migration/xbzrle.o
  CC      migration/postcopy-ram.o
  CC      migration/qjson.o
  CC      migration/block.o
  CC      net/net.o
  CC      net/queue.o
  CC      net/checksum.o
  CC      net/util.o
  CC      net/socket.o
  CC      net/hub.o
  CC      net/eth.o
  CC      net/dump.o
  CC      net/l2tpv3.o
  CC      net/tap.o
  CC      net/vhost-user.o
  CC      net/tap-linux.o

/tmp/qemu-test/src/migration/colo.c: In function ‘colo_send_message’:
/tmp/qemu-test/src/migration/colo.c:123: warning: implicit declaration of function ‘trace_colo_send_message’ /tmp/qemu-test/src/migration/colo.c:123: warning: nested extern declaration of ‘trace_colo_send_message’ /tmp/qemu-test/src/migration/colo.c: In function ‘colo_receive_message’:
/tmp/qemu-test/src/migration/colo.c:162: warning: implicit declaration of function ‘trace_colo_receive_message’ /tmp/qemu-test/src/migration/colo.c:162: warning: nested extern declaration of ‘trace_colo_receive_message’ /tmp/qemu-test/src/migration/colo.c: In function ‘colo_do_checkpoint_transaction’:
/tmp/qemu-test/src/migration/colo.c:234: warning: implicit declaration of function ‘trace_colo_vm_state_change’ /tmp/qemu-test/src/migration/colo.c:234: warning: nested extern declaration of ‘trace_colo_vm_state_change’

  CC      net/slirp.o
  CC      net/filter.o
  CC      net/filter-buffer.o
  CC      net/filter-mirror.o
  CC      net/colo-compare.o
  CC      net/colo.o
  CC      net/filter-rewriter.o
  CC      net/filter-replay.o
  CC      qom/cpu.o
  CC      replay/replay.o
  CC      replay/replay-internal.o
  CC      replay/replay-events.o
/tmp/qemu-test/src/replay/replay-internal.c: In function ‘replay_put_array’:
/tmp/qemu-test/src/replay/replay-internal.c:65: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
  CC      replay/replay-time.o
  CC      replay/replay-input.o
  CC      replay/replay-char.o
  CC      replay/replay-snapshot.o
  CC      replay/replay-net.o
  CC      slirp/cksum.o
  CC      slirp/if.o
  CC      slirp/ip_icmp.o
/tmp/qemu-test/src/migration/colo-failover.c: In function ‘failover_set_state’:
/tmp/qemu-test/src/migration/colo-failover.c:65: warning: implicit declaration of function ‘trace_colo_failover_set_state’
/tmp/qemu-test/src/migration/colo-failover.c:65: warning: nested extern declaration of ‘trace_colo_failover_set_state’
  CC      slirp/ip6_icmp.o
  CC      slirp/ip6_input.o
  CC      slirp/ip6_output.o
  CC      slirp/ip_input.o
  CC      slirp/ip_output.o
  CC      slirp/dnssearch.o
  CC      slirp/dhcpv6.o
  CC      slirp/slirp.o
  CC      slirp/mbuf.o
  CC      slirp/misc.o
  CC      slirp/sbuf.o
  CC      slirp/socket.o
  CC      slirp/tcp_input.o
  CC      slirp/tcp_output.o
  CC      slirp/tcp_subr.o
  CC      slirp/tcp_timer.o
  CC      slirp/udp.o
  CC      slirp/udp6.o

/tmp/qemu-test/src/slirp/tcp_input.c: In function ‘tcp_input’:
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_p’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_len’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_tos’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_id’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_off’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_ttl’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_sum’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_src.s_addr’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_dst.s_addr’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:220: warning: ‘save_ip6.ip_nh’ may be used uninitialized in this function

  CC      slirp/bootp.o
  CC      slirp/tftp.o
  CC      slirp/arp_table.o
  CC      slirp/ndp_table.o
  CC      ui/keymaps.o
  CC      ui/console.o
  CC      ui/cursor.o
  CC      ui/qemu-pixman.o
  CC      ui/input.o
  CC      ui/input-keymap.o
  CC      ui/input-legacy.o
  CC      ui/input-linux.o
/tmp/qemu-test/src/net/colo.c: In function ‘parse_packet_early’:
/tmp/qemu-test/src/net/colo.c:51: warning: implicit declaration of function ‘trace_colo_proxy_main’
/tmp/qemu-test/src/net/colo.c:51: warning: nested extern declaration of ‘trace_colo_proxy_main’
  CC      ui/sdl.o
  CC      ui/sdl_zoom.o
  CC      ui/x_keymap.o
  CC      ui/vnc.o
  CC      ui/vnc-enc-zlib.o
  CC      ui/vnc-enc-hextile.o
  CC      ui/vnc-enc-tight.o

/tmp/qemu-test/src/net/colo-compare.c: In function ‘colo_packet_compare’:
/tmp/qemu-test/src/net/colo-compare.c:166: warning: implicit declaration of function ‘trace_colo_compare_ip_info’ /tmp/qemu-test/src/net/colo-compare.c:166: warning: nested extern declaration of ‘trace_colo_compare_ip_info’ /tmp/qemu-test/src/net/colo-compare.c: In function ‘colo_packet_compare_tcp’:
/tmp/qemu-test/src/net/colo-compare.c:188: warning: implicit declaration of function ‘trace_colo_compare_main’ /tmp/qemu-test/src/net/colo-compare.c:188: warning: nested extern declaration of ‘trace_colo_compare_main’ /tmp/qemu-test/src/net/colo-compare.c:190: error: ‘TRACE_COLO_COMPARE_MISCOMPARE_ENABLED’ undeclared (first use in this function) /tmp/qemu-test/src/net/colo-compare.c:190: error: (Each undeclared identifier is reported only once /tmp/qemu-test/src/net/colo-compare.c:190: error: for each function it appears in.) /tmp/qemu-test/src/net/colo-compare.c:190: error: ‘_TRACE_COLO_COMPARE_MISCOMPARE_DSTATE’ undeclared (first use in this function) /tmp/qemu-test/src/net/colo-compare.c:217: warning: implicit declaration of function ‘trace_colo_compare_pkt_info_src’ /tmp/qemu-test/src/net/colo-compare.c:217: warning: nested extern declaration of ‘trace_colo_compare_pkt_info_src’ /tmp/qemu-test/src/net/colo-compare.c:223: warning: implicit declaration of function ‘trace_colo_compare_pkt_info_dst’ /tmp/qemu-test/src/net/colo-compare.c:223: warning: nested extern declaration of ‘trace_colo_compare_pkt_info_dst’ /tmp/qemu-test/src/net/colo-compare.c: In function ‘colo_packet_compare_udp’:
/tmp/qemu-test/src/net/colo-compare.c:250: warning: implicit declaration of function ‘trace_colo_compare_udp_miscompare’ /tmp/qemu-test/src/net/colo-compare.c:250: warning: nested extern declaration of ‘trace_colo_compare_udp_miscompare’ /tmp/qemu-test/src/net/colo-compare.c: In function ‘colo_packet_compare_icmp’:
/tmp/qemu-test/src/net/colo-compare.c:275: warning: implicit declaration of function ‘trace_colo_compare_icmp_miscompare’ /tmp/qemu-test/src/net/colo-compare.c:275: warning: nested extern declaration of ‘trace_colo_compare_icmp_miscompare’ /tmp/qemu-test/src/net/colo-compare.c: In function ‘colo_old_packet_check_one’:
/tmp/qemu-test/src/net/colo-compare.c:308: warning: implicit declaration of function ‘trace_colo_old_packet_check_found’ /tmp/qemu-test/src/net/colo-compare.c:308: warning: nested extern declaration of ‘trace_colo_old_packet_check_found’
CC ui/vnc-palette.o
make: *** [net/colo-compare.o] Error 1
make: *** Waiting for unfinished jobs....
CC ui/vnc-enc-zrle.o
CC ui/vnc-auth-vencrypt.o
/tmp/qemu-test/src/net/filter-rewriter.c: In function ‘handle_primary_tcp_pkt’:
/tmp/qemu-test/src/net/filter-rewriter.c:70: error: ‘TRACE_COLO_FILTER_REWRITER_DEBUG_ENABLED’ undeclared (first use in this function) /tmp/qemu-test/src/net/filter-rewriter.c:70: error: (Each undeclared identifier is reported only once /tmp/qemu-test/src/net/filter-rewriter.c:70: error: for each function it appears in.) /tmp/qemu-test/src/net/filter-rewriter.c:70: error: ‘_TRACE_COLO_FILTER_REWRITER_DEBUG_DSTATE’ undeclared (first use in this function) /tmp/qemu-test/src/net/filter-rewriter.c:71: warning: implicit declaration of function ‘trace_colo_filter_rewriter_pkt_info’ /tmp/qemu-test/src/net/filter-rewriter.c:71: warning: nested extern declaration of ‘trace_colo_filter_rewriter_pkt_info’ /tmp/qemu-test/src/net/filter-rewriter.c:75: warning: implicit declaration of function ‘trace_colo_filter_rewriter_conn_offset’ /tmp/qemu-test/src/net/filter-rewriter.c:75: warning: nested extern declaration of ‘trace_colo_filter_rewriter_conn_offset’ /tmp/qemu-test/src/net/filter-rewriter.c: In function ‘handle_secondary_tcp_pkt’:
/tmp/qemu-test/src/net/filter-rewriter.c:114: error: ‘TRACE_COLO_FILTER_REWRITER_DEBUG_ENABLED’ undeclared (first use in this function) /tmp/qemu-test/src/net/filter-rewriter.c:114: error: ‘_TRACE_COLO_FILTER_REWRITER_DEBUG_DSTATE’ undeclared (first use in this function)
make: *** [net/filter-rewriter.o] Error 1
/tmp/qemu-test/src/qom/cpu.c: In function ‘cpu_reset’:
/tmp/qemu-test/src/qom/cpu.c:250: warning: implicit declaration of function ‘trace_guest_cpu_reset’ /tmp/qemu-test/src/qom/cpu.c:250: warning: nested extern declaration of ‘trace_guest_cpu_reset’
make[1]: *** [docker-run] Error 2
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-x9xsss8m/src'
make: *** [docker-run-test-quick@centos6] Error 2
=== OUTPUT END ===

Test command exited with code: 2

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

#66 lore raw

Re: [Qemu-devel] [PATCH v2 40/47] trace: switch target/s390x/ directory to modular trace.h file

In reply to Daniel P. Berrange
Quoted 10 lines · Daniel P Berrange

Switch files in the target/s390x/ directory to include the target/s390x/trace.h file instead of the global trace.h file.

The make rules for gen-features.{h,c} need to be moved out into the top level Makefile.objs, otherwise make complains about the rules being defined multiple times due to target/s390x/Makefile.objs being included multiple times when expanding different subdir object lists.

If the problem is re-definition, you can instead add a guard around the rules in target/s390x/Makefile.objs. This avoids defining the rules multiple times but still keeps the target-specific rules in the target-specific makefile.

Cheers,
Lluis

#67 lore raw

Re: [Qemu-devel] [PATCH v2 40/47] trace: switch target/s390x/ directory to modular trace.h file

Quoted 13 lines · Lluís Vilanova
Quoted 10 lines · Daniel P Berrange

Switch files in the target/s390x/ directory to include the target/s390x/trace.h file instead of the global trace.h file.

The make rules for gen-features.{h,c} need to be moved out into the top level Makefile.objs, otherwise make complains about the rules being defined multiple times due to target/s390x/Makefile.objs being included multiple times when expanding different subdir object lists.

Quoted 3 lines

If the problem is re-definition, you can instead add a guard around the rules in target/s390x/Makefile.objs. This avoids defining the rules multiple times but still keeps the target-specific rules in the target-specific makefile.

What kind of guard to you mean ? What's happening is that the top level Makefile.target is including target/s390x/Makefile.objs multiple times to expand multiple vars. I don't see a way to distinguish which include we're being called from.

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#2 lore raw

Re: [Qemu-devel] [PATCH v2 01/47] trace: introduce some Makefile rules for module code gen

In reply to Daniel P. Berrange
Quoted 63 lines · Daniel P Berrange

Introduce rules that are able to generate trace.[ch] files in every subdirectory which has a trace-events file.

---
 .gitignore                               |  6 +++
 Makefile                                 | 65 +++++++++++++++++++++++++++-----
 Makefile.objs                            |  5 +++
 Makefile.target                          |  7 +++-
 scripts/tracetool/backend/dtrace.py      |  7 +++-
 scripts/tracetool/backend/ust.py         |  7 +++-
 scripts/tracetool/format/ust_events_c.py |  2 +-
 scripts/tracetool/format/ust_events_h.py |  7 +++-
 tests/Makefile.include                   |  2 +-
 trace/Makefile.objs                      | 23 ++++++++---
 10 files changed, 109 insertions(+), 22 deletions(-)
.gitignore +6 -0
index e43c304..fe6add3 100644
@@ -111,3 +111,9 @@ tags
 TAGS
 docker-src.*
 *~
+trace.h
+trace.c
+trace-events-common
+trace-ust.h
+trace-dtrace.h
+trace-dtrace.dtrace
Makefile +19 -0
index 214cbad..181802b 100644
@@ -70,11 +70,53 @@ GENERATED_SOURCES += trace/generated-helpers.c
 
 ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
 GENERATED_HEADERS += trace/generated-ust-provider.h
+GENERATED_HEADERS += trace/generated-ust-provider-all.h
 GENERATED_SOURCES += trace/generated-ust.c
 endif
 
 GENERATED_HEADERS += module_block.h
 
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace.h)
+GENERATED_SOURCES += $(trace-events-subdirs:%=%/trace.c)
+GENERATED_DTRACE =
+ifdef CONFIG_TRACE_DTRACE
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-dtrace.h)
+GENERATED_DTRACE += $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
+endif
+ifdef CONFIG_TRACE_UST
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-ust.h)
+endif
+
+%/trace.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=h \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")
+
+%/trace.c: $(SRC_PATH)/%/trace-events $(tracetool-y)

Makefile GENERATED_SOURCES += trace/generated-helpers.c · line 106

Quoted 10 lines
Makefile +10 -0
+	$(call quiet-command,$(TRACETOOL) \
+		--format=c \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")
+
+%/trace-ust.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=ust-events-h \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")

There's a discrepancy between generation in trace/Makefile.objs, where timestamp files are used to filter out internal changes in tracetool, and here.

[...]

Quoted 6 lines
scripts/tracetool/backend/dtrace.py +0 -0
index 79505c6..1319990 100644
@@ -36,7 +36,12 @@ def binary():
 

scripts/tracetool/backend/dtrace.py def binary(): · line 45

Quoted 10 lines
scripts/tracetool/backend/dtrace.py +6 -1
 
 def generate_h_begin(events, group):
-    out('#include "trace/generated-tracers-dtrace.h"',
+    if group == "common":
+        include = "trace/generated-tracers-dtrace.h"
+    else:
+        include = "trace-dtrace.h"
+
+    out('#include "%s"' % include,
         '')

Why is the top-level events file treated as a special case?

[...]

Cheers,
Lluis

#82 lore raw
In reply to [email protected]
Quoted 4 lines · On Fri, Jan 06, 2017 at 09:02:42AM -0800, [email protected] wrote:

Hi,

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it

[snip]

Quoted 11 lines

/tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_update’:
/tmp/qemu-test/src/hw/char/pl011.c:62: warning: implicit declaration of function ‘trace_pl011_irq_state’ /tmp/qemu-test/src/hw/char/pl011.c:62: warning: nested extern declaration of ‘trace_pl011_irq_state’ /tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_read’:
/tmp/qemu-test/src/hw/char/pl011.c:87: warning: implicit declaration of function ‘trace_pl011_read_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:87: warning: nested extern declaration of ‘trace_pl011_read_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:139: warning: implicit declaration of function ‘trace_pl011_read’ /tmp/qemu-test/src/hw/char/pl011.c:139: warning: nested extern declaration of ‘trace_pl011_read’ /tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_write’:
/tmp/qemu-test/src/hw/char/pl011.c:163: warning: implicit declaration of function ‘trace_pl011_write’ /tmp/qemu-test/src/hw/char/pl011.c:163: warning: nested extern declaration of ‘trace_pl011_write’

Quoted 8 lines

/tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_can_receive’:
/tmp/qemu-test/src/hw/char/pl011.c:237: warning: implicit declaration of function ‘trace_pl011_can_receive’ /tmp/qemu-test/src/hw/char/pl011.c:237: warning: nested extern declaration of ‘trace_pl011_can_receive’ /tmp/qemu-test/src/hw/char/pl011.c: In function ‘pl011_put_fifo’:
/tmp/qemu-test/src/hw/char/pl011.c:252: warning: implicit declaration of function ‘trace_pl011_put_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:252: warning: nested extern declaration of ‘trace_pl011_put_fifo’ /tmp/qemu-test/src/hw/char/pl011.c:254: warning: implicit declaration of function ‘trace_pl011_put_fifo_full’ /tmp/qemu-test/src/hw/char/pl011.c:254: warning: nested extern declaration of ‘trace_pl011_put_fifo_full’

Sigh, include search path ordering is different when doing in-tree vs out of tree builds.

When in-tree, the headers in the hw/char sub-dir are found *before* the top level source dir.

When out of tree, the headers hw/char *build* dir are found *after* the top level source dir.

Will have to investigate how we can fix the include ordering.

This is also a sign that travis.yml should do at least one of its builds with srcdir != build dir

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#3 lore raw

Re: [Qemu-devel] [PATCH v2 01/47] trace: introduce some Makefile rules for module code gen

In reply to Lluís Vilanova
Quoted 70 lines · Lluís Vilanova
Quoted 68 lines · Daniel P Berrange

Introduce rules that are able to generate trace.[ch] files in every subdirectory which has a trace-events file.

---
 .gitignore                               |  6 +++
 Makefile                                 | 65 +++++++++++++++++++++++++++-----
 Makefile.objs                            |  5 +++
 Makefile.target                          |  7 +++-
 scripts/tracetool/backend/dtrace.py      |  7 +++-
 scripts/tracetool/backend/ust.py         |  7 +++-
 scripts/tracetool/format/ust_events_c.py |  2 +-
 scripts/tracetool/format/ust_events_h.py |  7 +++-
 tests/Makefile.include                   |  2 +-
 trace/Makefile.objs                      | 23 ++++++++---
 10 files changed, 109 insertions(+), 22 deletions(-)
.gitignore +6 -0
index e43c304..fe6add3 100644
@@ -111,3 +111,9 @@ tags
 TAGS
 docker-src.*
 *~
+trace.h
+trace.c
+trace-events-common
+trace-ust.h
+trace-dtrace.h
+trace-dtrace.dtrace
Makefile +24 -0
index 214cbad..181802b 100644
@@ -70,11 +70,53 @@ GENERATED_SOURCES += trace/generated-helpers.c
 
 ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
 GENERATED_HEADERS += trace/generated-ust-provider.h
+GENERATED_HEADERS += trace/generated-ust-provider-all.h
 GENERATED_SOURCES += trace/generated-ust.c
 endif
 
 GENERATED_HEADERS += module_block.h
 
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace.h)
+GENERATED_SOURCES += $(trace-events-subdirs:%=%/trace.c)
+GENERATED_DTRACE =
+ifdef CONFIG_TRACE_DTRACE
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-dtrace.h)
+GENERATED_DTRACE += $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
+endif
+ifdef CONFIG_TRACE_UST
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-ust.h)
+endif
+
+%/trace.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=h \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")
+
+%/trace.c: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=c \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")
+
Quoted 8 lines

Makefile GENERATED_SOURCES += trace/generated-helpers.c · line 106

Quoted 5 lines
Makefile +5 -0
+%/trace-ust.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=ust-events-h \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")

There's a discrepancy between generation in trace/Makefile.objs, where timestamp files are used to filter out internal changes in tracetool, and here.

I took the view that the timestamp comparisons are an uneccessary complexity - we don't do that for other places where we generate code from scripts.

Quoted 17 lines
Quoted 6 lines
scripts/tracetool/backend/dtrace.py +0 -0
index 79505c6..1319990 100644
@@ -36,7 +36,12 @@ def binary():
 

scripts/tracetool/backend/dtrace.py def binary(): · line 45

Quoted 10 lines
scripts/tracetool/backend/dtrace.py +6 -1
 
 def generate_h_begin(events, group):
-    out('#include "trace/generated-tracers-dtrace.h"',
+    if group == "common":
+        include = "trace/generated-tracers-dtrace.h"
+    else:
+        include = "trace-dtrace.h"
+
+    out('#include "%s"' % include,
         '')
Quoted 1 line

Why is the top-level events file treated as a special case?

This is temporary until the end of the series when the special cases go away

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#75 lore raw

Re: [Qemu-devel] [PATCH v2 46/47] trace: update docs to reflect new code generation approach

In reply to Daniel P. Berrange
Quoted 16 lines · Daniel P Berrange

Describe use of per-subdir trace events files and how it impacts code generation.

---
 docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 52 insertions(+), 9 deletions(-)
docs/tracing.txt +0 -0
index f351998a..3262a61 100644
@@ -27,18 +27,51 @@ for debugging, profiling, and observing execution.
 
 == Trace events ==
 

docs/tracing.txt for debugging, profiling, and observing execution. · line 37

Quoted 10 lines
docs/tracing.txt +7 -2
+=== Sub-directory setup ===
+
 Each directory in the source tree can declare a set of static trace events
-in a "trace-events" file. Each trace event declaration names the event, its
-arguments, and the format string which can be used for pretty-printing:
+in a "trace-events" file. The first (non-comment) statement in the file
+must be "@id_offset(NN)" where NN is an integer that is unique among all
+"trace-events" files in the QEMU source tree. The IDs can be arbitrarily
+chosen, but for extra fun the current "trace-events" files use values from
+the "powerful number" integer sequence :-)

I think that the description of @id_offset is a leftover from a previous version of the series.

Cheers,
Lluis

#76 lore raw

Re: [Qemu-devel] [PATCH v2 46/47] trace: update docs to reflect new code generation approach

In reply to Daniel P. Berrange
Quoted 16 lines · Daniel P. Berrange

Describe use of per-subdir trace events files and how it impacts code generation.

---
 docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 52 insertions(+), 9 deletions(-)
docs/tracing.txt +0 -0
index f351998a..3262a61 100644
@@ -27,18 +27,51 @@ for debugging, profiling, and observing execution.
 
 == Trace events ==
 

docs/tracing.txt for debugging, profiling, and observing execution. · line 37

Quoted 10 lines
docs/tracing.txt +7 -2
+=== Sub-directory setup ===
+
 Each directory in the source tree can declare a set of static trace events
-in a "trace-events" file. Each trace event declaration names the event, its
-arguments, and the format string which can be used for pretty-printing:
+in a "trace-events" file. The first (non-comment) statement in the file
+must be "@id_offset(NN)" where NN is an integer that is unique among all
+"trace-events" files in the QEMU source tree. The IDs can be arbitrarily
+chosen, but for extra fun the current "trace-events" files use values from
+the "powerful number" integer sequence :-)

Is this true? I don't see an @id_offset() comment in any of your earlier patches, or in the unpatched tree.

docs/tracing.txt for debugging, profiling, and observing execution. · line 58

Quoted 5 lines
docs/tracing.txt +5 -0
+In the sub-directory the following files will be automatically generated
+
+ - trace.c - the trace event state declarations
+ - trace.h - the trace event enums and probe functions
+ - trace-dtrace.h - DTrace speci

s/speci/specification/ ?

Quoted 6 lines
docs/tracing.txt +6 -0
+ - trace-dtrace.dtrace - DTrace event probe helper declaration
+ - trace-dtrace.o - binary DTrace provider (generated by dtrace)
+ - trace-ust.h - UST event probe helper declarations
+
+Source files in the sub-directory should only #include the 'trace.h'
+file and use the full sub-directory path. eg io/channel-buffer.c

docs/tracing.txt for debugging, profiling, and observing execution. · line 69

Quoted 10 lines
docs/tracing.txt +4 -5
+would do
 
-All "trace-events" files must be listed in the "trace-event-y" make variable
-in the top level Makefile.objs. During build the individual files are combined
-to create a "trace-events-all" file, which is processed by the "tracetool"
-script during build to generate code for the trace events. The
-"trace-events-all" file is also installed into "/usr/share/qemu".
+  #include "io/trace.h"
+
+While it is permited to include a trace.h file from outside a source

s/permited/permitted/

Quoted 6 lines
docs/tracing.txt +5 -0
+files' own sub-directory, this is discouraged in general. It is strongly
+preferred that all events be declared directly in the sub-directory that
+uses them.
+
+=== Using trace events ===
 
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Reviewed-by on v2 47/47
#78 lore raw

Re: [Qemu-devel] [PATCH v2 47/47] trace: improve error reporting when parsing simpletrace header

In reply to Daniel P. Berrange
Quoted 9 lines · Daniel P. Berrange

When loading a simpletrace binary file we just report "Not a valid trace file!" which is not very helpful. Report exactly which field we found to be invalid.

---
 scripts/simpletrace.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Could be applied independently, so:

I'll leave a review of the Makefile magic in 1/47 to someone more comfortable with it, but if that gets approved, you are right that most of this series is pretty boring and mechanical.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#68 lore raw

Re: [Qemu-devel] [PATCH v2 40/47] trace: switch target/s390x/ directory to modular trace.h file

In reply to Daniel P. Berrange
Quoted 14 lines · Daniel P Berrange
Quoted 13 lines · Lluís Vilanova
Quoted 10 lines · Daniel P Berrange

Switch files in the target/s390x/ directory to include the target/s390x/trace.h file instead of the global trace.h file.

The make rules for gen-features.{h,c} need to be moved out into the top level Makefile.objs, otherwise make complains about the rules being defined multiple times due to target/s390x/Makefile.objs being included multiple times when expanding different subdir object lists.

Quoted 8 lines
Quoted 3 lines

If the problem is re-definition, you can instead add a guard around the rules in target/s390x/Makefile.objs. This avoids defining the rules multiple times but still keeps the target-specific rules in the target-specific makefile.

What kind of guard to you mean ? What's happening is that the top level Makefile.target is including target/s390x/Makefile.objs multiple times to expand multiple vars. I don't see a way to distinguish which include we're being called from.

I think I did something like this to ensure rules are defined only once:

  ifneq($(TRACE_GUARD_TARGET_S390X),1)
  # ... rules ...
  TRACE_GUARD_TARGET_S390X=1
  endif

It's not the cleanest solution, but neither is having target-specific rules in a generic makefile. Choose your least evil.

Cheers,
Lluis

#4 lore raw

Re: [Qemu-devel] [PATCH v2 01/47] trace: introduce some Makefile rules for module code gen

In reply to Daniel P. Berrange
Quoted 80 lines · Daniel P Berrange
Quoted 70 lines · Lluís Vilanova
Quoted 68 lines · Daniel P Berrange

Introduce rules that are able to generate trace.[ch] files in every subdirectory which has a trace-events file.

---
 .gitignore                               |  6 +++
 Makefile                                 | 65 +++++++++++++++++++++++++++-----
 Makefile.objs                            |  5 +++
 Makefile.target                          |  7 +++-
 scripts/tracetool/backend/dtrace.py      |  7 +++-
 scripts/tracetool/backend/ust.py         |  7 +++-
 scripts/tracetool/format/ust_events_c.py |  2 +-
 scripts/tracetool/format/ust_events_h.py |  7 +++-
 tests/Makefile.include                   |  2 +-
 trace/Makefile.objs                      | 23 ++++++++---
 10 files changed, 109 insertions(+), 22 deletions(-)
.gitignore +6 -0
index e43c304..fe6add3 100644
@@ -111,3 +111,9 @@ tags
 TAGS
 docker-src.*
 *~
+trace.h
+trace.c
+trace-events-common
+trace-ust.h
+trace-dtrace.h
+trace-dtrace.dtrace
Makefile +24 -0
index 214cbad..181802b 100644
@@ -70,11 +70,53 @@ GENERATED_SOURCES += trace/generated-helpers.c
 
 ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
 GENERATED_HEADERS += trace/generated-ust-provider.h
+GENERATED_HEADERS += trace/generated-ust-provider-all.h
 GENERATED_SOURCES += trace/generated-ust.c
 endif
 
 GENERATED_HEADERS += module_block.h
 
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace.h)
+GENERATED_SOURCES += $(trace-events-subdirs:%=%/trace.c)
+GENERATED_DTRACE =
+ifdef CONFIG_TRACE_DTRACE
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-dtrace.h)
+GENERATED_DTRACE += $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
+endif
+ifdef CONFIG_TRACE_UST
+GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-ust.h)
+endif
+
+%/trace.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=h \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")
+
+%/trace.c: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=c \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")
+
Quoted 8 lines

Makefile GENERATED_SOURCES += trace/generated-helpers.c · line 106

Quoted 5 lines
Makefile +5 -0
+%/trace-ust.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=ust-events-h \
+		--backends=$(TRACE_BACKENDS) \
+		$< > $@,"GEN","$@")

There's a discrepancy between generation in trace/Makefile.objs, where timestamp files are used to filter out internal changes in tracetool, and here.

Quoted 3 lines

I took the view that the timestamp comparisons are an uneccessary complexity - we don't do that for other places where we generate code from scripts.

AFAIR, the idea was to avoid re-building all QEMU when any of the tracetool script files change without affecting all the generated files.

Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
scripts/tracetool/backend/dtrace.py +6 -1
index 79505c6..1319990 100644
@@ -36,7 +36,12 @@ def binary():
 
 
 def generate_h_begin(events, group):
-    out('#include "trace/generated-tracers-dtrace.h"',
+    if group == "common":
+        include = "trace/generated-tracers-dtrace.h"
+    else:
+        include = "trace-dtrace.h"
+
+    out('#include "%s"' % include,
         '')
Quoted 4 lines
Quoted 1 line

Why is the top-level events file treated as a special case?

This is temporary until the end of the series when the special cases go away

Yes, I saw you removed this special-casing (except in one case) in a later patch. Sorry about that.

Thanks,
Lluis

#6 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Daniel P. Berrange

io/channel-buffer.c line 25

Quoted 10 lines · Daniel P. Berrange
io/channel-buffer.c +1 -1
index 43d7959..b4e50d6 100644
@@ -22,7 +22,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"

Is this change necessary?

I think the per-subdir trace.h file should be generated in $BUILD_DIR/<sub-dir>/trace.h and gcc -I. can locate that file.

Stefan

#7 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 14 lines · Stefan Hajnoczi

io/channel-buffer.c line 25

Quoted 10 lines · Daniel P. Berrange
io/channel-buffer.c +1 -1
index 43d7959..b4e50d6 100644
@@ -22,7 +22,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"

Is this change necessary?

Quoted 2 lines

I think the per-subdir trace.h file should be generated in $BUILD_DIR/<sub-dir>/trace.h and gcc -I. can locate that file.

It doesn't work with builddir != srcdir builds, because -I. is resolved to the srcdir, but the trace.h is in builddir. The -I$BUILDDIR<sub-dir> is also added to the compiler search path, but it is after pretty much all other search paths. The end result is that if you simply use "trace.h" instad of "io/trace.h" you'll end up finding the trace.h from the top level source directory, instead of from your subdir.

I think the include path should probably be changed such that the -IBUILDDIR/<subdir> is immediately after -I., and I tried to make such a change, but failed to come up with a simple patch that worked.

In the end I thought it would be clearer to be explicit about the subdir we're pulling trace.h from anyway, since it is fairly common practice in QEMU to have the <subdir> in the #include filename.

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#14 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Stefan Hajnoczi
Quoted 13 lines · Stefan Hajnoczi

io/channel-buffer.c line 25

Quoted 10 lines · Daniel P. Berrange
io/channel-buffer.c +1 -1
index 43d7959..b4e50d6 100644
@@ -22,7 +22,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"

Is this change necessary?

Yes - now that there are more than one trace.h files spread across multiple directories, you need a prefix to ensure the correct one gets included. In this particular case, it also matches consistency in including "io/channel-buffer.h" rather than just "channel-buffer.h".

Quoted 3 lines

I think the per-subdir trace.h file should be generated in $BUILD_DIR/<sub-dir>/trace.h and gcc -I. can locate that file.

It can indeed locate it, but now you are depending on -I ordering to make sure it locates the right one before any other wrong one, which feels too fragile to me.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#8 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Daniel P. Berrange
Quoted 2 lines · Daniel P. Berrange

It doesn't work with builddir != srcdir builds, because -I. is resolved to the srcdir, but the trace.h is in builddir.

This is a bug then. The toplevel builddir (or for that matter srcdir) is not meant to be in the search path: only the toplevel include/, the subdirectory builddir, and the subdirectory srcdir.

Quoted 3 lines

In the end I thought it would be clearer to be explicit about the subdir we're pulling trace.h from anyway, since it is fairly common practice in QEMU to have the <subdir> in the #include filename.

Hmm, I don't think so. The idea is that all includes are nested, so that a local directory #include has no subdir while one from #include/ has one.

Paolo

#15 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Eric Blake
Quoted 21 lines · Eric Blake
Quoted 13 lines · Stefan Hajnoczi

io/channel-buffer.c line 25

Quoted 10 lines · Daniel P. Berrange
io/channel-buffer.c +1 -1
index 43d7959..b4e50d6 100644
@@ -22,7 +22,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"

Is this change necessary?

Yes - now that there are more than one trace.h files spread across multiple directories, you need a prefix to ensure the correct one gets included. In this particular case, it also matches consistency in including "io/channel-buffer.h" rather than just "channel-buffer.h".

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

I think the per-subdir trace.h file should be generated in $BUILD_DIR/<sub-dir>/trace.h and gcc -I. can locate that file.

It can indeed locate it, but now you are depending on -I ordering to make sure it locates the right one before any other wrong one, which feels too fragile to me.

The wrong one shouldn't be available at all. io/channel-buffer.h is in include/io/, while io/trace.h is in io/. But I guess this can be cleaned up through the whole tree later if Stefan wants to merge this more disrupting series soon.

Paolo

#9 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Paolo Bonzini
Quoted 9 lines · Paolo Bonzini
Quoted 2 lines · Daniel P. Berrange

It doesn't work with builddir != srcdir builds, because -I. is resolved to the srcdir, but the trace.h is in builddir.

This is a bug then. The toplevel builddir (or for that matter srcdir) is not meant to be in the search path: only the toplevel include/, the subdirectory builddir, and the subdirectory srcdir.

So what's happening is this...

During build of, for example, hw/scsi/esp-pci.o we have this explicit include search path passed to GCC:

-I/home/berrange/src/virt/qemu/tcg -I/home/berrange/src/virt/qemu/tcg/i386 -I/home/berrange/src/virt/qemu/linux-headers -I/home/berrange/src/virt/qemu-build/linux-headers -I.
-I/home/berrange/src/virt/qemu -I/home/berrange/src/virt/qemu/include -I/home/berrange/src/virt/qemu/hw/scsi -Ihw/scsi

Here -I. refers to the $BUILDDIR, since although the source file is in hw/scsi/, the compiler is invoked from $BUILDDIR as its working directory.

The compiler also has an implicit search dir which is the directory where the source file being compiled lives, and that is searched first AFAICT.

So when doing non-vpath build:

srcdir=/home/berrange/src/virt/qemu
builddir=/home/berrange/src/virt/qemu

we have this effective search order:

-I/home/berrange/src/virt/qemu/hw/scsi
-I/home/berrange/src/virt/qemu/tcg
-I/home/berrange/src/virt/qemu/tcg/i386
-I/home/berrange/src/virt/qemu/linux-headers
-I/home/berrange/src/virt/qemu/linux-headers
-I/home/berrange/src/virt/qemu
-I/home/berrange/src/virt/qemu
-I/home/berrange/src/virt/qemu/include
-I/home/berrange/src/virt/qemu/hw/scsi
-I/home/berrange/src/virt/qemu/hw/scsi

Thus, #include "trace.h" picks up $builddir/hw/scsi/trace.h correctly.

5782 execve("/usr/bin/as", ["as", "-I", "/home/berrange/src/virt/qemu/tcg", "-I", "/home/berrange/src/virt/qemu/tcg/i386", "-I", "/home/berrange/src/virt/qemu/linux-headers", "-I", "/home/berrange/src/virt/qemu/linux-headers", "-I", ".", "-I", "/home/berrange/src/virt/qemu", "-I", "/home/berrange/src/virt/qemu/include", "-I", "hw/scsi", "-I", "hw/scsi", "-I", "/usr/include/pixman-1", "-I", "/usr/include/glib-2.0", "-I", "/usr/lib64/glib-2.0/include", "-I", "/usr/include/p11-kit-1", "-I", "/usr/include/libpng16", "-I", "/usr/include/spice-server", "-I", "/usr/include/cacard", "-I", "/usr/include/nss3", "-I", "/usr/include/nspr4", "-I", "/usr/include/glib-2.0", "-I", "/usr/lib64/glib-2.0/include", "-I", "/usr/include/pixman-1", "-I", "/usr/include/spice-1", "-I", "/usr/include/cacard", "-I", "/usr/include/nss3", "-I", "/usr/include/nspr4", "-I", "/usr/include/glib-2.0", "-I", "/usr/lib64/glib-2.0/include", "-I", "/usr/include/libusb-1.0", "-I", "/home/berrange/src/virt/qemu/tests", "--64", "-o", "hw/scsi/esp-pci.o", "/tmp/cccr6Zf8.s"], [/* 63 vars */] <unfinished ...>

...

5781 open("hw/scsi/trace.h", O_RDONLY|O_NOCTTY) = 14

but when doing a vpath build

srcdir=/home/berrange/src/virt/qemu
builddir=/home/berrange/src/virt/qemu-build

we have this effective search order:

-I/home/berrange/src/virt/qemu/hw/scsi -I/home/berrange/src/virt/qemu/tcg -I/home/berrange/src/virt/qemu/tcg/i386 -I/home/berrange/src/virt/qemu/linux-headers -I/home/berrange/src/virt/qemu-build/linux-headers -I/home/berrange/src/virt/qemu-build -I/home/berrange/src/virt/qemu -I/home/berrange/src/virt/qemu/include -I/home/berrange/src/virt/qemu/hw/scsi -I/home/berrange/src/virt/qemu-build/hw/scsi

Thus #include "trace.h" picks up $builddir/trace.h incorrectly.

3138 execve("/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/cc1", ["/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/cc1", "-quiet", "-I", "/home/berrange/src/virt/qemu/tcg", "-I", "/home/berrange/src/virt/qemu/tcg/i386", "-I", "/home/berrange/src/virt/qemu/linux-headers", "-I", "/home/berrange/src/virt/qemu-build/linux-headers", "-I", ".", "-I", "/home/berrange/src/virt/qemu", "-I", "/home/berrange/src/virt/qemu/include", "-I", "/home/berrange/src/virt/qemu/hw/scsi", "-I", "hw/scsi", "-I", "/usr/include/pixman-1", "-I", "/usr/include/glib-2.0", "-I", "/usr/lib64/glib-2.0/include", "-I", "/usr/include/p11-kit-1", "-I", "/usr/include/libpng16", "-I", "/usr/include/spice-server", "-I", "/usr/include/cacard", "-I", "/usr/include/nss3", "-I", "/usr/include/nspr4", "-I", "/usr/include/glib-2.0", "-I", "/usr/lib64/glib-2.0/include", "-I", "/usr/include/pixman-1", "-I", "/usr/include/spice-1", "-I", "/usr/include/cacard", "-I", "/usr/include/nss3", "-I", "/usr/include/nspr4", "-I", "/usr/include/glib-2.0", "-I", "/usr/lib64/glib-2.0/include", "-I", "/usr/include/libusb-1.0", "-I", "/home/berrange/src/virt/qemu/tests", "-MMD", "hw/scsi/esp-pci.d", "-MF", "hw/scsi/esp-pci.d", "-MP", "-MT", "hw/scsi/esp-pci.o", "-D_REENTRANT", "-D", "HAS_LIBSSH2_SFTP_FSYNC", "-D", "_GNU_SOURCE", "-D", "PIE", "-D", "_GNU_SOURCE", "-D", "_FILE_OFFSET_BITS=64", "-D", "_LARGEFILE_SOURCE", "-U", "_FORTIFY_SOURCE", "-D", "_FORTIFY_SOURCE=2", "/home/berrange/src/virt/qemu/hw/scsi/esp-pci.c", "-quiet", "-dumpbase", "esp-pci.c", "-m64", "-mcx16", "-mtune=generic", "-march=x86-64", "-auxbase-strip", "hw/scsi/esp-pci.o", "-g", "-O2", "-Werror", "-Wstrict-prototypes", "-Wredundant-decls", "-Wall", "-Wundef", "-Wwrite-strings", "-Wmissing-prototypes", "-Wendif-labels", "-Wno-shift-negative-value", "-Wmissing-include-dirs", "-Wempty-body", "-Wnested-externs", "-Wformat-security", "-Wformat-y2k", "-Winit-self", "-Wignored-qualifiers", "-Wold-style-declaration", "-Wold-style-definition", "-Wtype-limits", "-fPIE", "-fno-strict-aliasing", "-fno-common", "-fwrapv", "-fstack-protector-strong", "-o", "/tmp/ccH7yXaj.s"], [/* 63 vars */] <unfinished ...>

...

3138  open("/home/berrange/src/virt/qemu/hw/scsi/trace.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
3138  open("/home/berrange/src/virt/qemu/tcg/trace.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
3138  open("/home/berrange/src/virt/qemu/tcg/i386/trace.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
3138  open("/home/berrange/src/virt/qemu/linux-headers/trace.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
3138  open("/home/berrange/src/virt/qemu-build/linux-headers/trace.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
3138  open("./trace.h", O_RDONLY|O_NOCTTY) = 14
3138  open("./trace.h", O_RDONLY)       = 14

For a consistent search order, we would need to have this be the explicit args:

-I/home/berrange/src/virt/qemu/hw/scsi -Ihw/scsi -I/home/berrange/src/virt/qemu/tcg -I/home/berrange/src/virt/qemu/tcg/i386 -I/home/berrange/src/virt/qemu/linux-headers -I/home/berrange/src/virt/qemu-build/linux-headers -I.
-I/home/berrange/src/virt/qemu -I/home/berrange/src/virt/qemu/include

It seems you're saying we should also trim the top level dirs, so we in fact get:

-I/home/berrange/src/virt/qemu/hw/scsi -Ihw/scsi -I/home/berrange/src/virt/qemu/tcg -I/home/berrange/src/virt/qemu/tcg/i386 -I/home/berrange/src/virt/qemu/linux-headers -I/home/berrange/src/virt/qemu-build/linux-headers -I/home/berrange/src/virt/qemu/include

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#10 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Review

Quoted 12 lines · Daniel P. Berrange

It seems you're saying we should also trim the top level dirs, so we in fact get:

(quoted diff) +0 -7
-I/home/berrange/src/virt/qemu/hw/scsi
-Ihw/scsi
-I/home/berrange/src/virt/qemu/tcg
-I/home/berrange/src/virt/qemu/tcg/i386
-I/home/berrange/src/virt/qemu/linux-headers
-I/home/berrange/src/virt/qemu-build/linux-headers
-I/home/berrange/src/virt/qemu/include

Yes, and ultimately tcg too.

Paolo

#26 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Daniel P. Berrange

io/Makefile.objs io-obj-y += channel-watch.o · line 12

Quoted 10 lines · Daniel P. Berrange
io/Makefile.objs +2 -0
index 9d8337d..94cb74e 100644
@@ -8,3 +8,5 @@ io-obj-y += channel-watch.o
 io-obj-y += channel-websock.o
 io-obj-y += channel-util.o
 io-obj-y += task.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o

Is there a way to eliminate this boilerplate? If the directory has a trace-events file then it requires trace.o/trace-dtrace.o.

Reviewed-by on v2 47/47
#79 lore raw

Re: [Qemu-devel] [PATCH v2 47/47] trace: improve error reporting when parsing simpletrace header

In reply to Daniel P. Berrange
Quoted 8 lines · Daniel P. Berrange

When loading a simpletrace binary file we just report "Not a valid trace file!" which is not very helpful. Report exactly which field we found to be invalid.

---
 scripts/simpletrace.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
#11 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Paolo Bonzini
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Daniel P. Berrange

It seems you're saying we should also trim the top level dirs, so we in fact get:

Quoted 9 lines

Review

Quoted 7 lines
(quoted diff) +0 -7
-I/home/berrange/src/virt/qemu/hw/scsi
-Ihw/scsi
-I/home/berrange/src/virt/qemu/tcg
-I/home/berrange/src/virt/qemu/tcg/i386
-I/home/berrange/src/virt/qemu/linux-headers
-I/home/berrange/src/virt/qemu-build/linux-headers
-I/home/berrange/src/virt/qemu/include

Yes, and ultimately tcg too.

So the problem with dropping BUILD_DIR from the include path is that config-host.h is generated in that location. We'll have to move that into BIULD_DIR/include and add -I$(BUILDDIR)/include to search path instead.

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#12 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 19 lines · Daniel P. Berrange
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Daniel P. Berrange

It seems you're saying we should also trim the top level dirs, so we in fact get:

Quoted 9 lines

Review

Quoted 7 lines
(quoted diff) +0 -7
-I/home/berrange/src/virt/qemu/hw/scsi
-Ihw/scsi
-I/home/berrange/src/virt/qemu/tcg
-I/home/berrange/src/virt/qemu/tcg/i386
-I/home/berrange/src/virt/qemu/linux-headers
-I/home/berrange/src/virt/qemu-build/linux-headers
-I/home/berrange/src/virt/qemu/include

Yes, and ultimately tcg too.

Quoted 4 lines

So the problem with dropping BUILD_DIR from the include path is that config-host.h is generated in that location. We'll have to move that into BIULD_DIR/include and add -I$(BUILDDIR)/include to search path instead.

Sigh and much more needs moving too...

module_block.h
qapi-event.h
qapi-types.h
qapi-visit.h
qemu-doc.html
qemu-version.h
qemu-version.h.tmp
qmp-commands.h
qmp-introspect.h

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#13 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

----- Original Message -----

Quoted 33 lines

From: "Daniel P. Berrange" <[email protected]>
To: "Paolo Bonzini" <[email protected]>
Cc: [email protected], "Stefan Hajnoczi" <[email protected]>
Sent: Wednesday, January 11, 2017 11:34:42 AM
Subject: Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 19 lines · Daniel P. Berrange
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Daniel P. Berrange

It seems you're saying we should also trim the top level dirs, so we in fact get:

Quoted 9 lines

Review

Quoted 7 lines
(quoted diff) +0 -7
-I/home/berrange/src/virt/qemu/hw/scsi
-Ihw/scsi
-I/home/berrange/src/virt/qemu/tcg
-I/home/berrange/src/virt/qemu/tcg/i386
-I/home/berrange/src/virt/qemu/linux-headers
-I/home/berrange/src/virt/qemu-build/linux-headers
-I/home/berrange/src/virt/qemu/include

Yes, and ultimately tcg too.

Quoted 4 lines

So the problem with dropping BUILD_DIR from the include path is that config-host.h is generated in that location. We'll have to move that into BIULD_DIR/include and add -I$(BUILDDIR)/include to search path instead.

Sigh and much more needs moving too...

Quoted 9 lines

module_block.h
qapi-event.h
qapi-types.h
qapi-visit.h
qemu-doc.html
qemu-version.h
qemu-version.h.tmp
qmp-commands.h
qmp-introspect.h

Can we at least move it at the end?

Paolo

#16 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Eric Blake
Quoted 15 lines · Eric Blake
Quoted 13 lines · Stefan Hajnoczi

io/channel-buffer.c line 25

Quoted 10 lines · Daniel P. Berrange
io/channel-buffer.c +1 -1
index 43d7959..b4e50d6 100644
@@ -22,7 +22,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"

Is this change necessary?

Quoted 4 lines

Yes - now that there are more than one trace.h files spread across multiple directories, you need a prefix to ensure the correct one gets included. In this particular case, it also matches consistency in including "io/channel-buffer.h" rather than just "channel-buffer.h".

"io/channel-buffer.h" is no more consistent or clear than "channel-buffer.h".

Does it mean include/io/channel-buffer.h or ./include/io/channel-buffer.h? You don't know unless you know the compiler include paths and which directories have a channel-buffer.h file.

IMO a simple "foo.h" is clearest for ./foo.h.

Stefan

#17 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 24 lines · Stefan Hajnoczi
Quoted 15 lines · Eric Blake
Quoted 13 lines · Stefan Hajnoczi

io/channel-buffer.c line 25

Quoted 10 lines · Daniel P. Berrange
io/channel-buffer.c +1 -1
index 43d7959..b4e50d6 100644
@@ -22,7 +22,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
-#include "trace.h"
+#include "io/trace.h"

Is this change necessary?

Quoted 4 lines

Yes - now that there are more than one trace.h files spread across multiple directories, you need a prefix to ensure the correct one gets included. In this particular case, it also matches consistency in including "io/channel-buffer.h" rather than just "channel-buffer.h".

"io/channel-buffer.h" is no more consistent or clear than "channel-buffer.h".

Quoted 6 lines

Does it mean include/io/channel-buffer.h or ./include/io/channel-buffer.h? You don't know unless you know the compiler include paths and which directories have a channel-buffer.h file.

IMO a simple "foo.h" is clearest for ./foo.h.

I've been trying to get such relative includes to work most of today and not having much luck. The problem is that while it works in 95% of the time, there are some source files and header files which need to include trace.h files not in their local directory and we can't use relative includes for that, since the relative include gets resolved wrt the source file doing the #include, but the trace.h file is in $BUILD_DIR.

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#27 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Stefan Hajnoczi
Quoted 14 lines · Stefan Hajnoczi

io/Makefile.objs io-obj-y += channel-watch.o · line 12

Quoted 10 lines · Daniel P. Berrange
io/Makefile.objs +2 -0
index 9d8337d..94cb74e 100644
@@ -8,3 +8,5 @@ io-obj-y += channel-watch.o
 io-obj-y += channel-websock.o
 io-obj-y += channel-util.o
 io-obj-y += task.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o

Is there a way to eliminate this boilerplate? If the directory has a trace-events file then it requires trace.o/trace-dtrace.o.

Yes in fact. I figured out a rule in the top level Makefile.objs that can do this for all sub-dirs

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#18 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Daniel P. Berrange
Quoted 4 lines · Daniel P. Berrange

I've been trying to get such relative includes to work most of today and not having much luck. The problem is that while it works in 95% of the time, there are some source files and header files which need to include trace.h files not in their local directory

Which are they? I wouldn't have expected that to happen.

Quoted 4 lines

and we can't
use relative includes for that, since the relative include gets resolved wrt the source file doing the #include, but the trace.h file is in $BUILD_DIR.

Why would #include "../foo/trace.h" be resolved against the source file's path only, and not against all -I directories?

Paolo

#19 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 9 lines · Paolo Bonzini
Quoted 4 lines · Daniel P. Berrange

I've been trying to get such relative includes to work most of today and not having much luck. The problem is that while it works in 95% of the time, there are some source files and header files which need to include trace.h files not in their local directory

Which are they? I wouldn't have expected that to happen.

It is indirect - particularly Xen - include/hw/xen/xen_common.h hsa some trace points and that is included from many different source files. Likewise with include/exec/cpu_ldst_template.h

Quoted 7 lines
Quoted 4 lines

and we can't
use relative includes for that, since the relative include gets resolved wrt the source file doing the #include, but the trace.h file is in $BUILD_DIR.

Why would #include "../foo/trace.h" be resolved against the source file's path only, and not against all -I directories?

If we have a plain "../trace.h", then it can end up hitting the wrong file, because there are many -I dirs listed and most of them contain a trace.h file, so if it matches on the 2nd -I dir and you need the one from the 3rd -I dir it gets "fun".

Having all the trace.h files included with path from the root is alot simpler to understand IMHO than just plain "trace.h" and hoping the -I order is going to ensure the right one is found

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|
#20 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 9 lines · Daniel P. Berrange
Quoted 8 lines · Paolo Bonzini
Quoted 4 lines · Daniel P. Berrange

I've been trying to get such relative includes to work most of today and not having much luck. The problem is that while it works in 95% of the time, there are some source files and header files which need to include trace.h files not in their local directory

Quoted 5 lines
Quoted 1 line

Which are they? I wouldn't have expected that to happen.

It is indirect - particularly Xen - include/hw/xen/xen_common.h hsa some trace points and that is included from many different source files. Likewise with include/exec/cpu_ldst_template.h

I see. Yeah, this gets tricky for template-style headers. (In the case of include/hw/xen/xen_common.h I would just move the functions to a .c file, but that's a separate thing and the template-style headers are a real problem).

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

and we can't
use relative includes for that, since the relative include gets resolved wrt the source file doing the #include, but the trace.h file is in $BUILD_DIR.

Quoted 7 lines
Quoted 2 lines

Why would #include "../foo/trace.h" be resolved against the source file's path only, and not against all -I directories?

If we have a plain "../trace.h", then it can end up hitting the wrong file, because there are many -I dirs listed and most of them contain a trace.h file, so if it matches on the 2nd -I dir and you need the one from the 3rd -I dir it gets "fun".

Hmm, I would have expected only the .o directory to have a ../trace.h. But again it doesn't help for template-style headers where ../trace.h is resolved according to the including file, not the included file.

A weird idea: what about doing

-DGENERATED_TRACERS_H=\"hw/scsi/generated-tracers.h\"

and then having

     #ifdef GENERATED_TRACE_H
     #include GENERATED_TRACE_H
     #endif

in include/trace.h?

Then you can use full include path for special cases such as include/hw/xen/xen_common.h, but the common case is handled directly with just

     #include "trace.h"

which refers to $(srcdir)/include/trace.h? (Take the above with a grain of salt because I haven't reviewed the patches closely).

Paolo

Quoted 4 lines

Having all the trace.h files included with path from the root is alot simpler to understand IMHO than just plain "trace.h" and hoping the -I order is going to ensure the right one is found

#25 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Daniel P. Berrange
Quoted 1 line · Daniel P Berrange

On Wed, Jan 11, 2017 at 06:34:40PM +0100, Paolo Bonzini wrote:

[...]

Quoted 13 lines
Quoted 7 lines
Quoted 4 lines

and we can't
use relative includes for that, since the relative include gets resolved wrt the source file doing the #include, but the trace.h file is in $BUILD_DIR.

Why would #include "../foo/trace.h" be resolved against the source file's path only, and not against all -I directories?

If we have a plain "../trace.h", then it can end up hitting the wrong file, because there are many -I dirs listed and most of them contain a trace.h file, so if it matches on the 2nd -I dir and you need the one from the 3rd -I dir it gets "fun".

Quoted 4 lines

Having all the trace.h files included with path from the root is alot simpler to understand IMHO than just plain "trace.h" and hoping the -I order is going to ensure the right one is found

I'm with Daniel and and Eric on this one, for whatever it matters. It's clearer to *me* to have includes starting on the project's root.

Cheers,
Lluis

#21 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Paolo Bonzini

Paolo Bonzini writes:
[...]

Quoted 12 lines

A weird idea: what about doing

-DGENERATED_TRACERS_H=\"hw/scsi/generated-tracers.h\"

and then having

     #ifdef GENERATED_TRACE_H
     #include GENERATED_TRACE_H
     #endif

in include/trace.h?

Quoted 8 lines

Then you can use full include path for special cases such as include/hw/xen/xen_common.h, but the common case is handled directly with just

     #include "trace.h"

which refers to $(srcdir)/include/trace.h? (Take the above with a grain of salt because I haven't reviewed the patches closely).

Feels like too much black magic to me for the benefit of a bit less typing.

Cheers,
Lluis

#22 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 18 lines · Lluís Vilanova

Paolo Bonzini writes:
[...]

Quoted 15 lines

A weird idea: what about doing

-DGENERATED_TRACERS_H=\"hw/scsi/generated-tracers.h\"

and then having

     #ifdef GENERATED_TRACE_H
     #include GENERATED_TRACE_H
     #endif

in include/trace.h?

Then you can use full include path for special cases such as include/hw/xen/xen_common.h, but the common case is handled directly with just

Quoted 6 lines
Quoted 4 lines
     #include "trace.h"

which refers to $(srcdir)/include/trace.h? (Take the above with a grain of salt because I haven't reviewed the patches closely).

Feels like too much black magic to me for the benefit of a bit less typing.

It's not less typing, it's about consistency. Includes from the
current directory are currently included with no path.

Paolo

#23 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

Quoted 21 lines · Paolo Bonzini
Quoted 20 lines · Lluís Vilanova

Paolo Bonzini writes:
[...]

Quoted 17 lines

A weird idea: what about doing

-DGENERATED_TRACERS_H=\"hw/scsi/generated-tracers.h\"

and then having

#ifdef GENERATED_TRACE_H
#include GENERATED_TRACE_H
#endif

in include/trace.h?

Then you can use full include path for special cases such as include/hw/xen/xen_common.h, but the common case is handled directly with just

#include "trace.h"

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

which refers to $(srcdir)/include/trace.h? (Take the above with a grain of salt because I haven't reviewed the patches closely).

Feels like too much black magic to me for the benefit of a bit less typing.

It's not less typing, it's about consistency. Includes from the
current directory are currently included with no path.

Ah, right. My subconscious made me ignore that, since I already said it's cleaner to me to use the "full" path. Sorry about that :)

Cheers,
Lluis

#24 lore raw

Re: [Qemu-devel] [PATCH v2 02/47] trace: switch io/ directory to modular trace.h file

In reply to Paolo Bonzini
Quoted 23 lines · Paolo Bonzini
Quoted 20 lines · Lluís Vilanova

Paolo Bonzini writes:
[...]

Quoted 17 lines

A weird idea: what about doing

-DGENERATED_TRACERS_H=\"hw/scsi/generated-tracers.h\"

and then having

     #ifdef GENERATED_TRACE_H
     #include GENERATED_TRACE_H
     #endif

in include/trace.h?

Then you can use full include path for special cases such as include/hw/xen/xen_common.h, but the common case is handled directly with just

     #include "trace.h"
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

which refers to $(srcdir)/include/trace.h? (Take the above with a grain of salt because I haven't reviewed the patches closely).

Feels like too much black magic to me for the benefit of a bit less typing.

It's not less typing, it's about consistency. Includes from the
current directory are currently included with no path.

I think I am able to workaround the problems by just renaming the top level file to trace-root.h to avoid ambiguity. Just testing builds now...

Regards,
Daniel

Signature · 3 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|