All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
@ 2016-08-09 15:31 Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 01/60] trace: move util/buffer.c trace points into correct file Daniel P. Berrange
                   ` (63 more replies)
  0 siblings, 64 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

I previously split the global trace-events file up into one file
per-subdirectory to avoid merge conflict hell.

This series builds on that to now actually generate the individual
trace files per-subdirectory too. The key benefit of doing this is
that a change in a trace-events file will no longer cause a rebuild
of the entire world. Instead only that one affected sub-directory
will have files rebuilt.

The key problem faced when creating this patch series was the fact
that the trace code had a global assumption that there was a single
enum declaring all events in a sequence with no gaps. Most of the
hard work in this series involves getting rid of that assumption
throughout the code. Instead we now have a notion of trace event
groups, each with their own distinct enum of events. As such the
individual event IDs are no longer globally unique. Most of the
code could be adapted to work with IDs that were unique only within
a group.

The first sticky part was the simpletrace binary event format which
includes the event ID. To deal with this I invented a notion of an
ID offset per trace-events file. So simpletrace format will now
use   "(id-offset << 16) | event-id" in order to get a globally
unique ID value for its trace files. This means each trace-events
file can only have 65536 distinct events declared, but that ought
to be enough for a while :-)

The second sticky part was the per-VCPU events, due to the use of
a "trace_dstate" bitmap in the CPUState struct. The bitmap
inherantly assumes a global ID sequence, and would not work well
with the per-file id-offset concept, since it would require a
huge mostly-sparse bitmap.  Rather than try to solve this problem
I took the easy way out and simply specified that all per-VCPU
events need to be declared in the top level trace-events file.
Since we have almost no per-vCPU events today, this works out
just fine.

I've build-tested with all targets enabled in both VPATH and
non-VPATH setups, on Fedora 24, with all 5 trace event backends
enabled at once. I've tested that simpletrace.py can still
extract events from generated traces. I've not functionally
tested dtrace/ftrace/ust at this time.

Daniel P. Berrange (60):
  trace: move util/buffer.c trace points into correct file
  trace: move util/qemu-coroutine*.c trace points into correct file
  trace: move hw/mem/pc-dimm.c trace points into correct file
  trace: move hw/virtio/virtio-balloon.c trace points into correct file
  trace: add trace event iterator APIs
  trace: convert code to use event iterators
  trace: remove some now unused functions
  trace: provide mechanism for registering trace events
  trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h
  trace: remove fixed global event state arrays
  trace: remove use of event ID enums from APIs
  trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value
  trace: remove generated-events.h from many includes
  trace: get rid of generated-events.h/generated-events.c
  trace: introduce a formal group name for trace events
  trace: introduce ID range offsets per trace-events file
  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-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: remove the global include/trace.h file
  trace: update docs to reflect new code generation approach

 .gitignore                                       |  15 +-
 Makefile                                         | 116 +++++++++++---
 Makefile.objs                                    |  89 ++++++-----
 Makefile.target                                  |   7 +-
 audio/Makefile.objs                              |   2 +
 audio/alsaaudio.c                                |   2 +-
 audio/ossaudio.c                                 |   2 +-
 audio/trace-events                               |   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 +-
 block/trace-events                               |   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 +-
 crypto/trace-events                              |   2 +
 docs/tracing.txt                                 |  61 ++++++--
 hw/9pfs/9p.c                                     |   2 +-
 hw/9pfs/Makefile.objs                            |   2 +
 hw/9pfs/trace-events                             |   2 +
 hw/acpi/Makefile.objs                            |   2 +
 hw/acpi/cpu.c                                    |   2 +-
 hw/acpi/memory_hotplug.c                         |   2 +-
 hw/acpi/trace-events                             |   2 +
 hw/alpha/Makefile.objs                           |   2 +
 hw/alpha/pci.c                                   |   2 +-
 hw/alpha/trace-events                            |   2 +
 hw/arm/Makefile.objs                             |   2 +
 hw/arm/trace-events                              |   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/audio/trace-events                            |   2 +
 hw/block/Makefile.objs                           |   2 +
 hw/block/dataplane/virtio-blk.c                  |   2 +-
 hw/block/hd-geometry.c                           |   2 +-
 hw/block/trace-events                            |   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/trace-events                             |   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/trace-events                          |   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/dma/trace-events                              |   2 +
 hw/i386/Makefile.objs                            |   2 +
 hw/i386/trace-events                             |   6 +-
 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/trace-events                            |   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/trace-events                             |   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/isa/trace-events                              |   2 +
 hw/mem/Makefile.objs                             |   3 +
 hw/mem/pc-dimm.c                                 |   2 +-
 hw/mem/trace-events                              |   7 +
 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/misc/trace-events                             |   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/net/trace-events                              |   2 +
 hw/nvram/Makefile.objs                           |   2 +
 hw/nvram/ds1225y.c                               |   2 +-
 hw/nvram/fw_cfg.c                                |   2 +-
 hw/nvram/trace-events                            |   2 +
 hw/pci/Makefile.objs                             |   2 +
 hw/pci/pci.c                                     |   2 +-
 hw/pci/pci_host.c                                |   2 +-
 hw/pci/trace-events                              |   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/ppc/trace-events                              |   2 +
 hw/s390x/Makefile.objs                           |   3 +
 hw/s390x/css.c                                   |   2 +-
 hw/s390x/trace-events                            |   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/trace-events                             |   2 +
 hw/scsi/vmw_pvscsi.c                             |   2 +-
 hw/sd/Makefile.objs                              |   2 +
 hw/sd/milkymist-memcard.c                        |   2 +-
 hw/sd/trace-events                               |   2 +
 hw/sparc/Makefile.objs                           |   2 +
 hw/sparc/leon3.c                                 |   2 +-
 hw/sparc/sun4m.c                                 |   2 +-
 hw/sparc/trace-events                            |   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/timer/trace-events                            |   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                                |   8 +-
 hw/usb/hcd-uhci.c                                |   2 +-
 hw/usb/hcd-xhci.c                                |   2 +-
 hw/usb/host-libusb.c                             |   2 +-
 hw/usb/trace-events                              |   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/vfio/trace-events                             |   2 +
 hw/virtio/Makefile.objs                          |   2 +
 hw/virtio/trace-events                           |   7 +
 hw/virtio/virtio-balloon.c                       |   2 +-
 hw/virtio/virtio-rng.c                           |   2 +-
 hw/virtio/virtio.c                               |   2 +-
 include/qemu/module.h                            |   2 +
 include/qom/cpu.h                                |  10 +-
 include/trace-tcg.h                              |   1 -
 include/trace.h                                  |   7 -
 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 +-
 io/trace-events                                  |   6 +-
 linux-user/Makefile.objs                         |   2 +
 linux-user/signal.c                              |   2 +-
 linux-user/trace-events                          |   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/trace-events                           |   2 +
 migration/vmstate.c                              |   2 +-
 monitor.c                                        |  16 +-
 net/Makefile.objs                                |   2 +
 net/filter-mirror.c                              |   2 +-
 net/trace-events                                 |   2 +
 net/vhost-user.c                                 |   2 +-
 qemu-img.c                                       |   1 +
 qemu-io.c                                        |   1 +
 qemu-nbd.c                                       |   1 +
 qom/Makefile.objs                                |   2 +
 qom/cpu.c                                        |   2 +-
 qom/object.c                                     |   2 +-
 qom/trace-events                                 |   2 +
 scripts/simpletrace.py                           |   7 +-
 scripts/tracetool.py                             |  10 +-
 scripts/tracetool/__init__.py                    |  59 +++++--
 scripts/tracetool/backend/__init__.py            |  12 +-
 scripts/tracetool/backend/dtrace.py              |   6 +-
 scripts/tracetool/backend/ftrace.py              |   7 +-
 scripts/tracetool/backend/log.py                 |   6 +-
 scripts/tracetool/backend/simple.py              |  13 +-
 scripts/tracetool/backend/ust.py                 |   6 +-
 scripts/tracetool/format/__init__.py             |   4 +-
 scripts/tracetool/format/c.py                    |  48 +++++-
 scripts/tracetool/format/d.py                    |   2 +-
 scripts/tracetool/format/events_c.py             |  44 ------
 scripts/tracetool/format/events_h.py             |  60 -------
 scripts/tracetool/format/h.py                    |  51 +++++-
 scripts/tracetool/format/simpletrace_stap.py     |   4 +-
 scripts/tracetool/format/stap.py                 |   2 +-
 scripts/tracetool/format/tcg_h.py                |   2 +-
 scripts/tracetool/format/tcg_helper_c.py         |   2 +-
 scripts/tracetool/format/tcg_helper_h.py         |   2 +-
 scripts/tracetool/format/tcg_helper_wrapper_h.py |   2 +-
 scripts/tracetool/format/ust_events_c.py         |   4 +-
 scripts/tracetool/format/ust_events_h.py         |  15 +-
 stubs/trace-control.c                            |   8 +-
 target-i386/Makefile.objs                        |   2 +
 target-i386/kvm.c                                |   2 +-
 target-i386/trace-events                         |   2 +
 target-ppc/Makefile.objs                         |   2 +
 target-ppc/kvm.c                                 |   2 +-
 target-ppc/trace-events                          |   2 +
 target-s390x/Makefile.objs                       |   2 +
 target-s390x/cpu.c                               |   2 +-
 target-s390x/ioinst.c                            |   2 +-
 target-s390x/kvm.c                               |   2 +-
 target-s390x/mmu_helper.c                        |   2 +-
 target-s390x/trace-events                        |   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/trace-events                        |   2 +
 target-sparc/win_helper.c                        |   2 +-
 trace-events                                     |  19 +--
 trace/Makefile.objs                              |  98 ++----------
 trace/control-internal.h                         |  39 ++---
 trace/control-target.c                           |  20 +--
 trace/control.c                                  | 191 +++++++++++++++++------
 trace/control.h                                  | 108 +++----------
 trace/event-internal.h                           |   7 +-
 trace/qmp.c                                      |  29 ++--
 trace/simple.c                                   |   6 +-
 trace/simple.h                                   |   6 +-
 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/trace-events                                  |   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 +-
 util/trace-events                                |  21 +++
 vl.c                                             |   2 +
 321 files changed, 1058 insertions(+), 768 deletions(-)
 create mode 100644 hw/mem/trace-events
 delete mode 100644 include/trace.h
 delete mode 100644 scripts/tracetool/format/events_c.py
 delete mode 100644 scripts/tracetool/format/events_h.py

-- 
2.7.4

^ permalink raw reply	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 01/60] trace: move util/buffer.c trace points into correct file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 02/60] trace: move util/qemu-coroutine*.c " Daniel P. Berrange
                   ` (62 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The trace points for util/buffer.c were mistakenly put
in the io/trace-events file, instead of util/trace-events.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 io/trace-events   | 6 ------
 util/trace-events | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/io/trace-events b/io/trace-events
index 1108c16..8d84eda 100644
--- a/io/trace-events
+++ b/io/trace-events
@@ -1,11 +1,5 @@
 # See docs/trace-events.txt for syntax documentation.
 
-# io/buffer.c
-buffer_resize(const char *buf, size_t olen, size_t len) "%s: old %zd, new %zd"
-buffer_move_empty(const char *buf, size_t len, const char *from) "%s: %zd bytes from %s"
-buffer_move(const char *buf, size_t len, const char *from) "%s: %zd bytes from %s"
-buffer_free(const char *buf, size_t len) "%s: capacity %zd"
-
 # io/task.c
 qio_task_new(void *task, void *source, void *func, void *opaque) "Task new task=%p source=%p func=%p opaque=%p"
 qio_task_complete(void *task) "Task complete task=%p"
diff --git a/util/trace-events b/util/trace-events
index 3ce5f1e..da63e58 100644
--- a/util/trace-events
+++ b/util/trace-events
@@ -1,5 +1,11 @@
 # See docs/trace-events.txt for syntax documentation.
 
+# util/buffer.c
+buffer_resize(const char *buf, size_t olen, size_t len) "%s: old %zd, new %zd"
+buffer_move_empty(const char *buf, size_t len, const char *from) "%s: %zd bytes from %s"
+buffer_move(const char *buf, size_t len, const char *from) "%s: %zd bytes from %s"
+buffer_free(const char *buf, size_t len) "%s: capacity %zd"
+
 # util/oslib-win32.c
 # util/oslib-posix.c
 qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 02/60] trace: move util/qemu-coroutine*.c trace points into correct file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 01/60] trace: move util/buffer.c trace points into correct file Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 03/60] trace: move hw/mem/pc-dimm.c " Daniel P. Berrange
                   ` (61 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The trace points for util/qemu-coroutine*.c were mistakenly put
in the top level trace-events file, instead of util/trace-events.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 trace-events      | 13 -------------
 util/trace-events | 13 +++++++++++++
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/trace-events b/trace-events
index 52c6a6c..ae8f0ad 100644
--- a/trace-events
+++ b/trace-events
@@ -82,19 +82,6 @@ xen_map_cache(uint64_t phys_addr) "want %#"PRIx64
 xen_remap_bucket(uint64_t index) "index %#"PRIx64
 xen_map_cache_return(void* ptr) "%p"
 
-# qemu-coroutine.c
-qemu_coroutine_enter(void *from, void *to, void *opaque) "from %p to %p opaque %p"
-qemu_coroutine_yield(void *from, void *to) "from %p to %p"
-qemu_coroutine_terminate(void *co) "self %p"
-
-# qemu-coroutine-lock.c
-qemu_co_queue_run_restart(void *co) "co %p"
-qemu_co_queue_next(void *nxt) "next %p"
-qemu_co_mutex_lock_entry(void *mutex, void *self) "mutex %p self %p"
-qemu_co_mutex_lock_return(void *mutex, void *self) "mutex %p self %p"
-qemu_co_mutex_unlock_entry(void *mutex, void *self) "mutex %p self %p"
-qemu_co_mutex_unlock_return(void *mutex, void *self) "mutex %p self %p"
-
 # monitor.c
 handle_qmp_command(void *mon, const char *cmd_name) "mon %p cmd_name \"%s\""
 monitor_protocol_emitter(void *mon) "mon %p"
diff --git a/util/trace-events b/util/trace-events
index da63e58..111e1de 100644
--- a/util/trace-events
+++ b/util/trace-events
@@ -6,6 +6,19 @@ buffer_move_empty(const char *buf, size_t len, const char *from) "%s: %zd bytes
 buffer_move(const char *buf, size_t len, const char *from) "%s: %zd bytes from %s"
 buffer_free(const char *buf, size_t len) "%s: capacity %zd"
 
+# util/qemu-coroutine.c
+qemu_coroutine_enter(void *from, void *to, void *opaque) "from %p to %p opaque %p"
+qemu_coroutine_yield(void *from, void *to) "from %p to %p"
+qemu_coroutine_terminate(void *co) "self %p"
+
+# util/qemu-coroutine-lock.c
+qemu_co_queue_run_restart(void *co) "co %p"
+qemu_co_queue_next(void *nxt) "next %p"
+qemu_co_mutex_lock_entry(void *mutex, void *self) "mutex %p self %p"
+qemu_co_mutex_lock_return(void *mutex, void *self) "mutex %p self %p"
+qemu_co_mutex_unlock_entry(void *mutex, void *self) "mutex %p self %p"
+qemu_co_mutex_unlock_return(void *mutex, void *self) "mutex %p self %p"
+
 # util/oslib-win32.c
 # util/oslib-posix.c
 qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 03/60] trace: move hw/mem/pc-dimm.c trace points into correct file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 01/60] trace: move util/buffer.c trace points into correct file Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 02/60] trace: move util/qemu-coroutine*.c " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 04/60] trace: move hw/virtio/virtio-balloon.c " Daniel P. Berrange
                   ` (60 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The trace points for hw/mem/pc-dimm.c were mistakenly put
in the hw/i386/trace-events file, instead of hw/mem/trace-events.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs        | 1 +
 hw/i386/trace-events | 4 ----
 hw/mem/trace-events  | 5 +++++
 3 files changed, 6 insertions(+), 4 deletions(-)
 create mode 100644 hw/mem/trace-events

diff --git a/Makefile.objs b/Makefile.objs
index 6d5ddcf..b371ebb 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -141,6 +141,7 @@ trace-events-y += hw/dma/trace-events
 trace-events-y += hw/sparc/trace-events
 trace-events-y += hw/sd/trace-events
 trace-events-y += hw/isa/trace-events
+trace-events-y += hw/mem/trace-events
 trace-events-y += hw/i386/trace-events
 trace-events-y += hw/9pfs/trace-events
 trace-events-y += hw/ppc/trace-events
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
index b4882c1..507f753 100644
--- a/hw/i386/trace-events
+++ b/hw/i386/trace-events
@@ -7,9 +7,5 @@ xen_platform_log(char *s) "xen platform: %s"
 xen_pv_mmio_read(uint64_t addr) "WARNING: read from Xen PV Device MMIO space (address %"PRIx64")"
 xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (address %"PRIx64")"
 
-# hw/i386/pc.c
-mhp_pc_dimm_assigned_slot(int slot) "0x%d"
-mhp_pc_dimm_assigned_address(uint64_t addr) "0x%"PRIx64
-
 # hw/i386/x86-iommu.c
 x86_iommu_iec_notify(bool global, uint32_t index, uint32_t mask) "Notify IEC invalidation: global=%d index=%" PRIu32 " mask=%" PRIu32
diff --git a/hw/mem/trace-events b/hw/mem/trace-events
new file mode 100644
index 0000000..3a49215
--- /dev/null
+++ b/hw/mem/trace-events
@@ -0,0 +1,5 @@
+# See docs/trace-events.txt for syntax documentation.
+
+# hw/mem/pc-dimm.c
+mhp_pc_dimm_assigned_slot(int slot) "0x%d"
+mhp_pc_dimm_assigned_address(uint64_t addr) "0x%"PRIx64
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 04/60] trace: move hw/virtio/virtio-balloon.c trace points into correct file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (2 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 03/60] trace: move hw/mem/pc-dimm.c " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-09-08 18:09   ` Eric Blake
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 05/60] trace: add trace event iterator APIs Daniel P. Berrange
                   ` (59 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The trace points for hw/virtio/virtio-balloon.c were mistakenly put
in the top level trace-events file, instead of util/trace-events.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 hw/virtio/trace-events | 5 +++++
 trace-events           | 4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
index 2853053..6849a44 100644
--- a/hw/virtio/trace-events
+++ b/hw/virtio/trace-events
@@ -14,3 +14,8 @@ virtio_rng_guest_not_ready(void *rng) "rng %p: guest not ready"
 virtio_rng_pushed(void *rng, size_t len) "rng %p: %zd bytes pushed"
 virtio_rng_request(void *rng, size_t size, unsigned quota) "rng %p: %zd bytes requested, %u bytes quota left"
 
+# hw/virtio/virtio-balloon.c
+virtio_balloon_handle_output(const char *name, uint64_t gpa) "section name: %s gpa: %"PRIx64
+virtio_balloon_get_config(uint32_t num_pages, uint32_t actual) "num_pages: %d actual: %d"
+virtio_balloon_set_config(uint32_t actual, uint32_t oldactual) "actual: %d oldactual: %d"
+virtio_balloon_to_target(uint64_t target, uint32_t num_pages) "balloon target: %"PRIx64" num_pages: %d"
diff --git a/trace-events b/trace-events
index ae8f0ad..1de7e99 100644
--- a/trace-events
+++ b/trace-events
@@ -37,10 +37,6 @@ cpu_out(unsigned int addr, char size, unsigned int val) "addr %#x(%c) value %u"
 # balloon.c
 # Since requests are raised via monitor, not many tracepoints are needed.
 balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu"
-virtio_balloon_handle_output(const char *name, uint64_t gpa) "section name: %s gpa: %"PRIx64
-virtio_balloon_get_config(uint32_t num_pages, uint32_t actual) "num_pages: %d actual: %d"
-virtio_balloon_set_config(uint32_t actual, uint32_t oldactual) "actual: %d oldactual: %d"
-virtio_balloon_to_target(uint64_t target, uint32_t num_pages) "balloon target: %"PRIx64" num_pages: %d"
 
 # vl.c
 vm_state_notify(int running, int reason) "running %d reason %d"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 05/60] trace: add trace event iterator APIs
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (3 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 04/60] trace: move hw/virtio/virtio-balloon.c " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-09-02 20:52   ` Stefan Hajnoczi
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 06/60] trace: convert code to use event iterators Daniel P. Berrange
                   ` (58 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

Currently methods which want to iterate over trace events,
do so using the trace_event_count() and trace_event_id()
methods. This leaks the concept of a single ID enum to
the callers. There is an alternative trace_event_pattern()
method which can be used in an iteration context, but its
design is stateless, so is not easy to expand it in the
future.

This defines a formal iterator API will provide an future
proof way of iterating over events.

The iterator is also able to apply a pattern match filter
to events, further removing the need for the pattern

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 trace/control.c | 26 ++++++++++++++++++++++++++
 trace/control.h |  9 +++++++++
 2 files changed, 35 insertions(+)

diff --git a/trace/control.c b/trace/control.c
index d173c09..deab872 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -124,6 +124,32 @@ TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev)
     return NULL;
 }
 
+void trace_event_iter_init(TraceEventIter *iter, const char *pattern)
+{
+    iter->event = 0;
+    iter->pattern = pattern;
+}
+
+TraceEvent *trace_event_iter_next(TraceEventIter *iter)
+{
+    TraceEvent *ev;
+
+    if (iter->event >= TRACE_EVENT_COUNT) {
+        return NULL;
+    }
+
+    ev = &(trace_events[iter->event]);
+
+    do {
+        iter->event++;
+    } while (iter->event < TRACE_EVENT_COUNT &&
+             iter->pattern &&
+             !pattern_glob(iter->pattern,
+                           trace_event_get_name(&(trace_events[iter->event]))));
+
+    return ev;
+}
+
 void trace_list_events(void)
 {
     int i;
diff --git a/trace/control.h b/trace/control.h
index 0413b28..a3a8a78 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -13,6 +13,10 @@
 #include "qemu-common.h"
 #include "trace/generated-events.h"
 
+typedef struct TraceEventIter {
+    size_t event;
+    const char *pattern;
+} TraceEventIter;
 
 /**
  * TraceEventID:
@@ -25,6 +29,11 @@
  */
 enum TraceEventID;
 
+
+void trace_event_iter_init(TraceEventIter *iter, const char *pattern);
+
+TraceEvent *trace_event_iter_next(TraceEventIter *iter);
+
 /**
  * trace_event_id:
  * @id: Event identifier.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 06/60] trace: convert code to use event iterators
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (4 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 05/60] trace: add trace event iterator APIs Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-09-02 20:55   ` Stefan Hajnoczi
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 07/60] trace: remove some now unused functions Daniel P. Berrange
                   ` (57 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

This converts the HMP/QMP monitor API implementations
and some internal trace control methods to use the new
trace event iterator APIs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 monitor.c       | 16 ++++++----
 trace/control.c | 92 +++++++++++++++++++++++++++++++++------------------------
 trace/qmp.c     | 16 ++++++----
 3 files changed, 73 insertions(+), 51 deletions(-)

diff --git a/monitor.c b/monitor.c
index 5c00373..7b979a6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3335,9 +3335,11 @@ void info_trace_events_completion(ReadLineState *rs, int nb_args, const char *st
     len = strlen(str);
     readline_set_completion_index(rs, len);
     if (nb_args == 2) {
-        TraceEventID id;
-        for (id = 0; id < trace_event_count(); id++) {
-            const char *event_name = trace_event_get_name(trace_event_id(id));
+        TraceEventIter iter;
+        TraceEvent *ev;
+        trace_event_iter_init(&iter, NULL);
+        while ((ev = trace_event_iter_next(&iter)) != NULL) {
+            const char *event_name = trace_event_get_name(ev);
             if (!strncmp(str, event_name, len)) {
                 readline_add_completion(rs, event_name);
             }
@@ -3352,9 +3354,11 @@ void trace_event_completion(ReadLineState *rs, int nb_args, const char *str)
     len = strlen(str);
     readline_set_completion_index(rs, len);
     if (nb_args == 2) {
-        TraceEventID id;
-        for (id = 0; id < trace_event_count(); id++) {
-            const char *event_name = trace_event_get_name(trace_event_id(id));
+        TraceEventIter iter;
+        TraceEvent *ev;
+        trace_event_iter_init(&iter, NULL);
+        while ((ev = trace_event_iter_next(&iter)) != NULL) {
+            const char *event_name = trace_event_get_name(ev);
             if (!strncmp(str, event_name, len)) {
                 readline_add_completion(rs, event_name);
             }
diff --git a/trace/control.c b/trace/control.c
index deab872..dbf47fc 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -59,9 +59,10 @@ TraceEvent *trace_event_name(const char *name)
 {
     assert(name != NULL);
 
-    TraceEventID i;
-    for (i = 0; i < trace_event_count(); i++) {
-        TraceEvent *ev = trace_event_id(i);
+    TraceEventIter iter;
+    TraceEvent *ev;
+    trace_event_iter_init(&iter, NULL);
+    while ((ev = trace_event_iter_next(&iter)) != NULL) {
         if (strcmp(trace_event_get_name(ev), name) == 0) {
             return ev;
         }
@@ -104,21 +105,20 @@ TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev)
 {
     assert(pat != NULL);
 
-    TraceEventID i;
-
-    if (ev == NULL) {
-        i = -1;
-    } else {
-        i = trace_event_get_id(ev);
-    }
-    i++;
-
-    while (i < trace_event_count()) {
-        TraceEvent *res = trace_event_id(i);
-        if (pattern_glob(pat, trace_event_get_name(res))) {
-            return res;
+    bool matched = ev ? false : true;
+    TraceEventIter iter;
+    TraceEvent *thisev;
+    trace_event_iter_init(&iter, NULL);
+    while ((thisev = trace_event_iter_next(&iter)) != NULL) {
+        if (matched) {
+            if (pattern_glob(pat, trace_event_get_name(thisev))) {
+                return thisev;
+            }
+        } else {
+            if (ev == thisev) {
+                matched = true;
+            }
         }
-        i++;
     }
 
     return NULL;
@@ -152,10 +152,11 @@ TraceEvent *trace_event_iter_next(TraceEventIter *iter)
 
 void trace_list_events(void)
 {
-    int i;
-    for (i = 0; i < trace_event_count(); i++) {
-        TraceEvent *res = trace_event_id(i);
-        fprintf(stderr, "%s\n", trace_event_get_name(res));
+    TraceEventIter iter;
+    TraceEvent *ev;
+    trace_event_iter_init(&iter, NULL);
+    while ((ev = trace_event_iter_next(&iter)) != NULL) {
+        fprintf(stderr, "%s\n", trace_event_get_name(ev));
     }
 }
 
@@ -163,32 +164,43 @@ static void do_trace_enable_events(const char *line_buf)
 {
     const bool enable = ('-' != line_buf[0]);
     const char *line_ptr = enable ? line_buf : line_buf + 1;
+    TraceEventIter iter;
+    TraceEvent *ev;
+    bool is_pattern = trace_event_is_pattern(line_ptr);
 
-    if (trace_event_is_pattern(line_ptr)) {
-        TraceEvent *ev = NULL;
-        while ((ev = trace_event_pattern(line_ptr, ev)) != NULL) {
+    trace_event_iter_init(&iter, is_pattern ? line_ptr : NULL);
+    while ((ev = trace_event_iter_next(&iter)) != NULL) {
+        bool match = false;
+        if (is_pattern) {
             if (trace_event_get_state_static(ev)) {
-                /* start tracing */
-                trace_event_set_state_dynamic(ev, enable);
-                /* mark for late vCPU init */
-                trace_events_dstate_init[ev->id] = true;
+                match = true;
             }
-        }
-    } else {
-        TraceEvent *ev = trace_event_name(line_ptr);
-        if (ev == NULL) {
-            error_report("WARNING: trace event '%s' does not exist",
-                         line_ptr);
-        } else if (!trace_event_get_state_static(ev)) {
-            error_report("WARNING: trace event '%s' is not traceable",
-                         line_ptr);
         } else {
+            if (g_str_equal(trace_event_get_name(ev),
+                            line_ptr)) {
+                if (!trace_event_get_state_static(ev)) {
+                    error_report("WARNING: trace event '%s' is not traceable",
+                                 line_ptr);
+                    return;
+                }
+                match = true;
+            }
+        }
+        if (match) {
             /* start tracing */
             trace_event_set_state_dynamic(ev, enable);
             /* mark for late vCPU init */
             trace_events_dstate_init[ev->id] = true;
+            if (!is_pattern) {
+                return;
+            }
         }
     }
+
+    if (!is_pattern) {
+        error_report("WARNING: trace event '%s' does not exist",
+                     line_ptr);
+    }
 }
 
 void trace_enable_events(const char *line_buf)
@@ -299,8 +311,10 @@ char *trace_opt_parse(const char *optarg)
 
 void trace_init_vcpu_events(void)
 {
-    TraceEvent *ev = NULL;
-    while ((ev = trace_event_pattern("*", ev)) != NULL) {
+    TraceEventIter iter;
+    TraceEvent *ev;
+    trace_event_iter_init(&iter, NULL);
+    while ((ev = trace_event_iter_next(&iter)) != NULL) {
         if (trace_event_is_vcpu(ev) &&
             trace_event_get_state_static(ev) &&
             trace_events_dstate_init[ev->id]) {
diff --git a/trace/qmp.c b/trace/qmp.c
index 11d2564..88a907b 100644
--- a/trace/qmp.c
+++ b/trace/qmp.c
@@ -52,8 +52,10 @@ static bool check_events(bool has_vcpu, bool ignore_unavailable, bool is_pattern
         return true;
     } else {
         /* error for unavailable events */
-        TraceEvent *ev = NULL;
-        while ((ev = trace_event_pattern(name, ev)) != NULL) {
+        TraceEventIter iter;
+        TraceEvent *ev;
+        trace_event_iter_init(&iter, name);
+        while ((ev = trace_event_iter_next(&iter)) != NULL) {
             if (!ignore_unavailable && !trace_event_get_state_static(ev)) {
                 error_setg(errp, "event \"%s\" is disabled", trace_event_get_name(ev));
                 return false;
@@ -69,6 +71,7 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name,
 {
     Error *err = NULL;
     TraceEventInfoList *events = NULL;
+    TraceEventIter iter;
     TraceEvent *ev;
     bool is_pattern = trace_event_is_pattern(name);
     CPUState *cpu;
@@ -86,8 +89,8 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name,
     }
 
     /* Get states (all errors checked above) */
-    ev = NULL;
-    while ((ev = trace_event_pattern(name, ev)) != NULL) {
+    trace_event_iter_init(&iter, is_pattern ? name : NULL);
+    while ((ev = trace_event_iter_next(&iter)) != NULL) {
         TraceEventInfoList *elem;
         bool is_vcpu = trace_event_is_vcpu(ev);
         if (has_vcpu && !is_vcpu) {
@@ -132,6 +135,7 @@ void qmp_trace_event_set_state(const char *name, bool enable,
                                Error **errp)
 {
     Error *err = NULL;
+    TraceEventIter iter;
     TraceEvent *ev;
     bool is_pattern = trace_event_is_pattern(name);
     CPUState *cpu;
@@ -150,8 +154,8 @@ void qmp_trace_event_set_state(const char *name, bool enable,
     }
 
     /* Apply changes (all errors checked above) */
-    ev = NULL;
-    while ((ev = trace_event_pattern(name, ev)) != NULL) {
+    trace_event_iter_init(&iter, name);
+    while ((ev = trace_event_iter_next(&iter)) != NULL) {
         if (!trace_event_get_state_static(ev) ||
             (has_vcpu && !trace_event_is_vcpu(ev))) {
             continue;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 07/60] trace: remove some now unused functions
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (5 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 06/60] trace: convert code to use event iterators Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 08/60] trace: provide mechanism for registering trace events Daniel P. Berrange
                   ` (56 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The trace_event_count, trace_event_id and
trace_event_pattern methods are no longer required
now that everything is using the iterator APIs

The trace_event_set_state and trace_event_set_vcpu_state
macros were also unused.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 trace/control-internal.h | 11 ---------
 trace/control.c          | 22 ------------------
 trace/control.h          | 59 ------------------------------------------------
 3 files changed, 92 deletions(-)

diff --git a/trace/control-internal.h b/trace/control-internal.h
index a4e5f4a..7f31e39 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -20,17 +20,6 @@ extern uint16_t trace_events_dstate[];
 extern int trace_events_enabled_count;
 
 
-static inline TraceEventID trace_event_count(void)
-{
-    return TRACE_EVENT_COUNT;
-}
-
-static inline TraceEvent *trace_event_id(TraceEventID id)
-{
-    assert(id < trace_event_count());
-    return &trace_events[id];
-}
-
 static inline bool trace_event_is_pattern(const char *str)
 {
     assert(str != NULL);
diff --git a/trace/control.c b/trace/control.c
index dbf47fc..7ba171b 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -101,28 +101,6 @@ static bool pattern_glob(const char *pat, const char *ev)
     }
 }
 
-TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev)
-{
-    assert(pat != NULL);
-
-    bool matched = ev ? false : true;
-    TraceEventIter iter;
-    TraceEvent *thisev;
-    trace_event_iter_init(&iter, NULL);
-    while ((thisev = trace_event_iter_next(&iter)) != NULL) {
-        if (matched) {
-            if (pattern_glob(pat, trace_event_get_name(thisev))) {
-                return thisev;
-            }
-        } else {
-            if (ev == thisev) {
-                matched = true;
-            }
-        }
-    }
-
-    return NULL;
-}
 
 void trace_event_iter_init(TraceEventIter *iter, const char *pattern)
 {
diff --git a/trace/control.h b/trace/control.h
index a3a8a78..3f00adc 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -34,21 +34,6 @@ void trace_event_iter_init(TraceEventIter *iter, const char *pattern);
 
 TraceEvent *trace_event_iter_next(TraceEventIter *iter);
 
-/**
- * trace_event_id:
- * @id: Event identifier.
- *
- * Get an event by its identifier.
- *
- * This routine has a constant cost, as opposed to trace_event_name and
- * trace_event_pattern.
- *
- * Pre-conditions: The identifier is valid.
- *
- * Returns: pointer to #TraceEvent.
- *
- */
-static TraceEvent *trace_event_id(TraceEventID id);
 
 /**
  * trace_event_name:
@@ -61,31 +46,12 @@ static TraceEvent *trace_event_id(TraceEventID id);
 TraceEvent *trace_event_name(const char *name);
 
 /**
- * trace_event_pattern:
- * @pat: Event name pattern.
- * @ev: Event to start searching from (not included).
- *
- * Get all events with a given name pattern.
- *
- * Returns: pointer to #TraceEvent or NULL if not found.
- */
-TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev);
-
-/**
  * trace_event_is_pattern:
  *
  * Whether the given string is an event name pattern.
  */
 static bool trace_event_is_pattern(const char *str);
 
-/**
- * trace_event_count:
- *
- * Return the number of events.
- */
-static TraceEventID trace_event_count(void);
-
-
 
 /**
  * trace_event_get_id:
@@ -176,31 +142,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *ev);
  */
 static bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, TraceEvent *ev);
 
-/**
- * trace_event_set_state:
- *
- * Set the tracing state of an event (only if possible).
- */
-#define trace_event_set_state(id, state)                \
-    do {                                                \
-        if ((id ##_ENABLED)) {                          \
-            TraceEvent *_e = trace_event_id(id);        \
-            trace_event_set_state_dynamic(_e, state);   \
-        }                                               \
-    } while (0)
-
-/**
- * trace_event_set_vcpu_state:
- *
- * Set the tracing state of an event for the given vCPU (only if not disabled).
- */
-#define trace_event_set_vcpu_state(vcpu, id, state)                     \
-    do {                                                                \
-        if ((id ##_ENABLED)) {                                          \
-            TraceEvent *_e = trace_event_id(id);                        \
-            trace_event_set_vcpu_state_dynamic(vcpu, _e, state);        \
-        }                                                               \
-    } while (0)
 
 /**
  * trace_event_set_state_dynamic:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 08/60] trace: provide mechanism for registering trace events
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (6 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 07/60] trace: remove some now unused functions Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 16:17   ` Paolo Bonzini
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 09/60] trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h Daniel P. Berrange
                   ` (55 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

Remove the notion of there being a single global array
of trace events, by introducing a method for registering
groups of events. The ID values will only be required to
be unique within the scope of a group of events.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 include/qemu/module.h                |  2 ++
 qemu-img.c                           |  1 +
 qemu-io.c                            |  1 +
 qemu-nbd.c                           |  1 +
 scripts/tracetool/format/events_c.py |  6 ++++++
 scripts/tracetool/format/events_h.py |  1 +
 trace/control-internal.h             |  5 ++++-
 trace/control.c                      | 38 +++++++++++++++++++++++++++++++-----
 trace/control.h                      |  1 +
 vl.c                                 |  2 ++
 10 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/include/qemu/module.h b/include/qemu/module.h
index 2370708..c700961 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -44,6 +44,7 @@ typedef enum {
     MODULE_INIT_OPTS,
     MODULE_INIT_QAPI,
     MODULE_INIT_QOM,
+    MODULE_INIT_TRACE,
     MODULE_INIT_MAX
 } module_init_type;
 
@@ -51,6 +52,7 @@ typedef enum {
 #define opts_init(function) module_init(function, MODULE_INIT_OPTS)
 #define qapi_init(function) module_init(function, MODULE_INIT_QAPI)
 #define type_init(function) module_init(function, MODULE_INIT_QOM)
+#define trace_init(function) module_init(function, MODULE_INIT_TRACE)
 
 void register_module_init(void (*fn)(void), module_init_type type);
 void register_dso_module_init(void (*fn)(void), module_init_type type);
diff --git a/qemu-img.c b/qemu-img.c
index d2865a5..db97195 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3822,6 +3822,7 @@ int main(int argc, char **argv)
     signal(SIGPIPE, SIG_IGN);
 #endif
 
+    module_call_init(MODULE_INIT_TRACE);
     error_set_progname(argv[0]);
     qemu_init_exec_dir(argv[0]);
 
diff --git a/qemu-io.c b/qemu-io.c
index db129ea..23a229f 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -467,6 +467,7 @@ int main(int argc, char **argv)
     signal(SIGPIPE, SIG_IGN);
 #endif
 
+    module_call_init(MODULE_INIT_TRACE);
     progname = basename(argv[0]);
     qemu_init_exec_dir(argv[0]);
 
diff --git a/qemu-nbd.c b/qemu-nbd.c
index e3571c2..ea1beed 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -533,6 +533,7 @@ int main(int argc, char **argv)
     sa_sigterm.sa_handler = termsig_handler;
     sigaction(SIGTERM, &sa_sigterm, NULL);
 
+    module_call_init(MODULE_INIT_TRACE);
     qcrypto_init(&error_fatal);
 
     module_call_init(MODULE_INIT_QOM);
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index 4012063..9203377 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -42,3 +42,9 @@ def generate(events, backend):
 
     out('};',
         '')
+
+    out('void trace_register_events(void)',
+        '{',
+        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT);',
+        '}',
+        'trace_init(trace_register_events)')
diff --git a/scripts/tracetool/format/events_h.py b/scripts/tracetool/format/events_h.py
index a9da60b..291c183 100644
--- a/scripts/tracetool/format/events_h.py
+++ b/scripts/tracetool/format/events_h.py
@@ -56,5 +56,6 @@ def generate(events, backend):
         out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
 
     out('#include "trace/event-internal.h"',
+        'void trace_register_events(void);',
         '',
         '#endif  /* TRACE__GENERATED_EVENTS_H */')
diff --git a/trace/control-internal.h b/trace/control-internal.h
index 7f31e39..e95b031 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -15,7 +15,6 @@
 #include "qom/cpu.h"
 
 
-extern TraceEvent trace_events[];
 extern uint16_t trace_events_dstate[];
 extern int trace_events_enabled_count;
 
@@ -88,4 +87,8 @@ static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu,
     return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, id);
 }
 
+
+void trace_event_register_group(TraceEvent *events,
+                                size_t nevents);
+
 #endif /* TRACE__CONTROL_INTERNAL_H */
diff --git a/trace/control.c b/trace/control.c
index 7ba171b..4847a51 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -25,6 +25,15 @@
 #include "monitor/monitor.h"
 
 int trace_events_enabled_count;
+
+typedef struct TraceEventGroup {
+    TraceEvent *events;
+    size_t nevents;
+} TraceEventGroup;
+
+static TraceEventGroup *event_groups;
+static size_t nevent_groups;
+
 /*
  * Interpretation depends on wether the event has the 'vcpu' property:
  * - false: Boolean value indicating whether the event is active.
@@ -55,6 +64,16 @@ QemuOptsList qemu_trace_opts = {
 };
 
 
+void trace_event_register_group(TraceEvent *events,
+                                size_t nevents)
+{
+    event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1);
+    event_groups[nevent_groups].events = events;
+    event_groups[nevent_groups].nevents = nevents;
+    nevent_groups++;
+}
+
+
 TraceEvent *trace_event_name(const char *name)
 {
     assert(name != NULL);
@@ -105,6 +124,7 @@ static bool pattern_glob(const char *pat, const char *ev)
 void trace_event_iter_init(TraceEventIter *iter, const char *pattern)
 {
     iter->event = 0;
+    iter->group = 0;
     iter->pattern = pattern;
 }
 
@@ -112,18 +132,26 @@ TraceEvent *trace_event_iter_next(TraceEventIter *iter)
 {
     TraceEvent *ev;
 
-    if (iter->event >= TRACE_EVENT_COUNT) {
+    if (iter->group >= nevent_groups ||
+        iter->event >= event_groups[iter->group].nevents) {
         return NULL;
     }
 
-    ev = &(trace_events[iter->event]);
+    ev = &(event_groups[iter->group].events[iter->event]);
 
     do {
         iter->event++;
-    } while (iter->event < TRACE_EVENT_COUNT &&
+        if (iter->event >= event_groups[iter->group].nevents) {
+            iter->event = 0;
+            iter->group++;
+        }
+    } while (iter->group < nevent_groups &&
+             iter->event < event_groups[iter->group].nevents &&
              iter->pattern &&
-             !pattern_glob(iter->pattern,
-                           trace_event_get_name(&(trace_events[iter->event]))));
+             !pattern_glob(
+                 iter->pattern,
+                 trace_event_get_name(
+                     &(event_groups[iter->group].events[iter->event]))));
 
     return ev;
 }
diff --git a/trace/control.h b/trace/control.h
index 3f00adc..81471ad 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -15,6 +15,7 @@
 
 typedef struct TraceEventIter {
     size_t event;
+    size_t group;
     const char *pattern;
 } TraceEventIter;
 
diff --git a/vl.c b/vl.c
index c4eeaff..f65deca 100644
--- a/vl.c
+++ b/vl.c
@@ -2964,6 +2964,8 @@ int main(int argc, char **argv, char **envp)
     Error *err = NULL;
     bool list_data_dirs = false;
 
+    module_call_init(MODULE_INIT_TRACE);
+
     qemu_init_cpu_loop();
     qemu_mutex_lock_iothread();
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 09/60] trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (7 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 08/60] trace: provide mechanism for registering trace events Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-09-02 21:03   ` Stefan Hajnoczi
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays Daniel P. Berrange
                   ` (54 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The CPUState struct has a bitmap tracking which VCPU
events are currently active. This is indexed based on
the event ID values, and sized according the maximum
TraceEventVCPUID enum value. Since there will the
possibility of having multiple event groups, the
indexes will potentially overlap.

Rather than creating a more complex 2 dimensional
data structure in CPUState, make an assumption that
all the per-VCPU events will be defined in the same
event group. Do a sanity check for this assumption
when registering event groups.

In addition, rather than using the TRACE_VCPU_EVENT_COUNT
constant, which requires pulling in the enourmous trace
events header, define a fixed bitmap size, which allows
for 32 events. This will suffice for the immediate future
and can be easily raised later if needed.

With this change, the cpu.h file no longer has a direct
dependancy on the generate events header file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 include/qom/cpu.h | 10 ++++++++--
 qom/cpu.c         |  2 +-
 trace/control.c   | 15 +++++++++++++++
 trace/control.h   |  1 +
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index ce0c406..6e39cf7 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -27,7 +27,6 @@
 #include "qemu/bitmap.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
-#include "trace/generated-events.h"
 
 typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size,
                                      void *opaque);
@@ -240,6 +239,13 @@ struct qemu_work_item {
     bool free;
 };
 
+
+/* Keep this a multiple of 8, or better yet a multiple
+ * of the platform word size, since the struct
+ * will be padded out to that regardless.
+ */
+#define TRACE_MAX_VCPU_EVENT 32
+
 /**
  * CPUState:
  * @cpu_index: CPU index (informative).
@@ -351,7 +357,7 @@ struct CPUState {
     struct kvm_run *kvm_run;
 
     /* Used for events with 'vcpu' and *without* the 'disabled' properties */
-    DECLARE_BITMAP(trace_dstate, TRACE_VCPU_EVENT_COUNT);
+    DECLARE_BITMAP(trace_dstate, TRACE_MAX_VCPU_EVENT);
 
     /* TODO Move common fields from CPUArchState here. */
     int cpu_index; /* used by alpha TCG */
diff --git a/qom/cpu.c b/qom/cpu.c
index 2553247..8b5280a 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -345,7 +345,7 @@ static void cpu_common_initfn(Object *obj)
     qemu_mutex_init(&cpu->work_mutex);
     QTAILQ_INIT(&cpu->breakpoints);
     QTAILQ_INIT(&cpu->watchpoints);
-    bitmap_zero(cpu->trace_dstate, TRACE_VCPU_EVENT_COUNT);
+    bitmap_zero(cpu->trace_dstate, TRACE_MAX_VCPU_EVENT);
 }
 
 static void cpu_common_finalize(Object *obj)
diff --git a/trace/control.c b/trace/control.c
index 4847a51..d0aa075 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -31,6 +31,7 @@ typedef struct TraceEventGroup {
     size_t nevents;
 } TraceEventGroup;
 
+static bool have_vcpu_events;
 static TraceEventGroup *event_groups;
 static size_t nevent_groups;
 
@@ -67,6 +68,20 @@ QemuOptsList qemu_trace_opts = {
 void trace_event_register_group(TraceEvent *events,
                                 size_t nevents)
 {
+    size_t nvcpuevents = 0;
+    for (size_t i = 0; i < nevents; i++) {
+        if (events[i].vcpu_id != TRACE_VCPU_EVENT_COUNT) {
+            nvcpuevents++;
+        }
+    }
+
+    if (nvcpuevents) {
+        /* We only support 1 group having vcpu events */
+        assert(!have_vcpu_events);
+        assert(nvcpuevents < TRACE_MAX_VCPU_EVENT);
+        have_vcpu_events = true;
+    }
+
     event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1);
     event_groups[nevent_groups].events = events;
     event_groups[nevent_groups].nevents = nevents;
diff --git a/trace/control.h b/trace/control.h
index 81471ad..c9ea2f6 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -19,6 +19,7 @@ typedef struct TraceEventIter {
     const char *pattern;
 } TraceEventIter;
 
+
 /**
  * TraceEventID:
  *
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (8 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 09/60] trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-10 14:00   ` Lluís Vilanova
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs Daniel P. Berrange
                   ` (53 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

There are currently two global event state arrays,
'uint16 dstate[]' and 'bool dstate_init[]' whose
sized is defined based on the TRACE_EVENT_COUNT
enum value.

When multiple event groups are enabled, it won't
be possible to used a fixed global event state.
This change thus expands the event group register
method so that the event state arrays can be passed
in when the group is registered.

When calling the methods for setting/getting the
trace event state, the caller also needs to pass
in the corresponding 'dstate' array. While it
would be possible to look up the array in the
group list, these methods are in the hot-path,
so passing in the array directly is hugely more
efficient. The extra parameter is no real burden
on callers, since all the code is auto-generated,
with the exception of a call in hw/usb/hcd-ohci.c

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 hw/usb/hcd-ohci.c                    |  4 +--
 scripts/tracetool/backend/simple.py  |  2 +-
 scripts/tracetool/format/events_c.py |  7 +++--
 scripts/tracetool/format/events_h.py |  3 ++
 stubs/trace-control.c                |  8 ++----
 trace/control-internal.h             | 17 ++++++-----
 trace/control-target.c               | 14 ++++-----
 trace/control.c                      | 56 ++++++++++++++++++++++++++----------
 trace/control.h                      | 15 ++++++----
 trace/qmp.c                          | 17 +++++++----
 10 files changed, 93 insertions(+), 50 deletions(-)

diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index fa57038..87508a7 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -937,8 +937,8 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
 #ifdef trace_event_get_state
 static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
 {
-    bool print16 = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_SHORT);
-    bool printall = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_FULL);
+    bool print16 = !!trace_event_get_state(dstate, TRACE_USB_OHCI_TD_PKT_SHORT);
+    bool printall = !!trace_event_get_state(dstate, TRACE_USB_OHCI_TD_PKT_FULL);
     const int width = 16;
     int i;
     char tmp[3 * width + 1];
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index 1bccada..c2a8468 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -73,7 +73,7 @@ def generate_c(event):
         # already checked on the generic format code
         cond = "true"
     else:
-        cond = "trace_event_get_state(%s)" % event_id
+        cond = "trace_event_get_state(dstate, %s)" % event_id
 
     out('',
         '    if (!%(cond)s) {',
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index 9203377..bab6404 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -25,7 +25,10 @@ def generate(events, backend):
         '#include "trace/control.h"',
         '')
 
-    out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
+    out('uint16_t dstate[TRACE_EVENT_COUNT];')
+    out('bool dstate_init[TRACE_EVENT_COUNT];')
+
+    out('static TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
 
     for e in events:
         if "vcpu" in e.properties:
@@ -45,6 +48,6 @@ def generate(events, backend):
 
     out('void trace_register_events(void)',
         '{',
-        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT);',
+        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT, dstate, dstate_init);',
         '}',
         'trace_init(trace_register_events)')
diff --git a/scripts/tracetool/format/events_h.py b/scripts/tracetool/format/events_h.py
index 291c183..d6465d4 100644
--- a/scripts/tracetool/format/events_h.py
+++ b/scripts/tracetool/format/events_h.py
@@ -55,6 +55,9 @@ def generate(events, backend):
                 enabled=enabled)
         out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
 
+    out('extern uint16_t dstate[TRACE_EVENT_COUNT];')
+    out('extern bool dstate_init[TRACE_EVENT_COUNT];')
+
     out('#include "trace/event-internal.h"',
         'void trace_register_events(void);',
         '',
diff --git a/stubs/trace-control.c b/stubs/trace-control.c
index fe59836..31566c2 100644
--- a/stubs/trace-control.c
+++ b/stubs/trace-control.c
@@ -11,16 +11,12 @@
 #include "trace/control.h"
 
 
-void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
+void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev, bool state)
 {
-    TraceEventID id;
     assert(trace_event_get_state_static(ev));
-    id = trace_event_get_id(ev);
-    trace_events_enabled_count += state - trace_events_dstate[id];
-    trace_events_dstate[id] = state;
 }
 
-void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
+void trace_event_set_vcpu_state_dynamic(uint16_t *dstate, CPUState *vcpu,
                                         TraceEvent *ev, bool state)
 {
     /* should never be called on non-target binaries */
diff --git a/trace/control-internal.h b/trace/control-internal.h
index e95b031..634effe 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -15,7 +15,6 @@
 #include "qom/cpu.h"
 
 
-extern uint16_t trace_events_dstate[];
 extern int trace_events_enabled_count;
 
 
@@ -53,22 +52,24 @@ static inline bool trace_event_get_state_static(TraceEvent *ev)
     return ev->sstate;
 }
 
-static inline bool trace_event_get_state_dynamic_by_id(TraceEventID id)
+static inline bool trace_event_get_state_dynamic_by_id(
+    uint16_t *trace_events_dstate, TraceEventID id)
 {
     /* it's on fast path, avoid consistency checks (asserts) */
     return unlikely(trace_events_enabled_count) && trace_events_dstate[id];
 }
 
-static inline bool trace_event_get_state_dynamic(TraceEvent *ev)
+static inline bool trace_event_get_state_dynamic(
+    uint16_t *trace_events_dstate, TraceEvent *ev)
 {
     TraceEventID id;
     assert(trace_event_get_state_static(ev));
     id = trace_event_get_id(ev);
-    return trace_event_get_state_dynamic_by_id(id);
+    return trace_event_get_state_dynamic_by_id(trace_events_dstate, id);
 }
 
-static inline bool trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu,
-                                                                 TraceEventVCPUID id)
+static inline bool trace_event_get_vcpu_state_dynamic_by_vcpu_id(
+    CPUState *vcpu, TraceEventVCPUID id)
 {
     /* it's on fast path, avoid consistency checks (asserts) */
     if (unlikely(trace_events_enabled_count)) {
@@ -89,6 +90,8 @@ static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu,
 
 
 void trace_event_register_group(TraceEvent *events,
-                                size_t nevents);
+                                size_t nevents,
+                                uint16_t *dstate,
+                                bool *dstate_init);
 
 #endif /* TRACE__CONTROL_INTERNAL_H */
diff --git a/trace/control-target.c b/trace/control-target.c
index 74c029a..da326b4 100644
--- a/trace/control-target.c
+++ b/trace/control-target.c
@@ -13,22 +13,22 @@
 #include "translate-all.h"
 
 
-void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
+void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev, bool state)
 {
     CPUState *vcpu;
     assert(trace_event_get_state_static(ev));
     if (trace_event_is_vcpu(ev)) {
         CPU_FOREACH(vcpu) {
-            trace_event_set_vcpu_state_dynamic(vcpu, ev, state);
+            trace_event_set_vcpu_state_dynamic(dstate, vcpu, ev, state);
         }
     } else {
         TraceEventID id = trace_event_get_id(ev);
-        trace_events_enabled_count += state - trace_events_dstate[id];
-        trace_events_dstate[id] = state;
+        trace_events_enabled_count += state - dstate[id];
+        dstate[id] = state;
     }
 }
 
-void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
+void trace_event_set_vcpu_state_dynamic(uint16_t *dstate, CPUState *vcpu,
                                         TraceEvent *ev, bool state)
 {
     TraceEventID id;
@@ -43,11 +43,11 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
         if (state) {
             trace_events_enabled_count++;
             set_bit(vcpu_id, vcpu->trace_dstate);
-            trace_events_dstate[id]++;
+            dstate[id]++;
         } else {
             trace_events_enabled_count--;
             clear_bit(vcpu_id, vcpu->trace_dstate);
-            trace_events_dstate[id]--;
+            dstate[id]--;
         }
     }
 }
diff --git a/trace/control.c b/trace/control.c
index d0aa075..29659a1 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -29,20 +29,22 @@ int trace_events_enabled_count;
 typedef struct TraceEventGroup {
     TraceEvent *events;
     size_t nevents;
+    /*
+     * Interpretation depends on wether the event has the 'vcpu' property:
+     * - false: Boolean value indicating whether the event is active.
+     * - true : Integral counting the number of vCPUs that have this event
+     *          enabled.
+     */
+    uint16_t *dstate;
+    /* Marks events for late vCPU state init */
+    bool *dstate_init;
 } TraceEventGroup;
 
 static bool have_vcpu_events;
 static TraceEventGroup *event_groups;
 static size_t nevent_groups;
 
-/*
- * Interpretation depends on wether the event has the 'vcpu' property:
- * - false: Boolean value indicating whether the event is active.
- * - true : Integral counting the number of vCPUs that have this event enabled.
- */
-uint16_t trace_events_dstate[TRACE_EVENT_COUNT];
-/* Marks events for late vCPU state init */
-static bool trace_events_dstate_init[TRACE_EVENT_COUNT];
+static bool pattern_glob(const char *pat, const char *ev);
 
 QemuOptsList qemu_trace_opts = {
     .name = "trace",
@@ -66,7 +68,9 @@ QemuOptsList qemu_trace_opts = {
 
 
 void trace_event_register_group(TraceEvent *events,
-                                size_t nevents)
+                                size_t nevents,
+                                uint16_t *dstate,
+                                bool *dstate_init)
 {
     size_t nvcpuevents = 0;
     for (size_t i = 0; i < nevents; i++) {
@@ -85,6 +89,8 @@ void trace_event_register_group(TraceEvent *events,
     event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1);
     event_groups[nevent_groups].events = events;
     event_groups[nevent_groups].nevents = nevents;
+    event_groups[nevent_groups].dstate = dstate;
+    event_groups[nevent_groups].dstate_init = dstate_init;
     nevent_groups++;
 }
 
@@ -145,6 +151,14 @@ void trace_event_iter_init(TraceEventIter *iter, const char *pattern)
 
 TraceEvent *trace_event_iter_next(TraceEventIter *iter)
 {
+    return trace_event_iter_next_full(iter, NULL, NULL);
+}
+
+
+TraceEvent *trace_event_iter_next_full(TraceEventIter *iter,
+                                       uint16_t **dstate,
+                                       bool **dstate_init)
+{
     TraceEvent *ev;
 
     if (iter->group >= nevent_groups ||
@@ -153,6 +167,12 @@ TraceEvent *trace_event_iter_next(TraceEventIter *iter)
     }
 
     ev = &(event_groups[iter->group].events[iter->event]);
+    if (dstate) {
+        *dstate = event_groups[iter->group].dstate;
+    }
+    if (dstate_init) {
+        *dstate_init = event_groups[iter->group].dstate_init;
+    }
 
     do {
         iter->event++;
@@ -188,9 +208,12 @@ static void do_trace_enable_events(const char *line_buf)
     TraceEventIter iter;
     TraceEvent *ev;
     bool is_pattern = trace_event_is_pattern(line_ptr);
+    uint16_t *dstate;
+    bool *dstate_init;
 
     trace_event_iter_init(&iter, is_pattern ? line_ptr : NULL);
-    while ((ev = trace_event_iter_next(&iter)) != NULL) {
+    while ((ev = trace_event_iter_next_full(&iter, &dstate, &dstate_init)) !=
+           NULL) {
         bool match = false;
         if (is_pattern) {
             if (trace_event_get_state_static(ev)) {
@@ -209,9 +232,9 @@ static void do_trace_enable_events(const char *line_buf)
         }
         if (match) {
             /* start tracing */
-            trace_event_set_state_dynamic(ev, enable);
+            trace_event_set_state_dynamic(dstate, ev, enable);
             /* mark for late vCPU init */
-            trace_events_dstate_init[ev->id] = true;
+            dstate_init[ev->id] = true;
             if (!is_pattern) {
                 return;
             }
@@ -334,12 +357,15 @@ void trace_init_vcpu_events(void)
 {
     TraceEventIter iter;
     TraceEvent *ev;
+    uint16_t *dstate;
+    bool *dstate_init;
     trace_event_iter_init(&iter, NULL);
-    while ((ev = trace_event_iter_next(&iter)) != NULL) {
+    while ((ev = trace_event_iter_next_full(&iter, &dstate, &dstate_init)) !=
+           NULL) {
         if (trace_event_is_vcpu(ev) &&
             trace_event_get_state_static(ev) &&
-            trace_events_dstate_init[ev->id]) {
-            trace_event_set_state_dynamic(ev, true);
+            dstate_init[ev->id]) {
+            trace_event_set_state_dynamic(dstate, ev, true);
         }
     }
 }
diff --git a/trace/control.h b/trace/control.h
index c9ea2f6..a5cb7f3 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -35,6 +35,9 @@ enum TraceEventID;
 void trace_event_iter_init(TraceEventIter *iter, const char *pattern);
 
 TraceEvent *trace_event_iter_next(TraceEventIter *iter);
+TraceEvent *trace_event_iter_next_full(TraceEventIter *iter,
+                                       uint16_t **dstate,
+                                       bool **dstate_init);
 
 
 /**
@@ -97,8 +100,8 @@ static const char * trace_event_get_name(TraceEvent *ev);
  *
  * As a down side, you must always use an immediate #TraceEventID value.
  */
-#define trace_event_get_state(id)                       \
-    ((id ##_ENABLED) && trace_event_get_state_dynamic_by_id(id))
+#define trace_event_get_state(dstate, id)                                \
+    ((id ##_ENABLED) && trace_event_get_state_dynamic_by_id(dstate, id))
 
 /**
  * trace_event_get_vcpu_state:
@@ -135,7 +138,8 @@ static bool trace_event_get_state_static(TraceEvent *ev);
  *
  * If the event has the 'vcpu' property, gets the OR'ed state of all vCPUs.
  */
-static bool trace_event_get_state_dynamic(TraceEvent *ev);
+static bool trace_event_get_state_dynamic(uint16_t *dstate,
+                                          TraceEvent *ev);
 
 /**
  * trace_event_get_vcpu_state_dynamic:
@@ -154,7 +158,8 @@ static bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, TraceEvent *ev);
  *
  * Pre-condition: trace_event_get_state_static(ev) == true
  */
-void trace_event_set_state_dynamic(TraceEvent *ev, bool state);
+void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev,
+                                   bool state);
 
 /**
  * trace_event_set_vcpu_state_dynamic:
@@ -163,7 +168,7 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool state);
  *
  * Pre-condition: trace_event_get_vcpu_state_static(ev) == true
  */
-void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
+void trace_event_set_vcpu_state_dynamic(uint16_t *dstate, CPUState *vcpu,
                                         TraceEvent *ev, bool state);
 
 
diff --git a/trace/qmp.c b/trace/qmp.c
index 88a907b..190049a 100644
--- a/trace/qmp.c
+++ b/trace/qmp.c
@@ -73,6 +73,8 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name,
     TraceEventInfoList *events = NULL;
     TraceEventIter iter;
     TraceEvent *ev;
+    uint16_t *dstate;
+    bool *dstate_init;
     bool is_pattern = trace_event_is_pattern(name);
     CPUState *cpu;
 
@@ -90,9 +92,11 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name,
 
     /* Get states (all errors checked above) */
     trace_event_iter_init(&iter, is_pattern ? name : NULL);
-    while ((ev = trace_event_iter_next(&iter)) != NULL) {
+    while ((ev = trace_event_iter_next_full(&iter, &dstate, &dstate_init)) !=
+           NULL) {
         TraceEventInfoList *elem;
         bool is_vcpu = trace_event_is_vcpu(ev);
+        g_assert(dstate);
         if (has_vcpu && !is_vcpu) {
             continue;
         }
@@ -115,7 +119,7 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name,
                 }
                 /* else: already skipped above */
             } else {
-                if (trace_event_get_state_dynamic(ev)) {
+                if (trace_event_get_state_dynamic(dstate, ev)) {
                     elem->value->state = TRACE_EVENT_STATE_ENABLED;
                 } else {
                     elem->value->state = TRACE_EVENT_STATE_DISABLED;
@@ -139,6 +143,8 @@ void qmp_trace_event_set_state(const char *name, bool enable,
     TraceEvent *ev;
     bool is_pattern = trace_event_is_pattern(name);
     CPUState *cpu;
+    uint16_t *dstate;
+    bool *dstate_init;
 
     /* Check provided vcpu */
     cpu = get_cpu(has_vcpu, vcpu, &err);
@@ -155,15 +161,16 @@ void qmp_trace_event_set_state(const char *name, bool enable,
 
     /* Apply changes (all errors checked above) */
     trace_event_iter_init(&iter, name);
-    while ((ev = trace_event_iter_next(&iter)) != NULL) {
+    while ((ev = trace_event_iter_next_full(&iter, &dstate, &dstate_init)) !=
+           NULL) {
         if (!trace_event_get_state_static(ev) ||
             (has_vcpu && !trace_event_is_vcpu(ev))) {
             continue;
         }
         if (has_vcpu) {
-            trace_event_set_vcpu_state_dynamic(cpu, ev, enable);
+            trace_event_set_vcpu_state_dynamic(dstate, cpu, ev, enable);
         } else {
-            trace_event_set_state_dynamic(ev, enable);
+            trace_event_set_state_dynamic(dstate, ev, enable);
         }
     }
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (9 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 16:18   ` Paolo Bonzini
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 12/60] trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value Daniel P. Berrange
                   ` (52 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

Since there will shortly be multiple event groups allowed,
we can no longer use the TraceEventID and TraceEventVCPUID
enums in the trace control APIs. There will in fact be
multiple distinct enums, and the enum values will only be
required to be unique per group.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 trace/control-internal.h | 14 +++++++-------
 trace/control-target.c   |  6 +++---
 trace/control.h          | 25 ++++++-------------------
 trace/event-internal.h   |  4 ++--
 trace/simple.c           |  6 +++---
 trace/simple.h           |  2 +-
 6 files changed, 22 insertions(+), 35 deletions(-)

diff --git a/trace/control-internal.h b/trace/control-internal.h
index 634effe..b7048d4 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -24,13 +24,13 @@ static inline bool trace_event_is_pattern(const char *str)
     return strchr(str, '*') != NULL;
 }
 
-static inline TraceEventID trace_event_get_id(TraceEvent *ev)
+static inline size_t trace_event_get_id(TraceEvent *ev)
 {
     assert(ev != NULL);
     return ev->id;
 }
 
-static inline TraceEventVCPUID trace_event_get_vcpu_id(TraceEvent *ev)
+static inline size_t trace_event_get_vcpu_id(TraceEvent *ev)
 {
     return ev->vcpu_id;
 }
@@ -53,7 +53,7 @@ static inline bool trace_event_get_state_static(TraceEvent *ev)
 }
 
 static inline bool trace_event_get_state_dynamic_by_id(
-    uint16_t *trace_events_dstate, TraceEventID id)
+    uint16_t *trace_events_dstate, size_t id)
 {
     /* it's on fast path, avoid consistency checks (asserts) */
     return unlikely(trace_events_enabled_count) && trace_events_dstate[id];
@@ -62,14 +62,14 @@ static inline bool trace_event_get_state_dynamic_by_id(
 static inline bool trace_event_get_state_dynamic(
     uint16_t *trace_events_dstate, TraceEvent *ev)
 {
-    TraceEventID id;
+    size_t id;
     assert(trace_event_get_state_static(ev));
     id = trace_event_get_id(ev);
     return trace_event_get_state_dynamic_by_id(trace_events_dstate, id);
 }
 
-static inline bool trace_event_get_vcpu_state_dynamic_by_vcpu_id(
-    CPUState *vcpu, TraceEventVCPUID id)
+static inline bool trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu,
+                                                                 size_t id)
 {
     /* it's on fast path, avoid consistency checks (asserts) */
     if (unlikely(trace_events_enabled_count)) {
@@ -82,7 +82,7 @@ static inline bool trace_event_get_vcpu_state_dynamic_by_vcpu_id(
 static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu,
                                                       TraceEvent *ev)
 {
-    TraceEventVCPUID id;
+    size_t id;
     assert(trace_event_is_vcpu(ev));
     id = trace_event_get_vcpu_id(ev);
     return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, id);
diff --git a/trace/control-target.c b/trace/control-target.c
index da326b4..2f5a2c2 100644
--- a/trace/control-target.c
+++ b/trace/control-target.c
@@ -22,7 +22,7 @@ void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev, bool state)
             trace_event_set_vcpu_state_dynamic(dstate, vcpu, ev, state);
         }
     } else {
-        TraceEventID id = trace_event_get_id(ev);
+        size_t id = trace_event_get_id(ev);
         trace_events_enabled_count += state - dstate[id];
         dstate[id] = state;
     }
@@ -31,8 +31,8 @@ void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev, bool state)
 void trace_event_set_vcpu_state_dynamic(uint16_t *dstate, CPUState *vcpu,
                                         TraceEvent *ev, bool state)
 {
-    TraceEventID id;
-    TraceEventVCPUID vcpu_id;
+    size_t id;
+    size_t vcpu_id;
     bool state_pre;
     assert(trace_event_get_state_static(ev));
     assert(trace_event_is_vcpu(ev));
diff --git a/trace/control.h b/trace/control.h
index a5cb7f3..438c3d2 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -19,19 +19,6 @@ typedef struct TraceEventIter {
     const char *pattern;
 } TraceEventIter;
 
-
-/**
- * TraceEventID:
- *
- * Unique tracing event identifier.
- *
- * These are named as 'TRACE_${EVENT_NAME}'.
- *
- * See also: "trace/generated-events.h"
- */
-enum TraceEventID;
-
-
 void trace_event_iter_init(TraceEventIter *iter, const char *pattern);
 
 TraceEvent *trace_event_iter_next(TraceEventIter *iter);
@@ -63,7 +50,7 @@ static bool trace_event_is_pattern(const char *str);
  *
  * Get the identifier of an event.
  */
-static TraceEventID trace_event_get_id(TraceEvent *ev);
+static size_t trace_event_get_id(TraceEvent *ev);
 
 /**
  * trace_event_get_vcpu_id:
@@ -73,7 +60,7 @@ static TraceEventID trace_event_get_id(TraceEvent *ev);
  * Special value #TRACE_VCPU_EVENT_COUNT means the event is not vCPU-specific
  * (does not have the "vcpu" property).
  */
-static TraceEventVCPUID trace_event_get_vcpu_id(TraceEvent *ev);
+static size_t trace_event_get_vcpu_id(TraceEvent *ev);
 
 /**
  * trace_event_is_vcpu:
@@ -98,7 +85,7 @@ static const char * trace_event_get_name(TraceEvent *ev);
  * If the event has the disabled property, the check will have no performance
  * impact.
  *
- * As a down side, you must always use an immediate #TraceEventID value.
+ * As a down side, you must always use an immediate event ID value.
  */
 #define trace_event_get_state(dstate, id)                                \
     ((id ##_ENABLED) && trace_event_get_state_dynamic_by_id(dstate, id))
@@ -106,8 +93,8 @@ static const char * trace_event_get_name(TraceEvent *ev);
 /**
  * trace_event_get_vcpu_state:
  * @vcpu: Target vCPU.
- * @id: Event identifier (TraceEventID).
- * @vcpu_id: Per-vCPU event identifier (TraceEventVCPUID).
+ * @id: Event identifier.
+ * @vcpu_id: Per-vCPU event identifier.
  *
  * Get the tracing state of an event (both static and dynamic) for the given
  * vCPU.
@@ -115,7 +102,7 @@ static const char * trace_event_get_name(TraceEvent *ev);
  * If the event has the disabled property, the check will have no performance
  * impact.
  *
- * As a down side, you must always use an immediate #TraceEventID value.
+ * As a down side, you must always use an immediate event ID value.
  */
 #define trace_event_get_vcpu_state(vcpu, id, vcpu_id)                   \
     ((id ##_ENABLED) && trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id))
diff --git a/trace/event-internal.h b/trace/event-internal.h
index 5d8fa97..618d1b5 100644
--- a/trace/event-internal.h
+++ b/trace/event-internal.h
@@ -23,8 +23,8 @@
  * Opaque generic description of a tracing event.
  */
 typedef struct TraceEvent {
-    TraceEventID id;
-    TraceEventVCPUID vcpu_id;
+    size_t id;
+    size_t vcpu_id;
     const char * name;
     const bool sstate;
 } TraceEvent;
diff --git a/trace/simple.c b/trace/simple.c
index 2f09daf..2338ff8 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -18,7 +18,7 @@
 #include "trace/simple.h"
 
 /** Trace file header event ID */
-#define HEADER_EVENT_ID (~(uint64_t)0) /* avoids conflicting with TraceEventIDs */
+#define HEADER_EVENT_ID (~(uint64_t)0) /* avoids conflicting with event IDs */
 
 /** Trace file magic number */
 #define HEADER_MAGIC 0xf2b177cb0aa429b4ULL
@@ -58,7 +58,7 @@ static char *trace_file_name;
 
 /* * Trace buffer entry */
 typedef struct {
-    uint64_t event; /*   TraceEventID */
+    uint64_t event; /*  event ID */
     uint64_t timestamp_ns;
     uint32_t length;   /*    in bytes */
     uint32_t pid;
@@ -202,7 +202,7 @@ void trace_record_write_str(TraceBufferRecord *rec, const char *s, uint32_t slen
     rec->rec_off = write_to_buffer(rec->rec_off, (void*)s, slen);
 }
 
-int trace_record_start(TraceBufferRecord *rec, TraceEventID event, size_t datasize)
+int trace_record_start(TraceBufferRecord *rec, size_t event, size_t datasize)
 {
     unsigned int idx, rec_off, old_idx, new_idx;
     uint32_t rec_len = sizeof(TraceRecord) + datasize;
diff --git a/trace/simple.h b/trace/simple.h
index 1e7de45..862bbc7 100644
--- a/trace/simple.h
+++ b/trace/simple.h
@@ -33,7 +33,7 @@ typedef struct {
  *
  * @arglen  number of bytes required for arguments
  */
-int trace_record_start(TraceBufferRecord *rec, TraceEventID id, size_t arglen);
+int trace_record_start(TraceBufferRecord *rec, size_t id, size_t arglen);
 
 /**
  * Append a 64-bit argument to a trace record
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 12/60] trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (10 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 13/60] trace: remove generated-events.h from many includes Daniel P. Berrange
                   ` (51 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The TraceEvent struct vcpu_id field uses the constant
TRACE_VCPU_EVENT_COUNT as a magic value to indicate this
is not a per-VCPU event. The max count value will be
different for each event group though, so this is no
longer suitable. Instead use the value (size_t)-1 which
is guaranteed to be available across all event groups.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 scripts/tracetool/format/events_c.py | 2 +-
 trace/control-internal.h             | 2 +-
 trace/control.c                      | 2 +-
 trace/control.h                      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index bab6404..8482736 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -34,7 +34,7 @@ def generate(events, backend):
         if "vcpu" in e.properties:
             vcpu_id = "TRACE_VCPU_" + e.name.upper()
         else:
-            vcpu_id = "TRACE_VCPU_EVENT_COUNT"
+            vcpu_id = "(size_t)-1";
         out('    { .id = %(id)s, .vcpu_id = %(vcpu_id)s,'
             ' .name = \"%(name)s\",'
             ' .sstate = %(sstate)s },',
diff --git a/trace/control-internal.h b/trace/control-internal.h
index b7048d4..c3cad80 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -37,7 +37,7 @@ static inline size_t trace_event_get_vcpu_id(TraceEvent *ev)
 
 static inline bool trace_event_is_vcpu(TraceEvent *ev)
 {
-    return ev->vcpu_id != TRACE_VCPU_EVENT_COUNT;
+    return ev->vcpu_id != (size_t)-1;
 }
 
 static inline const char * trace_event_get_name(TraceEvent *ev)
diff --git a/trace/control.c b/trace/control.c
index 29659a1..40a4f1e 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -74,7 +74,7 @@ void trace_event_register_group(TraceEvent *events,
 {
     size_t nvcpuevents = 0;
     for (size_t i = 0; i < nevents; i++) {
-        if (events[i].vcpu_id != TRACE_VCPU_EVENT_COUNT) {
+        if (events[i].vcpu_id != (size_t)-1) {
             nvcpuevents++;
         }
     }
diff --git a/trace/control.h b/trace/control.h
index 438c3d2..242fcf3 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -57,7 +57,7 @@ static size_t trace_event_get_id(TraceEvent *ev);
  *
  * Get the per-vCPU identifier of an event.
  *
- * Special value #TRACE_VCPU_EVENT_COUNT means the event is not vCPU-specific
+ * Special value (size_t)-1 means the event is not vCPU-specific
  * (does not have the "vcpu" property).
  */
 static size_t trace_event_get_vcpu_id(TraceEvent *ev);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 13/60] trace: remove generated-events.h from many includes
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (11 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 12/60] trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 14/60] trace: get rid of generated-events.h/generated-events.c Daniel P. Berrange
                   ` (50 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

Now that none of the public APIs rely on the TraceEventID
enum, or related constants, it is possible to simplify
the includes, dropping generated-events.h from many of
them.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 scripts/tracetool/format/events_h.py | 3 +--
 scripts/tracetool/format/h.py        | 1 +
 trace/control.h                      | 2 +-
 trace/event-internal.h               | 3 ---
 trace/simple.h                       | 4 ----
 5 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/scripts/tracetool/format/events_h.py b/scripts/tracetool/format/events_h.py
index d6465d4..a0fe0c4 100644
--- a/scripts/tracetool/format/events_h.py
+++ b/scripts/tracetool/format/events_h.py
@@ -58,7 +58,6 @@ def generate(events, backend):
     out('extern uint16_t dstate[TRACE_EVENT_COUNT];')
     out('extern bool dstate_init[TRACE_EVENT_COUNT];')
 
-    out('#include "trace/event-internal.h"',
-        'void trace_register_events(void);',
+    out('void trace_register_events(void);',
         '',
         '#endif  /* TRACE__GENERATED_EVENTS_H */')
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index 3763e9a..2b82b91 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -24,6 +24,7 @@ def generate(events, backend):
         '',
         '#include "qemu-common.h"',
         '#include "trace/control.h"',
+        '#include "trace/generated-events.h"',
         '')
 
     backend.generate_begin(events)
diff --git a/trace/control.h b/trace/control.h
index 242fcf3..8ff0a8f 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -11,7 +11,7 @@
 #define TRACE__CONTROL_H
 
 #include "qemu-common.h"
-#include "trace/generated-events.h"
+#include "event-internal.h"
 
 typedef struct TraceEventIter {
     size_t event;
diff --git a/trace/event-internal.h b/trace/event-internal.h
index 618d1b5..3e563fc 100644
--- a/trace/event-internal.h
+++ b/trace/event-internal.h
@@ -10,9 +10,6 @@
 #ifndef TRACE__EVENT_INTERNAL_H
 #define TRACE__EVENT_INTERNAL_H
 
-#include "trace/generated-events.h"
-
-
 /**
  * TraceEvent:
  * @id: Unique event identifier.
diff --git a/trace/simple.h b/trace/simple.h
index 862bbc7..551aaae 100644
--- a/trace/simple.h
+++ b/trace/simple.h
@@ -11,10 +11,6 @@
 #ifndef TRACE_SIMPLE_H
 #define TRACE_SIMPLE_H
 
-
-#include "trace/generated-events.h"
-
-
 void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
 void st_set_trace_file_enabled(bool enable);
 void st_set_trace_file(const char *file);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 14/60] trace: get rid of generated-events.h/generated-events.c
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (12 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 13/60] trace: remove generated-events.h from many includes Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 15/60] trace: introduce a formal group name for trace events Daniel P. Berrange
                   ` (49 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

Currently the generated-events.[ch] files contain the
event enums, constants and TraceEvent arrays, while the
generated-tracers.[ch] files contain the actual trace
probe logic. With the decoupling of the event enums from
the API there is no longer any compelling reason for the
separation between these files. The enums/constants will
only ever be needed from the generated-tracers.[ch] files.

The enums/constants/structs from generated-events.[ch] are
thus moved into the generated-tracers.[ch], so that there
is one less file to be generated.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile                             |  3 --
 include/trace-tcg.h                  |  1 -
 include/trace.h                      |  1 -
 scripts/tracetool/format/c.py        | 41 ++++++++++++++++++++---
 scripts/tracetool/format/events_c.py | 53 ------------------------------
 scripts/tracetool/format/events_h.py | 63 ------------------------------------
 scripts/tracetool/format/h.py        | 38 +++++++++++++++++++++-
 trace/Makefile.objs                  | 28 +++-------------
 8 files changed, 77 insertions(+), 151 deletions(-)
 delete mode 100644 scripts/tracetool/format/events_c.py
 delete mode 100644 scripts/tracetool/format/events_h.py

diff --git a/Makefile b/Makefile
index 0d7647f..48673cb 100644
--- a/Makefile
+++ b/Makefile
@@ -56,9 +56,6 @@ GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
 GENERATED_HEADERS += qmp-introspect.h
 GENERATED_SOURCES += qmp-introspect.c
 
-GENERATED_HEADERS += trace/generated-events.h
-GENERATED_SOURCES += trace/generated-events.c
-
 GENERATED_HEADERS += trace/generated-tracers.h
 ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
 GENERATED_HEADERS += trace/generated-tracers-dtrace.h
diff --git a/include/trace-tcg.h b/include/trace-tcg.h
index edab4b1..da68608 100644
--- a/include/trace-tcg.h
+++ b/include/trace-tcg.h
@@ -2,6 +2,5 @@
 #define TRACE_TCG_H
 
 #include "trace/generated-tcg-tracers.h"
-#include "trace/generated-events.h"
 
 #endif /* TRACE_TCG_H */
diff --git a/include/trace.h b/include/trace.h
index 9a01e44..ac9ff3d 100644
--- a/include/trace.h
+++ b/include/trace.h
@@ -2,6 +2,5 @@
 #define TRACE_H
 
 #include "trace/generated-tracers.h"
-#include "trace/generated-events.h"
 
 #endif /* TRACE_H */
diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py
index 699598f..d496109 100644
--- a/scripts/tracetool/format/c.py
+++ b/scripts/tracetool/format/c.py
@@ -17,12 +17,43 @@ from tracetool import out
 
 
 def generate(events, backend):
-    events = [e for e in events
-              if "disable" not in e.properties]
+    active_events = [e for e in events
+                     if "disable" not in e.properties]
 
     out('/* This file is autogenerated by tracetool, do not edit. */',
+        '',
+        '#include "qemu/osdep.h"',
+        '#include "trace.h"',
         '')
-    backend.generate_begin(events)
-    for event in events:
+
+    out('uint16_t dstate[TRACE_EVENT_COUNT];')
+    out('bool dstate_init[TRACE_EVENT_COUNT];')
+
+    out('static TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
+
+    for e in events:
+        if "vcpu" in e.properties:
+            vcpu_id = "TRACE_VCPU_" + e.name.upper()
+        else:
+            vcpu_id = "(size_t)-1";
+        out('    { .id = %(id)s, .vcpu_id = %(vcpu_id)s,'
+            ' .name = \"%(name)s\",'
+            ' .sstate = %(sstate)s },',
+            id = "TRACE_" + e.name.upper(),
+            vcpu_id = vcpu_id,
+            name = e.name,
+            sstate = "TRACE_%s_ENABLED" % e.name.upper())
+
+    out('};',
+        '')
+
+    out('void trace_register_events(void)',
+        '{',
+        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT, dstate, dstate_init);',
+        '}',
+        'trace_init(trace_register_events)')
+
+    backend.generate_begin(active_events)
+    for event in active_events:
         backend.generate(event)
-    backend.generate_end(events)
+    backend.generate_end(active_events)
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
deleted file mode 100644
index 8482736..0000000
--- a/scripts/tracetool/format/events_c.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-events.c
-"""
-
-__author__     = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__  = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>"
-__license__    = "GPL version 2 or (at your option) any later version"
-
-__maintainer__ = "Stefan Hajnoczi"
-__email__      = "stefanha@linux.vnet.ibm.com"
-
-
-from tracetool import out
-
-
-def generate(events, backend):
-    out('/* This file is autogenerated by tracetool, do not edit. */',
-        '',
-        '#include "qemu/osdep.h"',
-        '#include "trace.h"',
-        '#include "trace/generated-events.h"',
-        '#include "trace/control.h"',
-        '')
-
-    out('uint16_t dstate[TRACE_EVENT_COUNT];')
-    out('bool dstate_init[TRACE_EVENT_COUNT];')
-
-    out('static TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
-
-    for e in events:
-        if "vcpu" in e.properties:
-            vcpu_id = "TRACE_VCPU_" + e.name.upper()
-        else:
-            vcpu_id = "(size_t)-1";
-        out('    { .id = %(id)s, .vcpu_id = %(vcpu_id)s,'
-            ' .name = \"%(name)s\",'
-            ' .sstate = %(sstate)s },',
-            id = "TRACE_" + e.name.upper(),
-            vcpu_id = vcpu_id,
-            name = e.name,
-            sstate = "TRACE_%s_ENABLED" % e.name.upper())
-
-    out('};',
-        '')
-
-    out('void trace_register_events(void)',
-        '{',
-        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT, dstate, dstate_init);',
-        '}',
-        'trace_init(trace_register_events)')
diff --git a/scripts/tracetool/format/events_h.py b/scripts/tracetool/format/events_h.py
deleted file mode 100644
index a0fe0c4..0000000
--- a/scripts/tracetool/format/events_h.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-events.h
-"""
-
-__author__     = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__  = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>"
-__license__    = "GPL version 2 or (at your option) any later version"
-
-__maintainer__ = "Stefan Hajnoczi"
-__email__      = "stefanha@linux.vnet.ibm.com"
-
-
-from tracetool import out
-
-
-def generate(events, backend):
-    out('/* This file is autogenerated by tracetool, do not edit. */',
-        '',
-        '#ifndef TRACE__GENERATED_EVENTS_H',
-        '#define TRACE__GENERATED_EVENTS_H',
-        '')
-
-    # event identifiers
-    out('typedef enum {')
-
-    for e in events:
-        out('    TRACE_%s,' % e.name.upper())
-
-    out('    TRACE_EVENT_COUNT',
-        '} TraceEventID;')
-
-    # per-vCPU event identifiers
-    out('typedef enum {')
-
-    for e in events:
-        if "vcpu" in e.properties:
-            out('    TRACE_VCPU_%s,' % e.name.upper())
-
-    out('    TRACE_VCPU_EVENT_COUNT',
-        '} TraceEventVCPUID;')
-
-    # static state
-    for e in events:
-        if 'disable' in e.properties:
-            enabled = 0
-        else:
-            enabled = 1
-        if "tcg-exec" in e.properties:
-            # a single define for the two "sub-events"
-            out('#define TRACE_%(name)s_ENABLED %(enabled)d',
-                name=e.original.name.upper(),
-                enabled=enabled)
-        out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
-
-    out('extern uint16_t dstate[TRACE_EVENT_COUNT];')
-    out('extern bool dstate_init[TRACE_EVENT_COUNT];')
-
-    out('void trace_register_events(void);',
-        '',
-        '#endif  /* TRACE__GENERATED_EVENTS_H */')
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index 2b82b91..4b53ee2 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -24,9 +24,45 @@ def generate(events, backend):
         '',
         '#include "qemu-common.h"',
         '#include "trace/control.h"',
-        '#include "trace/generated-events.h"',
         '')
 
+    # event identifiers
+    out('typedef enum {')
+
+    for e in events:
+        out('    TRACE_%s,' % e.name.upper())
+
+    out('    TRACE_EVENT_COUNT',
+        '} TraceEventID;')
+
+    # per-vCPU event identifiers
+    out('typedef enum {')
+
+    for e in events:
+        if "vcpu" in e.properties:
+            out('    TRACE_VCPU_%s,' % e.name.upper())
+
+    out('    TRACE_VCPU_EVENT_COUNT',
+        '} TraceEventVCPUID;')
+
+    # static state
+    for e in events:
+        if 'disable' in e.properties:
+            enabled = 0
+        else:
+            enabled = 1
+        if "tcg-exec" in e.properties:
+            # a single define for the two "sub-events"
+            out('#define TRACE_%(name)s_ENABLED %(enabled)d',
+                name=e.original.name.upper(),
+                enabled=enabled)
+        out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
+
+    out('extern uint16_t dstate[TRACE_EVENT_COUNT];')
+    out('extern bool dstate_init[TRACE_EVENT_COUNT];')
+
+    out('void trace_register_events(void);')
+
     backend.generate_begin(events)
 
     for e in events:
diff --git a/trace/Makefile.objs b/trace/Makefile.objs
index 4d91b3b..83f754e 100644
--- a/trace/Makefile.objs
+++ b/trace/Makefile.objs
@@ -32,32 +32,11 @@ $(obj)/generated-ust.c-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
 		--backends=$(TRACE_BACKENDS) \
 		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
 
-$(obj)/generated-events.h: $(obj)/generated-ust-provider.h
-$(obj)/generated-events.c: $(obj)/generated-ust.c
+$(obj)/generated-tracers.h: $(obj)/generated-ust-provider.h
+$(obj)/generated-tracers.c: $(obj)/generated-ust.c
 
 endif
 
-######################################################################
-# Auto-generated event descriptions
-
-$(obj)/generated-events.h: $(obj)/generated-events.h-timestamp
-	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-events.h-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
-	$(call quiet-command,$(TRACETOOL) \
-		--format=events-h \
-		--backends=$(TRACE_BACKENDS) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
-
-$(obj)/generated-events.c: $(obj)/generated-events.c-timestamp $(BUILD_DIR)/config-host.mak
-	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-events.c-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
-	$(call quiet-command,$(TRACETOOL) \
-		--format=events-c \
-		--backends=$(TRACE_BACKENDS) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
-
-util-obj-y += generated-events.o
-
 
 ######################################################################
 # Auto-generated tracing routines
@@ -154,7 +133,8 @@ $(obj)/generated-tcg-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_
 ######################################################################
 # Backend code
 
-util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o generated-tracers.o
+util-obj-y += generated-tracers.o
+util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
 util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o
 util-obj-$(CONFIG_TRACE_UST) += generated-ust.o
 util-obj-y += control.o
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 15/60] trace: introduce a formal group name for trace events
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (13 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 14/60] trace: get rid of generated-events.h/generated-events.c Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 16/60] trace: introduce ID range offsets per trace-events file Daniel P. Berrange
                   ` (48 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

The declarations in the generated-tracers.h file are
assuming there's only ever going to be one instance
of this header, as they are not namespaced. When we
have one header per event group, if a single source
file needs to include multiple sets of trace events,
the symbols will all clash.

This change thus introduces a '--group NAME' arg to the
'tracetool' program. This will cause all the symbols in
the generated header files to be given a unique namespace.

If no group is given, the group name 'common' is used,
which is suitable for the current usage where there is
only one global trace-events file used for code generation.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 hw/usb/hcd-ohci.c                                |  6 +++--
 scripts/tracetool.py                             | 10 ++++++--
 scripts/tracetool/__init__.py                    | 10 ++++++--
 scripts/tracetool/backend/__init__.py            | 12 ++++-----
 scripts/tracetool/backend/dtrace.py              |  4 +--
 scripts/tracetool/backend/ftrace.py              |  7 +++---
 scripts/tracetool/backend/log.py                 |  6 ++---
 scripts/tracetool/backend/simple.py              | 10 ++++----
 scripts/tracetool/backend/ust.py                 |  4 +--
 scripts/tracetool/format/__init__.py             |  4 +--
 scripts/tracetool/format/c.py                    | 23 +++++++++--------
 scripts/tracetool/format/d.py                    |  2 +-
 scripts/tracetool/format/h.py                    | 32 ++++++++++++------------
 scripts/tracetool/format/simpletrace_stap.py     |  2 +-
 scripts/tracetool/format/stap.py                 |  2 +-
 scripts/tracetool/format/tcg_h.py                |  2 +-
 scripts/tracetool/format/tcg_helper_c.py         |  2 +-
 scripts/tracetool/format/tcg_helper_h.py         |  2 +-
 scripts/tracetool/format/tcg_helper_wrapper_h.py |  2 +-
 scripts/tracetool/format/ust_events_c.py         |  2 +-
 scripts/tracetool/format/ust_events_h.py         |  8 +++---
 21 files changed, 85 insertions(+), 67 deletions(-)

diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 87508a7..43b5181 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -937,8 +937,10 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
 #ifdef trace_event_get_state
 static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
 {
-    bool print16 = !!trace_event_get_state(dstate, TRACE_USB_OHCI_TD_PKT_SHORT);
-    bool printall = !!trace_event_get_state(dstate, TRACE_USB_OHCI_TD_PKT_FULL);
+    bool print16 = !!trace_event_get_state(common_dstate,
+                                           TRACE_USB_OHCI_TD_PKT_SHORT);
+    bool printall = !!trace_event_get_state(common_dstate,
+                                            TRACE_USB_OHCI_TD_PKT_FULL);
     const int width = 16;
     int i;
     char tmp[3 * width + 1];
diff --git a/scripts/tracetool.py b/scripts/tracetool.py
index 7b82959..1ce8799 100755
--- a/scripts/tracetool.py
+++ b/scripts/tracetool.py
@@ -44,6 +44,7 @@ Options:
     --help                   This help message.
     --list-backends          Print list of available backends.
     --check-backends         Check if the given backend is valid.
+    --group <name>           Name of the event group
     --binary <path>          Full path to QEMU binary.
     --target-type <type>     QEMU emulator target type ('system' or 'user').
     --target-name <name>     QEMU emulator target name.
@@ -67,7 +68,8 @@ def main(args):
 
     long_opts = ["backends=", "format=", "help", "list-backends",
                  "check-backends"]
-    long_opts += ["binary=", "target-type=", "target-name=", "probe-prefix="]
+    long_opts += ["binary=", "target-type=", "target-name=", "probe-prefix=",
+                  "group="]
 
     try:
         opts, args = getopt.getopt(args[1:], "", long_opts)
@@ -81,6 +83,7 @@ def main(args):
     target_type = None
     target_name = None
     probe_prefix = None
+    group = None
     for opt, arg in opts:
         if opt == "--help":
             error_opt()
@@ -105,6 +108,8 @@ def main(args):
             target_name = arg
         elif opt == '--probe-prefix':
             probe_prefix = arg
+        elif opt == '--group':
+            group = arg
 
         else:
             error_opt("unhandled option: %s" % opt)
@@ -131,7 +136,8 @@ def main(args):
 
     try:
         tracetool.generate(sys.stdin, arg_format, arg_backends,
-                           binary=binary, probe_prefix=probe_prefix)
+                           binary=binary, probe_prefix=probe_prefix,
+                           group=group)
     except tracetool.TracetoolError as e:
         error_opt(str(e))
 
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index be24039..aebabaf 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -353,7 +353,8 @@ def try_import(mod_name, attr_name=None, attr_default=None):
 
 
 def generate(fevents, format, backends,
-             binary=None, probe_prefix=None):
+             binary=None, probe_prefix=None,
+             group=None):
     """Generate the output for the given (format, backends) pair.
 
     Parameters
@@ -368,6 +369,8 @@ def generate(fevents, format, backends,
         See tracetool.backend.dtrace.BINARY.
     probe_prefix : str or None
         See tracetool.backend.dtrace.PROBEPREFIX.
+    group: str
+        Name of the tracing group
     """
     # fix strange python error (UnboundLocalError tracetool)
     import tracetool
@@ -378,6 +381,9 @@ def generate(fevents, format, backends,
     if not tracetool.format.exists(format):
         raise TracetoolError("unknown format: %s" % format)
 
+    if group is None:
+        group = "common"
+
     if len(backends) is 0:
         raise TracetoolError("no backends specified")
     for backend in backends:
@@ -391,4 +397,4 @@ def generate(fevents, format, backends,
 
     events = _read_events(fevents)
 
-    tracetool.format.generate(events, format, backend)
+    tracetool.format.generate(events, format, backend, group)
diff --git a/scripts/tracetool/backend/__init__.py b/scripts/tracetool/backend/__init__.py
index d4b6dab..f735a25 100644
--- a/scripts/tracetool/backend/__init__.py
+++ b/scripts/tracetool/backend/__init__.py
@@ -113,11 +113,11 @@ class Wrapper:
             if func is not None:
                 func(*args, **kwargs)
 
-    def generate_begin(self, events):
-        self._run_function("generate_%s_begin", events)
+    def generate_begin(self, events, group):
+        self._run_function("generate_%s_begin", events, group)
 
-    def generate(self, event):
-        self._run_function("generate_%s", event)
+    def generate(self, event, group):
+        self._run_function("generate_%s", event, group)
 
-    def generate_end(self, events):
-        self._run_function("generate_%s_end", events)
+    def generate_end(self, events, group):
+        self._run_function("generate_%s_end", events, group)
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index ab9ecfa..79505c6 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -35,12 +35,12 @@ def binary():
     return BINARY
 
 
-def generate_h_begin(events):
+def generate_h_begin(events, group):
     out('#include "trace/generated-tracers-dtrace.h"',
         '')
 
 
-def generate_h(event):
+def generate_h(event, group):
     out('        QEMU_%(uppername)s(%(argnames)s);',
         uppername=event.name.upper(),
         argnames=", ".join(event.args.names()))
diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backend/ftrace.py
index 80dcf30..9bda5f9 100644
--- a/scripts/tracetool/backend/ftrace.py
+++ b/scripts/tracetool/backend/ftrace.py
@@ -19,13 +19,13 @@ from tracetool import out
 PUBLIC = True
 
 
-def generate_h_begin(events):
+def generate_h_begin(events, group):
     out('#include "trace/ftrace.h"',
         '#include "trace/control.h"',
         '')
 
 
-def generate_h(event):
+def generate_h(event, group):
     argnames = ", ".join(event.args.names())
     if len(event.args) > 0:
         argnames = ", " + argnames
@@ -34,13 +34,14 @@ def generate_h(event):
         '            char ftrace_buf[MAX_TRACE_STRLEN];',
         '            int unused __attribute__ ((unused));',
         '            int trlen;',
-        '            if (trace_event_get_state(%(event_id)s)) {',
+        '            if (trace_event_get_state(%(group)s_dstate, %(event_id)s)) {',
         '                trlen = snprintf(ftrace_buf, MAX_TRACE_STRLEN,',
         '                                 "%(name)s " %(fmt)s "\\n" %(argnames)s);',
         '                trlen = MIN(trlen, MAX_TRACE_STRLEN - 1);',
         '                unused = write(trace_marker_fd, ftrace_buf, trlen);',
         '            }',
         '        }',
+        group=group.lower(),
         name=event.name,
         args=event.args,
         event_id="TRACE_" + event.name.upper(),
diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/log.py
index b3ff064..8438b83 100644
--- a/scripts/tracetool/backend/log.py
+++ b/scripts/tracetool/backend/log.py
@@ -19,13 +19,13 @@ from tracetool import out
 PUBLIC = True
 
 
-def generate_h_begin(events):
+def generate_h_begin(events, group):
     out('#include "trace/control.h"',
         '#include "qemu/log.h"',
         '')
 
 
-def generate_h(event):
+def generate_h(event, group):
     argnames = ", ".join(event.args.names())
     if len(event.args) > 0:
         argnames = ", " + argnames
@@ -34,7 +34,7 @@ def generate_h(event):
         # already checked on the generic format code
         cond = "true"
     else:
-        cond = "trace_event_get_state(%s)" % ("TRACE_" + event.name.upper())
+        cond = "trace_event_get_state(%s_dstate, %s)" % (group.lower(), "TRACE_" + event.name.upper())
 
     out('        if (%(cond)s) {',
         '            struct timeval _now;',
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index c2a8468..8c27b68 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -27,7 +27,7 @@ def is_string(arg):
         return False
 
 
-def generate_h_begin(events):
+def generate_h_begin(events, group):
     for event in events:
         out('void _simple_%(api)s(%(args)s);',
             api=event.api(),
@@ -35,13 +35,13 @@ def generate_h_begin(events):
     out('')
 
 
-def generate_h(event):
+def generate_h(event, group):
     out('        _simple_%(api)s(%(args)s);',
         api=event.api(),
         args=", ".join(event.args.names()))
 
 
-def generate_c_begin(events):
+def generate_c_begin(events, group):
     out('#include "qemu/osdep.h"',
         '#include "trace.h"',
         '#include "trace/control.h"',
@@ -49,7 +49,7 @@ def generate_c_begin(events):
         '')
 
 
-def generate_c(event):
+def generate_c(event, group):
     out('void _simple_%(api)s(%(args)s)',
         '{',
         '    TraceBufferRecord rec;',
@@ -73,7 +73,7 @@ def generate_c(event):
         # already checked on the generic format code
         cond = "true"
     else:
-        cond = "trace_event_get_state(dstate, %s)" % event_id
+        cond = "trace_event_get_state(%s_dstate, %s)" % (group.lower(), event_id)
 
     out('',
         '    if (!%(cond)s) {',
diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend/ust.py
index ed4c227..4594db6 100644
--- a/scripts/tracetool/backend/ust.py
+++ b/scripts/tracetool/backend/ust.py
@@ -19,13 +19,13 @@ from tracetool import out
 PUBLIC = True
 
 
-def generate_h_begin(events):
+def generate_h_begin(events, group):
     out('#include <lttng/tracepoint.h>',
         '#include "trace/generated-ust-provider.h"',
         '')
 
 
-def generate_h(event):
+def generate_h(event, group):
     argnames = ", ".join(event.args.names())
     if len(event.args) > 0:
         argnames = ", " + argnames
diff --git a/scripts/tracetool/format/__init__.py b/scripts/tracetool/format/__init__.py
index 812570f..cf6e0e2 100644
--- a/scripts/tracetool/format/__init__.py
+++ b/scripts/tracetool/format/__init__.py
@@ -74,7 +74,7 @@ def exists(name):
     return tracetool.try_import("tracetool.format." + name)[1]
 
 
-def generate(events, format, backend):
+def generate(events, format, backend, group):
     if not exists(format):
         raise ValueError("unknown format: %s" % format)
     format = format.replace("-", "_")
@@ -82,4 +82,4 @@ def generate(events, format, backend):
                                 "generate")[1]
     if func is None:
         raise AttributeError("format has no 'generate': %s" % format)
-    func(events, backend)
+    func(events, backend, group)
diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py
index d496109..d98785d 100644
--- a/scripts/tracetool/format/c.py
+++ b/scripts/tracetool/format/c.py
@@ -16,7 +16,7 @@ __email__      = "stefanha@linux.vnet.ibm.com"
 from tracetool import out
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     active_events = [e for e in events
                      if "disable" not in e.properties]
 
@@ -26,10 +26,10 @@ def generate(events, backend):
         '#include "trace.h"',
         '')
 
-    out('uint16_t dstate[TRACE_EVENT_COUNT];')
-    out('bool dstate_init[TRACE_EVENT_COUNT];')
+    out('uint16_t %s_dstate[TRACE_%s_EVENT_COUNT];' % (group.lower(), group.upper()))
+    out('bool %s_dstate_init[TRACE_%s_EVENT_COUNT];' % (group.lower(), group.upper()))
 
-    out('static TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
+    out('static TraceEvent %s_trace_events[TRACE_%s_EVENT_COUNT] = {' % (group.lower(), group.upper()))
 
     for e in events:
         if "vcpu" in e.properties:
@@ -47,13 +47,16 @@ def generate(events, backend):
     out('};',
         '')
 
-    out('void trace_register_events(void)',
+    out('void trace_%s_register_events(void)' % group.lower(),
         '{',
-        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT, dstate, dstate_init);',
+        '    trace_event_register_group(%s_trace_events,' % group.lower(),
+        '                               TRACE_%s_EVENT_COUNT,' % group.upper(),
+        '                               %s_dstate,' % group.lower(),
+        '                               %s_dstate_init);' % group.lower(),
         '}',
-        'trace_init(trace_register_events)')
+        'trace_init(trace_%s_register_events)' % group.lower())
 
-    backend.generate_begin(active_events)
+    backend.generate_begin(active_events, group)
     for event in active_events:
-        backend.generate(event)
-    backend.generate_end(active_events)
+        backend.generate(event, group)
+    backend.generate_end(active_events, group)
diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py
index c77d5b7..78397c2 100644
--- a/scripts/tracetool/format/d.py
+++ b/scripts/tracetool/format/d.py
@@ -29,7 +29,7 @@ RESERVED_WORDS = (
 )
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     events = [e for e in events
               if "disable" not in e.properties]
 
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index 4b53ee2..25ffe2b 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -16,34 +16,34 @@ __email__      = "stefanha@linux.vnet.ibm.com"
 from tracetool import out
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '',
-        '#ifndef TRACE__GENERATED_TRACERS_H',
-        '#define TRACE__GENERATED_TRACERS_H',
+        '#ifndef TRACE_%s_GENERATED_TRACERS_H' % group.upper(),
+        '#define TRACE_%s_GENERATED_TRACERS_H' % group.upper(),
         '',
         '#include "qemu-common.h"',
         '#include "trace/control.h"',
         '')
 
     # event identifiers
-    out('typedef enum {')
+    out('enum {')
 
     for e in events:
         out('    TRACE_%s,' % e.name.upper())
 
-    out('    TRACE_EVENT_COUNT',
-        '} TraceEventID;')
+    out('    TRACE_%s_EVENT_COUNT' % group.upper(),
+        '};')
 
     # per-vCPU event identifiers
-    out('typedef enum {')
+    out('enum {')
 
     for e in events:
         if "vcpu" in e.properties:
             out('    TRACE_VCPU_%s,' % e.name.upper())
 
-    out('    TRACE_VCPU_EVENT_COUNT',
-        '} TraceEventVCPUID;')
+    out('    TRACE_%s_VCPU_EVENT_COUNT' % group.upper(),
+        '};')
 
     # static state
     for e in events:
@@ -58,12 +58,12 @@ def generate(events, backend):
                 enabled=enabled)
         out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
 
-    out('extern uint16_t dstate[TRACE_EVENT_COUNT];')
-    out('extern bool dstate_init[TRACE_EVENT_COUNT];')
+    out('extern uint16_t %s_dstate[TRACE_%s_EVENT_COUNT];' % (group.lower(), group.upper()))
+    out('extern bool %s_dstate_init[TRACE_%s_EVENT_COUNT];' % (group.lower(), group.upper()))
 
-    out('void trace_register_events(void);')
+    out('void trace_%s_register_events(void);' % group.lower())
 
-    backend.generate_begin(events)
+    backend.generate_begin(events, group)
 
     for e in events:
         if "vcpu" in e.properties:
@@ -86,11 +86,11 @@ def generate(events, backend):
             cond=cond)
 
         if "disable" not in e.properties:
-            backend.generate(e)
+            backend.generate(e, group)
 
         out('    }',
             '}')
 
-    backend.generate_end(events)
+    backend.generate_end(events, group)
 
-    out('#endif /* TRACE__GENERATED_TRACERS_H */')
+    out('#endif /* TRACE_%s_GENERATED_TRACERS_H */' % group.upper())
diff --git a/scripts/tracetool/format/simpletrace_stap.py b/scripts/tracetool/format/simpletrace_stap.py
index 7e44bc1..c8b3850 100644
--- a/scripts/tracetool/format/simpletrace_stap.py
+++ b/scripts/tracetool/format/simpletrace_stap.py
@@ -19,7 +19,7 @@ from tracetool.backend.simple import is_string
 from tracetool.format.stap import stap_escape
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '')
 
diff --git a/scripts/tracetool/format/stap.py b/scripts/tracetool/format/stap.py
index 9e780f1..e8ef3e7 100644
--- a/scripts/tracetool/format/stap.py
+++ b/scripts/tracetool/format/stap.py
@@ -34,7 +34,7 @@ def stap_escape(identifier):
     return identifier
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     events = [e for e in events
               if "disable" not in e.properties]
 
diff --git a/scripts/tracetool/format/tcg_h.py b/scripts/tracetool/format/tcg_h.py
index e2331f2..628388a 100644
--- a/scripts/tracetool/format/tcg_h.py
+++ b/scripts/tracetool/format/tcg_h.py
@@ -27,7 +27,7 @@ def vcpu_transform_args(args):
     ])
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '/* You must include this file after the inclusion of helper.h */',
         '',
diff --git a/scripts/tracetool/format/tcg_helper_c.py b/scripts/tracetool/format/tcg_helper_c.py
index e3485b7..cc26e03 100644
--- a/scripts/tracetool/format/tcg_helper_c.py
+++ b/scripts/tracetool/format/tcg_helper_c.py
@@ -40,7 +40,7 @@ def vcpu_transform_args(args, mode):
             assert False
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     events = [e for e in events
               if "disable" not in e.properties]
 
diff --git a/scripts/tracetool/format/tcg_helper_h.py b/scripts/tracetool/format/tcg_helper_h.py
index dc76c15..6b184b6 100644
--- a/scripts/tracetool/format/tcg_helper_h.py
+++ b/scripts/tracetool/format/tcg_helper_h.py
@@ -18,7 +18,7 @@ from tracetool.transform import *
 import tracetool.vcpu
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     events = [e for e in events
               if "disable" not in e.properties]
 
diff --git a/scripts/tracetool/format/tcg_helper_wrapper_h.py b/scripts/tracetool/format/tcg_helper_wrapper_h.py
index 020f442..ff53447 100644
--- a/scripts/tracetool/format/tcg_helper_wrapper_h.py
+++ b/scripts/tracetool/format/tcg_helper_wrapper_h.py
@@ -18,7 +18,7 @@ from tracetool.transform import *
 import tracetool.vcpu
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     events = [e for e in events
               if "disable" not in e.properties]
 
diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/format/ust_events_c.py
index 9967c7a..cd87d8a 100644
--- a/scripts/tracetool/format/ust_events_c.py
+++ b/scripts/tracetool/format/ust_events_c.py
@@ -16,7 +16,7 @@ __email__      = "stefanha@redhat.com"
 from tracetool import out
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     events = [e for e in events
               if "disabled" not in e.properties]
 
diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/format/ust_events_h.py
index 3e8a7cd..00b69d9 100644
--- a/scripts/tracetool/format/ust_events_h.py
+++ b/scripts/tracetool/format/ust_events_h.py
@@ -16,7 +16,7 @@ __email__      = "stefanha@redhat.com"
 from tracetool import out
 
 
-def generate(events, backend):
+def generate(events, backend, group):
     events = [e for e in events
               if "disabled" not in e.properties]
 
@@ -28,8 +28,8 @@ def generate(events, backend):
         '#undef TRACEPOINT_INCLUDE_FILE',
         '#define TRACEPOINT_INCLUDE_FILE ./generated-ust-provider.h',
         '',
-        '#if !defined (TRACE__GENERATED_UST_H) || defined(TRACEPOINT_HEADER_MULTI_READ)',
-        '#define TRACE__GENERATED_UST_H',
+        '#if !defined (TRACE_%s_GENERATED_UST_H) || defined(TRACEPOINT_HEADER_MULTI_READ)' % group.upper(),
+        '#define TRACE_%s_GENERATED_UST_H' % group.upper(),
         '',
         '#include "qemu-common.h"',
         '#include <lttng/tracepoint.h>',
@@ -94,7 +94,7 @@ def generate(events, backend):
                 '',
                 name=e.name)
 
-    out('#endif /* TRACE__GENERATED_UST_H */',
+    out('#endif /* TRACE_%s_GENERATED_UST_H */' % group.upper(),
         '',
         '/* This part must be outside ifdef protection */',
         '#include <lttng/tracepoint-event.h>')
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 16/60] trace: introduce ID range offsets per trace-events file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (14 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 15/60] trace: introduce a formal group name for trace events Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen Daniel P. Berrange
                   ` (47 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

For simpletrace we need to be able to form a globally
unique ID value for trace records. Since the individual
events no longer have globally unique ID values, we
define an event ID offset per trace-events file.

The simpletrace records will now use

    (id_offset << 16) | event_id

for the ID value in trace records.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 audio/trace-events                           |  2 ++
 block/trace-events                           |  2 ++
 crypto/trace-events                          |  2 ++
 hw/9pfs/trace-events                         |  2 ++
 hw/acpi/trace-events                         |  2 ++
 hw/alpha/trace-events                        |  2 ++
 hw/arm/trace-events                          |  2 ++
 hw/audio/trace-events                        |  2 ++
 hw/block/trace-events                        |  2 ++
 hw/char/trace-events                         |  2 ++
 hw/display/trace-events                      |  2 ++
 hw/dma/trace-events                          |  2 ++
 hw/i386/trace-events                         |  2 ++
 hw/input/trace-events                        |  2 ++
 hw/intc/trace-events                         |  2 ++
 hw/isa/trace-events                          |  2 ++
 hw/mem/trace-events                          |  2 ++
 hw/misc/trace-events                         |  2 ++
 hw/net/trace-events                          |  2 ++
 hw/nvram/trace-events                        |  2 ++
 hw/pci/trace-events                          |  2 ++
 hw/ppc/trace-events                          |  2 ++
 hw/s390x/trace-events                        |  2 ++
 hw/scsi/trace-events                         |  2 ++
 hw/sd/trace-events                           |  2 ++
 hw/sparc/trace-events                        |  2 ++
 hw/timer/trace-events                        |  2 ++
 hw/usb/trace-events                          |  2 ++
 hw/vfio/trace-events                         |  2 ++
 hw/virtio/trace-events                       |  2 ++
 io/trace-events                              |  2 ++
 linux-user/trace-events                      |  2 ++
 migration/trace-events                       |  2 ++
 net/trace-events                             |  2 ++
 qom/trace-events                             |  2 ++
 scripts/simpletrace.py                       |  7 ++--
 scripts/tracetool/__init__.py                | 49 +++++++++++++++++++++++-----
 scripts/tracetool/backend/simple.py          |  3 +-
 scripts/tracetool/format/simpletrace_stap.py |  2 +-
 target-i386/trace-events                     |  2 ++
 target-ppc/trace-events                      |  2 ++
 target-s390x/trace-events                    |  2 ++
 target-sparc/trace-events                    |  2 ++
 trace-events                                 |  2 ++
 ui/trace-events                              |  2 ++
 util/trace-events                            |  2 ++
 46 files changed, 131 insertions(+), 14 deletions(-)

diff --git a/audio/trace-events b/audio/trace-events
index 5638ea1..5630465 100644
--- a/audio/trace-events
+++ b/audio/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(512)
+
 # audio/alsaaudio.c
 alsa_revents(int revents) "revents = %d"
 alsa_pollout(int i, int fd) "i = %d fd = %d"
diff --git a/block/trace-events b/block/trace-events
index 978ef4f..8286458 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(25)
+
 # block.c
 bdrv_open_common(void *bs, const char *filename, int flags, const char *format_name) "bs %p filename \"%s\" flags %#x format_name \"%s\""
 bdrv_lock_medium(void *bs, bool locked) "bs %p locked %d"
diff --git a/crypto/trace-events b/crypto/trace-events
index 71f1d99..9850d0d 100644
--- a/crypto/trace-events
+++ b/crypto/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(32)
+
 # crypto/tlscreds.c
 qcrypto_tls_creds_load_dh(void *creds, const char *filename) "TLS creds load DH creds=%p filename=%s"
 qcrypto_tls_creds_get_path(void *creds, const char *filename, const char *path) "TLS creds path creds=%p filename=%s path=%s"
diff --git a/hw/9pfs/trace-events b/hw/9pfs/trace-events
index 63efa27..84275da 100644
--- a/hw/9pfs/trace-events
+++ b/hw/9pfs/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(196)
+
 # hw/9pfs/virtio-9p.c
 v9fs_rerror(uint16_t tag, uint8_t id, int err) "tag %d id %d err %d"
 v9fs_version(uint16_t tag, uint8_t id, int32_t msize, char* version) "tag %d id %d msize %d version %s"
diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events
index 5aa3ba6..840928e 100644
--- a/hw/acpi/trace-events
+++ b/hw/acpi/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(225)
+
 # hw/acpi/memory_hotplug.c
 mhp_acpi_invalid_slot_selected(uint32_t slot) "0x%"PRIx32
 mhp_acpi_ejecting_invalid_slot(uint32_t slot) "0x%"PRIx32
diff --git a/hw/alpha/trace-events b/hw/alpha/trace-events
index 7d52b5d..7963ee4 100644
--- a/hw/alpha/trace-events
+++ b/hw/alpha/trace-events
@@ -1,4 +1,6 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(169)
+
 # hw/alpha/pci.c
 alpha_pci_iack_write(void) ""
diff --git a/hw/arm/trace-events b/hw/arm/trace-events
index d0dad16..e1f9d5c 100644
--- a/hw/arm/trace-events
+++ b/hw/arm/trace-events
@@ -1,4 +1,6 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(324)
+
 # hw/arm/virt-acpi-build.c
 virt_acpi_setup(void) "No fw cfg or ACPI disabled. Bailing out."
diff --git a/hw/audio/trace-events b/hw/audio/trace-events
index 796f4a1..0610b63 100644
--- a/hw/audio/trace-events
+++ b/hw/audio/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(243)
+
 # hw/audio/cs4231.c
 cs4231_mem_readl_dreg(uint32_t reg, uint32_t ret) "read dreg %d: 0x%02x"
 cs4231_mem_readl_reg(uint32_t reg, uint32_t ret) "read reg %d: 0x%08x"
diff --git a/hw/block/trace-events b/hw/block/trace-events
index 31df44b..4c79bc0 100644
--- a/hw/block/trace-events
+++ b/hw/block/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(49)
+
 # hw/block/virtio-blk.c
 virtio_blk_req_complete(void *req, int status) "req %p status %d"
 virtio_blk_rw_complete(void *req, int ret) "req %p ret %d"
diff --git a/hw/char/trace-events b/hw/char/trace-events
index 005fcd8..fec6fc3 100644
--- a/hw/char/trace-events
+++ b/hw/char/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(288)
+
 # hw/char/virtio-serial-bus.c
 virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u"
 virtio_serial_throttle_port(unsigned int port, bool throttle) "port %u, throttle %d"
diff --git a/hw/display/trace-events b/hw/display/trace-events
index 78f0465..4dd88aa 100644
--- a/hw/display/trace-events
+++ b/hw/display/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(100)
+
 # hw/display/jazz_led.c
 jazz_led_read(uint64_t addr, uint8_t val) "read addr=0x%"PRIx64": 0x%x"
 jazz_led_write(uint64_t addr, uint8_t new) "write addr=0x%"PRIx64": 0x%x"
diff --git a/hw/dma/trace-events b/hw/dma/trace-events
index d8a5674..685460d 100644
--- a/hw/dma/trace-events
+++ b/hw/dma/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(72)
+
 # hw/dma/rc4030.c
 jazzio_read(uint64_t addr, uint32_t ret) "read reg[0x%"PRIx64"] = 0x%x"
 jazzio_write(uint64_t addr, uint32_t val) "write reg[0x%"PRIx64"] = 0x%x"
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
index 507f753..6ee0130 100644
--- a/hw/i386/trace-events
+++ b/hw/i386/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(392)
+
 # hw/i386/xen/xen_platform.c
 xen_platform_log(char *s) "xen platform: %s"
 
diff --git a/hw/input/trace-events b/hw/input/trace-events
index f24dff2..c78af6c 100644
--- a/hw/input/trace-events
+++ b/hw/input/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(432)
+
 # hw/input/ps2.c
 ps2_put_keycode(void *opaque, int keycode) "%p keycode %d"
 ps2_read_data(void *opaque) "%p"
diff --git a/hw/intc/trace-events b/hw/intc/trace-events
index 376dd18..ee46617 100644
--- a/hw/intc/trace-events
+++ b/hw/intc/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(144)
+
 # hw/intc/apic_common.c
 cpu_set_apic_base(uint64_t val) "%016"PRIx64
 cpu_get_apic_base(uint64_t val) "%016"PRIx64
diff --git a/hw/isa/trace-events b/hw/isa/trace-events
index 686282f..b6b8ba6 100644
--- a/hw/isa/trace-events
+++ b/hw/isa/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(400)
+
 # hw/isa/pc87312.c
 pc87312_io_read(uint32_t addr, uint32_t val) "read addr=%x val=%x"
 pc87312_io_write(uint32_t addr, uint32_t val) "write addr=%x val=%x"
diff --git a/hw/mem/trace-events b/hw/mem/trace-events
index 3a49215..4b67bba 100644
--- a/hw/mem/trace-events
+++ b/hw/mem/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(36)
+
 # hw/mem/pc-dimm.c
 mhp_pc_dimm_assigned_slot(int slot) "0x%d"
 mhp_pc_dimm_assigned_address(uint64_t addr) "0x%"PRIx64
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index ea52a14..31db6a7 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(361)
+
 # hw/misc/eccmemctl.c
 ecc_mem_writel_mer(uint32_t val) "Write memory enable %08x"
 ecc_mem_writel_mdr(uint32_t val) "Write memory delay %08x"
diff --git a/hw/net/trace-events b/hw/net/trace-events
index aaa905f..a78e8c6 100644
--- a/hw/net/trace-events
+++ b/hw/net/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(289)
+
 # hw/net/lance.c
 lance_mem_readw(uint64_t addr, uint32_t ret) "addr=%"PRIx64"val=0x%04x"
 lance_mem_writew(uint64_t addr, uint32_t val) "addr=%"PRIx64"val=0x%04x"
diff --git a/hw/nvram/trace-events b/hw/nvram/trace-events
index 325447d..f026896 100644
--- a/hw/nvram/trace-events
+++ b/hw/nvram/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(256)
+
 # hw/nvram/ds1225y.c
 nvram_read(uint32_t addr, uint32_t ret) "read addr %d: 0x%02x"
 nvram_write(uint32_t addr, uint32_t old, uint32_t val) "write addr %d: 0x%02x -> 0x%02x"
diff --git a/hw/pci/trace-events b/hw/pci/trace-events
index 285338a..7803590 100644
--- a/hw/pci/trace-events
+++ b/hw/pci/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(121)
+
 # hw/pci/pci.c
 pci_update_mappings_del(void *d, uint32_t bus, uint32_t slot, uint32_t func, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64
 pci_update_mappings_add(void *d, uint32_t bus, uint32_t slot, uint32_t func, int bar, uint64_t addr, uint64_t size) "d=%p %02x:%02x.%x %d,%#"PRIx64"+%#"PRIx64
diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events
index 900679b..d372099 100644
--- a/hw/ppc/trace-events
+++ b/hw/ppc/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(125)
+
 # hw/ppc/spapr_pci.c
 spapr_pci_msi(const char *msg, uint32_t ca) "%s (cfg=%x)"
 spapr_pci_msi_setup(const char *name, unsigned vector, uint64_t addr) "dev\"%s\" vector %u, addr=%"PRIx64
diff --git a/hw/s390x/trace-events b/hw/s390x/trace-events
index 72c4549..59305ca 100644
--- a/hw/s390x/trace-events
+++ b/hw/s390x/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(64)
+
 # hw/s390x/css.c
 css_enable_facility(const char *facility) "CSS: enable %s"
 css_crw(uint8_t rsc, uint8_t erc, uint16_t rsid, const char *chained) "CSS: queueing crw: rsc=%x, erc=%x, rsid=%x %s"
diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events
index 5f19e32..42e699e 100644
--- a/hw/scsi/trace-events
+++ b/hw/scsi/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(200)
+
 # hw/scsi/scsi-bus.c
 scsi_req_alloc(int target, int lun, int tag) "target %d lun %d tag %d"
 scsi_req_cancel(int target, int lun, int tag) "target %d lun %d tag %d"
diff --git a/hw/sd/trace-events b/hw/sd/trace-events
index b580a0f..7e5a87a 100644
--- a/hw/sd/trace-events
+++ b/hw/sd/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(441)
+
 # hw/sd/milkymist-memcard.c
 milkymist_memcard_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
 milkymist_memcard_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
diff --git a/hw/sparc/trace-events b/hw/sparc/trace-events
index ab677a3..3701222 100644
--- a/hw/sparc/trace-events
+++ b/hw/sparc/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(81)
+
 # hw/sparc/sun4m.c
 sun4m_cpu_interrupt(unsigned int level) "Set CPU IRQ %d"
 sun4m_cpu_reset_interrupt(unsigned int level) "Reset CPU IRQ %d"
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index 19db4bf..884cce6 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(484)
+
 # hw/timer/slavio_timer.c
 slavio_timer_get_out(uint64_t limit, uint32_t counthigh, uint32_t count) "limit %"PRIx64" count %x%08x"
 slavio_timer_irq(uint32_t counthigh, uint32_t count) "callback: count %x%08x"
diff --git a/hw/usb/trace-events b/hw/usb/trace-events
index ac2d951..c913c99 100644
--- a/hw/usb/trace-events
+++ b/hw/usb/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(343)
+
 # hw/usb/core.c
 usb_packet_state_change(int bus, const char *port, int ep, void *p, const char *o, const char *n) "bus %d, port %s, ep %d, packet %p, state %s -> %s"
 usb_packet_state_fault(int bus, const char *port, int ep, void *p, const char *o, const char *n) "bus %d, port %s, ep %d, packet %p, state %s, expected %s"
diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events
index 4bb7690..b3898d7 100644
--- a/hw/vfio/trace-events
+++ b/hw/vfio/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(108)
+
 # hw/vfio/pci.c
 vfio_intx_interrupt(const char *name, char line) " (%s) Pin %c"
 vfio_intx_eoi(const char *name) " (%s) EOI"
diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
index 6849a44..e5350c6 100644
--- a/hw/virtio/trace-events
+++ b/hw/virtio/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(500)
+
 # hw/virtio/virtio.c
 virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u"
 virtqueue_flush(void *vq, unsigned int count) "vq %p count %u"
diff --git a/io/trace-events b/io/trace-events
index 8d84eda..910c9b9 100644
--- a/io/trace-events
+++ b/io/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(529)
+
 # io/task.c
 qio_task_new(void *task, void *source, void *func, void *opaque) "Task new task=%p source=%p func=%p opaque=%p"
 qio_task_complete(void *task) "Task complete task=%p"
diff --git a/linux-user/trace-events b/linux-user/trace-events
index 80a2e07..e8d4229 100644
--- a/linux-user/trace-events
+++ b/linux-user/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(4)
+
 # linux-user/signal.c
 user_setup_frame(void *env, uint64_t frame_addr) "env=%p frame_addr=%"PRIx64
 user_setup_rt_frame(void *env, uint64_t frame_addr) "env=%p frame_addr=%"PRIx64
diff --git a/migration/trace-events b/migration/trace-events
index 8568dab..43ce7f7 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(9)
+
 # migration/savevm.c
 qemu_loadvm_state_section(unsigned int section_type) "%d"
 qemu_loadvm_state_section_command(int ret) "%d"
diff --git a/net/trace-events b/net/trace-events
index 32a0a8a..49b0174 100644
--- a/net/trace-events
+++ b/net/trace-events
@@ -1,4 +1,6 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(625)
+
 # net/vhost-user.c
 vhost_user_event(const char *chr, int event) "chr: %s got event: %d"
diff --git a/qom/trace-events b/qom/trace-events
index 350fc1f..4c76f43 100644
--- a/qom/trace-events
+++ b/qom/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(675)
+
 # 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)"
diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index 3916c6d..0f4d020 100755
--- a/scripts/simpletrace.py
+++ b/scripts/simpletrace.py
@@ -114,11 +114,12 @@ def process(events, log, analyzer, read_header=True):
     if read_header:
         read_trace_header(log)
 
-    dropped_event = Event.build("Dropped_Event(uint64_t num_events_dropped)")
+    dropped_event = Event.build("Dropped_Event(uint64_t num_events_dropped)",
+                                dropped_event_id, 0)
     edict = {dropped_event_id: dropped_event}
 
-    for num, event in enumerate(events):
-        edict[num] = event
+    for event in events:
+        edict[event.global_id] = event
 
     def build_fn(analyzer, event):
         if isinstance(event, str):
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index aebabaf..00d1c89 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -145,6 +145,12 @@ class Event(object):
     ----------
     name : str
         The event name.
+    local_id: int
+        ID of event within the group
+    id_offset: int
+        Offset for event ID
+    global_id: int
+        ID of event globally unique
     fmt : str
         The event format string.
     properties : set(str)
@@ -163,13 +169,17 @@ class Event(object):
 
     _VALID_PROPS = set(["disable", "tcg", "tcg-trans", "tcg-exec", "vcpu"])
 
-    def __init__(self, name, props, fmt, args, orig=None,
+    def __init__(self, name, local_id, id_offset, props, fmt, args, orig=None,
                  event_trans=None, event_exec=None):
         """
         Parameters
         ----------
         name : string
             Event name.
+        local_id: int
+            ID of event within the group
+        id_offset: int
+            Offset for event ID
         props : list of str
             Property names.
         fmt : str, list of str
@@ -185,6 +195,9 @@ class Event(object):
 
         """
         self.name = name
+        self.local_id = local_id
+        self.id_offset = id_offset
+        self.global_id = (self.id_offset << 16) | self.local_id
         self.properties = props
         self.fmt = fmt
         self.args = args
@@ -204,11 +217,11 @@ class Event(object):
 
     def copy(self):
         """Create a new copy."""
-        return Event(self.name, list(self.properties), self.fmt,
+        return Event(self.name, self.local_id, self.id_offset, list(self.properties), self.fmt,
                      self.args.copy(), self, self.event_trans, self.event_exec)
 
     @staticmethod
-    def build(line_str):
+    def build(line_str, local_id, id_offset):
         """Build an Event instance from a string.
 
         Parameters
@@ -237,7 +250,7 @@ class Event(object):
         if "tcg" in props and isinstance(fmt, str):
             raise ValueError("Events with 'tcg' property must have two formats")
 
-        event = Event(name, props, fmt, args)
+        event = Event(name, local_id, id_offset, props, fmt, args)
 
         # add implicit arguments when using the 'vcpu' property
         import tracetool.vcpu
@@ -251,10 +264,13 @@ class Event(object):
             fmt = self.fmt
         else:
             fmt = "%s, %s" % (self.fmt[0], self.fmt[1])
-        return "Event('%s %s(%s) %s')" % (" ".join(self.properties),
-                                          self.name,
-                                          self.args,
-                                          fmt)
+        return "Event('%s %s:%d:%d(%s) %s')" % (
+            " ".join(self.properties),
+            self.name,
+            self.local_id,
+            self.id_offset,
+            self.args,
+            fmt)
 
     _FMT = re.compile("(%[\d\.]*\w+|%.*PRI\S+)")
 
@@ -274,6 +290,8 @@ class Event(object):
     def transform(self, *trans):
         """Return a new Event with transformed Arguments."""
         return Event(self.name,
+                     self.local_id,
+                     self.id_offset,
                      list(self.properties),
                      self.fmt,
                      self.args.transform(*trans),
@@ -282,13 +300,26 @@ class Event(object):
 
 def _read_events(fobj):
     events = []
+    id_offset = 0
+    local_id = 0
+    all_id_offsets = []
     for line in fobj:
         if not line.strip():
             continue
         if line.lstrip().startswith('#'):
             continue
 
-        event = Event.build(line)
+        if line.startswith("@id_offset("):
+            id_offset = int(line[11:-2])
+
+            if id_offset in all_id_offsets:
+                raise TracetoolError("ID offset %d already used" % id_offset)
+            all_id_offsets.append(id_offset)
+            local_id = 0
+            continue
+
+        event = Event.build(line, local_id, id_offset)
+        local_id += 1
 
         # transform TCG-enabled events
         if "tcg" not in event.properties:
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index 8c27b68..b4f6ea4 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -80,11 +80,12 @@ def generate_c(event, group):
         '        return;',
         '    }',
         '',
-        '    if (trace_record_start(&rec, %(event_id)s, %(size_str)s)) {',
+        '    if (trace_record_start(&rec, (%(id_offset)d << 16) | %(event_id)s, %(size_str)s)) {',
         '        return; /* Trace Buffer Full, Event Dropped ! */',
         '    }',
         cond=cond,
         event_id=event_id,
+        id_offset=event.id_offset,
         size_str=sizestr)
 
     if len(event.args) > 0:
diff --git a/scripts/tracetool/format/simpletrace_stap.py b/scripts/tracetool/format/simpletrace_stap.py
index c8b3850..9ec107c 100644
--- a/scripts/tracetool/format/simpletrace_stap.py
+++ b/scripts/tracetool/format/simpletrace_stap.py
@@ -48,7 +48,7 @@ def generate(events, backend, group):
         sizestr = ' + '.join(sizes)
 
         # Generate format string and value pairs for record header and arguments
-        fields = [('8b', str(event_id)),
+        fields = [('8b', str((e.id_offset << 16) | event_id)),
                   ('8b', 'gettimeofday_ns()'),
                   ('4b', sizestr),
                   ('4b', 'pid()')]
diff --git a/target-i386/trace-events b/target-i386/trace-events
index ccc49e3..6882f35 100644
--- a/target-i386/trace-events
+++ b/target-i386/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(8)
+
 # target-i386/kvm.c
 kvm_x86_fixup_msi_error(uint32_t gsi) "VT-d failed to remap interrupt for GSI %" PRIu32
 kvm_x86_add_msi_route(int virq) "Adding route entry for virq %d"
diff --git a/target-ppc/trace-events b/target-ppc/trace-events
index d37da2b..a81d2e7 100644
--- a/target-ppc/trace-events
+++ b/target-ppc/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(676)
+
 # target-ppc/kvm.c
 kvm_failed_spr_set(int str, const char *msg) "Warning: Unable to set SPR %d to KVM: %s"
 kvm_failed_spr_get(int str, const char *msg) "Warning: Unable to retrieve SPR %d from KVM: %s"
diff --git a/target-s390x/trace-events b/target-s390x/trace-events
index 9589b16..ac2b6ec 100644
--- a/target-s390x/trace-events
+++ b/target-s390x/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(16)
+
 # target-s390x/mmu_helper.c
 get_skeys_nonzero(int rc) "SKEY: Call to get_skeys unexpectedly returned %d"
 set_skeys_nonzero(int rc) "SKEY: Call to set_skeys unexpectedly returned %d"
diff --git a/target-sparc/trace-events b/target-sparc/trace-events
index c75faf9..0022c45 100644
--- a/target-sparc/trace-events
+++ b/target-sparc/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(576)
+
 # target-sparc/mmu_helper.c
 mmu_helper_dfault(uint64_t address, uint64_t context, int mmu_idx, uint32_t tl) "DFAULT at %"PRIx64" context %"PRIx64" mmu_idx=%d tl=%d"
 mmu_helper_dprot(uint64_t address, uint64_t context, int mmu_idx, uint32_t tl) "DPROT at %"PRIx64" context %"PRIx64" mmu_idx=%d tl=%d"
diff --git a/trace-events b/trace-events
index 1de7e99..08c0b1e 100644
--- a/trace-events
+++ b/trace-events
@@ -25,6 +25,8 @@
 #
 # The <format-string> should be a sprintf()-compatible format string.
 
+@id_offset(1)
+
 # thread-pool.c
 thread_pool_submit(void *pool, void *req, void *opaque) "pool %p req %p opaque %p"
 thread_pool_complete(void *pool, void *req, void *opaque, int ret) "pool %p req %p opaque %p ret %d"
diff --git a/ui/trace-events b/ui/trace-events
index d36dbbb..1649aa1 100644
--- a/ui/trace-events
+++ b/ui/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(27)
+
 # ui/console.c
 console_gfx_new(void) ""
 console_putchar_csi(int esc_param0, int esc_param1, int ch, int nb_esc_params) "escape sequence CSI%d;%d%c, %d parameters"
diff --git a/util/trace-events b/util/trace-events
index 111e1de..f83fbde 100644
--- a/util/trace-events
+++ b/util/trace-events
@@ -1,5 +1,7 @@
 # See docs/trace-events.txt for syntax documentation.
 
+@id_offset(648)
+
 # util/buffer.c
 buffer_resize(const char *buf, size_t olen, size_t len) "%s: old %zd, new %zd"
 buffer_move_empty(const char *buf, size_t len, const char *from) "%s: %zd bytes from %s"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (15 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 16/60] trace: introduce ID range offsets per trace-events file Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-10 14:18   ` Lluís Vilanova
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 18/60] trace: switch io/ directory to modular trace.h file Daniel P. Berrange
                   ` (46 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 .gitignore                               |  6 +++
 Makefile                                 | 69 +++++++++++++++++++++++++++-----
 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 +++-
 trace/Makefile.objs                      | 23 ++++++++---
 9 files changed, 112 insertions(+), 21 deletions(-)

diff --git a/.gitignore b/.gitignore
index 88ec249..7249070 100644
--- a/.gitignore
+++ b/.gitignore
@@ -115,3 +115,9 @@ tags
 TAGS
 docker-src.*
 *~
+trace.h
+trace.c
+trace-events-common
+trace-ust.h
+trace-dtrace.h
+trace-dtrace.dtrace
diff --git a/Makefile b/Makefile
index 48673cb..2b9ba60 100644
--- a/Makefile
+++ b/Makefile
@@ -70,9 +70,55 @@ 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 += $(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) \
+		--group=$(shell dirname $@ | tr /- _) \
+		< $< > $@,"  GEN   $@")
+
+%/trace.c: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=c \
+		--backends=$(TRACE_BACKENDS) \
+		--group=$(shell dirname $@ | tr /- _) \
+		< $< > $@,"  GEN   $@")
+
+%/trace-ust.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=ust-events-h \
+		--backends=$(TRACE_BACKENDS) \
+		--group=$(shell dirname $@ | tr /- _) \
+		< $< > $@,"  GEN   $@")
+
+%/trace-dtrace.dtrace: $(SRC_PATH)/%/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=d \
+		--backends=$(TRACE_BACKENDS) \
+		--group=$(shell dirname $@ | tr /- _) \
+		< $< > $@,"  GEN   $@")
+
+%/trace-dtrace.h: %/trace-dtrace.dtrace $(tracetool-y)
+	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
+
+%/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
+
+
 # Don't try to regenerate Makefile or configure
 # We don't generate any of them
 Makefile: ;
@@ -156,7 +202,8 @@ dummy := $(call unnest-vars,, \
                 qom-obj-y \
                 io-obj-y \
                 common-obj-y \
-                common-obj-m)
+                common-obj-m \
+                trace-obj-y)
 
 ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/tests/Makefile.include
@@ -247,15 +294,17 @@ util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
 
 ######################################################################
 
+COMMON_LDADDS = $(trace-obj-y) libqemuutil.a libqemustub.a
+
 qemu-img.o: qemu-img-cmds.h
 
-qemu-img$(EXESUF): qemu-img.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a
-qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a
-qemu-io$(EXESUF): qemu-io.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a
+qemu-img$(EXESUF): qemu-img.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
+qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
+qemu-io$(EXESUF): qemu-io.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 
-qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o libqemuutil.a libqemustub.a
+qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
 
-fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o libqemuutil.a libqemustub.a
+fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS)
 fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
 
 qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
@@ -319,7 +368,7 @@ $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
 QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
 $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
 
-qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
+qemu-ga$(EXESUF): $(qga-obj-y) $(COMMON_LDADDS)
 	$(call LINK, $^)
 
 ifdef QEMU_GA_MSI_ENABLED
@@ -344,9 +393,9 @@ ifneq ($(EXESUF),)
 qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI)
 endif
 
-ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) libqemuutil.a libqemustub.a
+ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) $(COMMON_LDADDS)
 	$(call LINK, $^)
-ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) libqemuutil.a libqemustub.a
+ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMMON_LDADDS)
 	$(call LINK, $^)
 
 clean:
@@ -660,6 +709,8 @@ ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fa
 Makefile: $(GENERATED_HEADERS)
 endif
 
+.SECONDARY: $(GENERATED_HEADERS) $(GENERATED_SOURCES) $(GENERATED_DTRACE)
+
 # Include automatically generated dependency files
 # Dependencies in Makefile.objs files come from our recursive subdir rules
 -include $(wildcard *.d tests/*.d)
diff --git a/Makefile.objs b/Makefile.objs
index b371ebb..ede6dd3 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
@@ -160,3 +161,7 @@ trace-events-y += target-s390x/trace-events
 trace-events-y += target-ppc/trace-events
 trace-events-y += qom/trace-events
 trace-events-y += linux-user/trace-events
+
+trace-events-files = trace-events $(trace-events-subdirs:%=%/trace-events)
+
+trace-obj-y = $(trace-events-subdirs:%=%/)
diff --git a/Makefile.target b/Makefile.target
index a440bcb..46b5ccf 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -180,7 +180,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)
@@ -192,8 +193,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)$@")
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index 79505c6..1319990 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -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,
         '')
 
 
diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend/ust.py
index 4594db6..599c12e 100644
--- a/scripts/tracetool/backend/ust.py
+++ b/scripts/tracetool/backend/ust.py
@@ -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,
         '')
 
 
diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/format/ust_events_c.py
index cd87d8a..8be8116 100644
--- a/scripts/tracetool/format/ust_events_c.py
+++ b/scripts/tracetool/format/ust_events_c.py
@@ -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"')
diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/format/ust_events_h.py
index 00b69d9..f4258e5 100644
--- a/scripts/tracetool/format/ust_events_h.py
+++ b/scripts/tracetool/format/ust_events_h.py
@@ -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) || defined(TRACEPOINT_HEADER_MULTI_READ)' % group.upper(),
         '#define TRACE_%s_GENERATED_UST_H' % group.upper(),
diff --git a/trace/Makefile.objs b/trace/Makefile.objs
index 83f754e..00ebe3a 100644
--- a/trace/Makefile.objs
+++ b/trace/Makefile.objs
@@ -8,7 +8,10 @@
 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)/%)
 	$(call quiet-command,cat $^ > $@)
 
 ######################################################################
@@ -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) \
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 18/60] trace: switch io/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (16 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 19/60] trace: switch util/ " Daniel P. Berrange
                   ` (45 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index ede6dd3..9243d5b 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/io/Makefile.objs b/io/Makefile.objs
index 9d8337d..94cb74e 100644
--- a/io/Makefile.objs
+++ b/io/Makefile.objs
@@ -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
diff --git a/io/channel-buffer.c b/io/channel-buffer.c
index 43d7959..b4e50d6 100644
--- a/io/channel-buffer.c
+++ b/io/channel-buffer.c
@@ -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)
diff --git a/io/channel-command.c b/io/channel-command.c
index ad25313..7624653 100644
--- a/io/channel-command.c
+++ b/io/channel-command.c
@@ -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 *
diff --git a/io/channel-file.c b/io/channel-file.c
index e1da243..7b064ef 100644
--- a/io/channel-file.c
+++ b/io/channel-file.c
@@ -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)
diff --git a/io/channel-socket.c b/io/channel-socket.c
index 196a4f1..a31964a 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -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
diff --git a/io/channel-tls.c b/io/channel-tls.c
index 9a8525c..a2473f4 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -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,
diff --git a/io/channel-websock.c b/io/channel-websock.c
index 533bd4b..24d226b 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -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 */
diff --git a/io/task.c b/io/task.c
index c7f97a9..d81adf2 100644
--- a/io/task.c
+++ b/io/task.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 19/60] trace: switch util/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (17 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 18/60] trace: switch io/ directory to modular trace.h file Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 20/60] trace: switch crypto/ " Daniel P. Berrange
                   ` (44 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 9243d5b..53b2785 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/util/Makefile.objs b/util/Makefile.objs
index 96cb1e0..824e769 100644
--- a/util/Makefile.objs
+++ b/util/Makefile.objs
@@ -35,3 +35,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
diff --git a/util/buffer.c b/util/buffer.c
index d8bb874..f59aef9 100644
--- a/util/buffer.c
+++ b/util/buffer.c
@@ -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
diff --git a/util/hbitmap.c b/util/hbitmap.c
index 99fd2ba..4c94a01 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -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
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index f2d4e9e..afde145 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -33,7 +33,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>
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 4c1dcf1..2c539bc 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -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"
 
diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c
index 22aa9ab..ff5bf99 100644
--- a/util/qemu-coroutine-lock.c
+++ b/util/qemu-coroutine-lock.c
@@ -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)
 {
diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
index 89f21a9..c953db6 100644
--- a/util/qemu-coroutine.c
+++ b/util/qemu-coroutine.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 20/60] trace: switch crypto/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (18 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 19/60] trace: switch util/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 21/60] trace: switch migration/ " Daniel P. Berrange
                   ` (43 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 53b2785..99e7c1f 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index a36d2d9..aa09450 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -26,6 +26,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
diff --git a/crypto/secret.c b/crypto/secret.c
index 285ab7a..b936615 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -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
diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c
index a896553..7e7f974 100644
--- a/crypto/tlscreds.c
+++ b/crypto/tlscreds.c
@@ -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
 
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index 1464220..c94c09b 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -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
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index 520d34d..35c728c 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -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
diff --git a/crypto/tlssession.c b/crypto/tlssession.c
index 2de42c6..876df60 100644
--- a/crypto/tlssession.c
+++ b/crypto/tlssession.c
@@ -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
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 21/60] trace: switch migration/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (19 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 20/60] trace: switch crypto/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 22/60] trace: switch block/ " Daniel P. Berrange
                   ` (42 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 99e7c1f..483430e 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/migration/Makefile.objs b/migration/Makefile.objs
index 30ad945..33517a8 100644
--- a/migration/Makefile.objs
+++ b/migration/Makefile.objs
@@ -10,3 +10,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
diff --git a/migration/exec.c b/migration/exec.c
index 2af63cc..a7f1e70 100644
--- a/migration/exec.c
+++ b/migration/exec.c
@@ -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)
diff --git a/migration/fd.c b/migration/fd.c
index 84a10fd..03bd2d6 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -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)
diff --git a/migration/migration.c b/migration/migration.c
index 955d5ee..635547b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -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"
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index abe8c60..e0eb218 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -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
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index bbc565e..96de887 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -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)
diff --git a/migration/ram.c b/migration/ram.c
index 815bc0e..5500cb5 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -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"
 
diff --git a/migration/rdma.c b/migration/rdma.c
index 5110ec8..71c19df 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -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.
diff --git a/migration/savevm.c b/migration/savevm.c
index 33a2911..6bd108b 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -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"
diff --git a/migration/socket.c b/migration/socket.c
index 5c0a38f..71b0573 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -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)
diff --git a/migration/tls.c b/migration/tls.c
index 12c053d..fa61aef 100644
--- a/migration/tls.c
+++ b/migration/tls.c
@@ -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,
diff --git a/migration/vmstate.c b/migration/vmstate.c
index fc29acf..6d65b44 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 22/60] trace: switch block/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (20 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 21/60] trace: switch migration/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 23/60] trace: switch hw/block/ " Daniel P. Berrange
                   ` (41 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 483430e..3ab3c10 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/block.c b/block.c
index 30d64e6..e446b69 100644
--- a/block.c
+++ b/block.c
@@ -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 "qemu/error-report.h"
diff --git a/block/Makefile.objs b/block/Makefile.objs
index 2593a2f..ebf4787 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -24,6 +24,8 @@ block-obj-y += accounting.o dirty-bitmap.o
 block-obj-y += write-threshold.o
 
 block-obj-y += crypto.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 
 common-obj-y += stream.o
 common-obj-y += backup.o
diff --git a/block/backup.c b/block/backup.c
index 2c05323..9f329d0 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -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.h"
diff --git a/block/block-backend.c b/block/block-backend.c
index effa038..3ed6296 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -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
diff --git a/block/commit.c b/block/commit.c
index 553e18d..5e7b6c2 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
 #include "qapi/error.h"
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index f2bfdcf..ea0bd35 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -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"
 
diff --git a/block/io.c b/block/io.c
index d5493ba..1166a21 100644
--- a/block/io.c
+++ b/block/io.c
@@ -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"
diff --git a/block/mirror.c b/block/mirror.c
index e0b3f41..7f3acb4 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -12,7 +12,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/blockjob.h"
 #include "block/block_int.h"
 #include "sysemu/block-backend.h"
diff --git a/block/nfs.c b/block/nfs.c
index 8602a44..7b92c19 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -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"
diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
index 6eaefed..d22043e 100644
--- a/block/qcow2-cache.c
+++ b/block/qcow2-cache.c
@@ -27,7 +27,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;
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index f941835..22dbb4d 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -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)
diff --git a/block/qcow2.c b/block/qcow2.c
index 91ef4df..6f3b538 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -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"
diff --git a/block/qed-l2-cache.c b/block/qed-l2-cache.c
index 5cba794..b413753 100644
--- a/block/qed-l2-cache.c
+++ b/block/qed-l2-cache.c
@@ -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 */
diff --git a/block/qed-table.c b/block/qed-table.c
index 1a731df..d473e85 100644
--- a/block/qed-table.c
+++ b/block/qed-table.c
@@ -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"
diff --git a/block/qed.c b/block/qed.c
index 426f3cb..db2cfc9 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -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"
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 6ed7547..b551db4 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -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"
diff --git a/block/raw-win32.c b/block/raw-win32.c
index 56f45fe..149118d 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -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"
diff --git a/block/stream.c b/block/stream.c
index 3187481..9289c1a 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -12,7 +12,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "block/trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
 #include "qapi/error.h"
diff --git a/blockdev.c b/blockdev.c
index 2161400..347eb6e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 23/60] trace: switch hw/block/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (21 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 22/60] trace: switch block/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 24/60] trace: switch hw/char/ " Daniel P. Berrange
                   ` (40 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 3ab3c10..8fe8b71 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/block/Makefile.objs b/hw/block/Makefile.objs
index d4c3ab7..a2f523d 100644
--- a/hw/block/Makefile.objs
+++ b/hw/block/Makefile.objs
@@ -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
 
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 704a763..28e7163 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -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"
diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c
index 57ad501..5d3691a 100644
--- a/hw/block/hd-geometry.c
+++ b/hw/block/hd-geometry.c
@@ -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 */
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 331d766..856c0e3 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 24/60] trace: switch hw/char/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (22 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 23/60] trace: switch hw/block/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 25/60] trace: switch hw/intc/ " Daniel P. Berrange
                   ` (39 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 8fe8b71..ad44cbc 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs
index 69a553c..13db97f 100644
--- a/hw/char/Makefile.objs
+++ b/hw/char/Makefile.objs
@@ -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
diff --git a/hw/char/escc.c b/hw/char/escc.c
index 31a5f90..f004b3c 100644
--- a/hw/char/escc.c
+++ b/hw/char/escc.c
@@ -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:
diff --git a/hw/char/grlib_apbuart.c b/hw/char/grlib_apbuart.c
index 871524c..9212361 100644
--- a/hw/char/grlib_apbuart.c
+++ b/hw/char/grlib_apbuart.c
@@ -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 */
 
diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c
index 28c2cf7..bdab1b7 100644
--- a/hw/char/lm32_juart.c
+++ b/hw/char/lm32_juart.c
@@ -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"
diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index b5c760d..2ca5678 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -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"
 
diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index baddb37..9f5d5e4 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -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"
 
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 2e36481..b5e28e1 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -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"
 
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index db57a38..28cab84 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -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"
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 25/60] trace: switch hw/intc/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (23 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 24/60] trace: switch hw/char/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 26/60] trace: switch hw/net/ " Daniel P. Berrange
                   ` (38 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index ad44cbc..b1306fa 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/intc/Makefile.objs b/hw/intc/Makefile.objs
index 05ec21b..2b8493e 100644
--- a/hw/intc/Makefile.objs
+++ b/hw/intc/Makefile.objs
@@ -17,6 +17,8 @@ common-obj-$(CONFIG_ARM_GIC) += arm_gicv3.o
 common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_dist.o
 common-obj-$(CONFIG_ARM_GIC) += arm_gicv3_redist.o
 common-obj-$(CONFIG_OPENPIC) += openpic.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
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index 45887d9..18db178 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -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"
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 14ac43c..772419e 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -23,7 +23,7 @@
 #include "cpu.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"
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index b30cc91..8ad10c6 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -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
 
diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c
index 4633172..6336b87 100644
--- a/hw/intc/arm_gicv3_cpuif.c
+++ b/hw/intc/arm_gicv3_cpuif.c
@@ -13,7 +13,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 #include "gicv3_internal.h"
 #include "cpu.h"
 
diff --git a/hw/intc/arm_gicv3_dist.c b/hw/intc/arm_gicv3_dist.c
index 3ea3dd0..dc405e9 100644
--- a/hw/intc/arm_gicv3_dist.c
+++ b/hw/intc/arm_gicv3_dist.c
@@ -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
diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c
index 77e5cfa..f1a6b08 100644
--- a/hw/intc/arm_gicv3_redist.c
+++ b/hw/intc/arm_gicv3_redist.c
@@ -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)
diff --git a/hw/intc/aspeed_vic.c b/hw/intc/aspeed_vic.c
index 2370e74..c152d78 100644
--- a/hw/intc/aspeed_vic.c
+++ b/hw/intc/aspeed_vic.c
@@ -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
 
diff --git a/hw/intc/grlib_irqmp.c b/hw/intc/grlib_irqmp.c
index ac7e63f..26c89af 100644
--- a/hw/intc/grlib_irqmp.c
+++ b/hw/intc/grlib_irqmp.c
@@ -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
diff --git a/hw/intc/lm32_pic.c b/hw/intc/lm32_pic.c
index 3dad01c..37a393f 100644
--- a/hw/intc/lm32_pic.c
+++ b/hw/intc/lm32_pic.c
@@ -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"
 
 #define TYPE_LM32_PIC "lm32-pic"
diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
index 6ab29ef..44d3ea4 100644
--- a/hw/intc/s390_flic.c
+++ b/hw/intc/s390_flic.c
@@ -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)
 {
diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c
index fef8080..5bfc772 100644
--- a/hw/intc/s390_flic_kvm.c
+++ b/hw/intc/s390_flic_kvm.c
@@ -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)
diff --git a/hw/intc/slavio_intctl.c b/hw/intc/slavio_intctl.c
index e82e893..ecf09ca 100644
--- a/hw/intc/slavio_intctl.c
+++ b/hw/intc/slavio_intctl.c
@@ -26,7 +26,7 @@
 #include "hw/sparc/sun4m.h"
 #include "monitor/monitor.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/intc/trace.h"
 
 //#define DEBUG_IRQ_COUNT
 
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index cd48f42..49a1146 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -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"
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index edbd62f..9d944e3 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -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"
diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
index 618826d..8e83709 100644
--- a/hw/intc/xics_spapr.c
+++ b/hw/intc/xics_spapr.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 26/60] trace: switch hw/net/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (24 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 25/60] trace: switch hw/intc/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 27/60] trace: switch hw/virtio/ " Daniel P. Berrange
                   ` (37 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index b1306fa..049be9c 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/net/Makefile.objs b/hw/net/Makefile.objs
index 610ed3e..da244c2 100644
--- a/hw/net/Makefile.objs
+++ b/hw/net/Makefile.objs
@@ -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
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index d001c96..51591e8 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -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)
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index badb1fe..6bfd692 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -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 */
diff --git a/hw/net/e1000x_common.c b/hw/net/e1000x_common.c
index eb0e097..7b6cfa8 100644
--- a/hw/net/e1000x_common.c
+++ b/hw/net/e1000x_common.c
@@ -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)
 {
diff --git a/hw/net/lance.c b/hw/net/lance.c
index 573d724..6e36f9f 100644
--- a/hw/net/lance.c
+++ b/hw/net/lance.c
@@ -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"
diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
index c3a12e1..0a0d43f 100644
--- a/hw/net/milkymist-minimac2.c
+++ b/hw/net/milkymist-minimac2.c
@@ -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"
 
diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c
index 5a63df7..5f8fd6a 100644
--- a/hw/net/mipsnet.c
+++ b/hw/net/mipsnet.c
@@ -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 */
diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
index 1019b50..9ec6e61 100644
--- a/hw/net/net_rx_pkt.c
+++ b/hw/net/net_rx_pkt.c
@@ -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"
diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c
index 268d6a7..2a38c05 100644
--- a/hw/net/opencores_eth.c
+++ b/hw/net/opencores_eth.c
@@ -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
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 0acf8a4..6cfc121 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -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"
 
diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
index 198a01f..4e19d4e 100644
--- a/hw/net/pcnet.c
+++ b/hw/net/pcnet.c
@@ -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"
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 27/60] trace: switch hw/virtio/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (25 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 26/60] trace: switch hw/net/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 28/60] trace: switch hw/audio/ " Daniel P. Berrange
                   ` (36 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 049be9c..0840225 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/virtio/Makefile.objs b/hw/virtio/Makefile.objs
index 3e2b175..1bd2195 100644
--- a/hw/virtio/Makefile.objs
+++ b/hw/virtio/Makefile.objs
@@ -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
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 5af429a..fb60da5 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -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"
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index cd8ca10..0ad894e 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -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)
 {
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 15ee3a7..2d205e2 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 28/60] trace: switch hw/audio/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (26 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 27/60] trace: switch hw/virtio/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 29/60] trace: switch hw/misc/ " Daniel P. Berrange
                   ` (35 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 0840225..80f91ee 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/audio/Makefile.objs b/hw/audio/Makefile.objs
index 7ce85a2..d779550 100644
--- a/hw/audio/Makefile.objs
+++ b/hw/audio/Makefile.objs
@@ -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
diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c
index 30690f9..8c7eb1e 100644
--- a/hw/audio/cs4231.c
+++ b/hw/audio/cs4231.c
@@ -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.
diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c
index bc8db71..fd994b4 100644
--- a/hw/audio/milkymist-ac97.c
+++ b/hw/audio/milkymist-ac97.c
@@ -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"
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 29/60] trace: switch hw/misc/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (27 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 28/60] trace: switch hw/audio/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 30/60] trace: switch hw/usb/ " Daniel P. Berrange
                   ` (34 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 80f91ee..ec58269 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
index 4cfbd10..9251f6d 100644
--- a/hw/misc/Makefile.objs
+++ b/hw/misc/Makefile.objs
@@ -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
+
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
index c7e2c82..0adbec1 100644
--- a/hw/misc/aspeed_scu.c
+++ b/hw/misc/aspeed_scu.c
@@ -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)
 
diff --git a/hw/misc/eccmemctl.c b/hw/misc/eccmemctl.c
index a0071f3..a0424f9 100644
--- a/hw/misc/eccmemctl.c
+++ b/hw/misc/eccmemctl.c
@@ -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
diff --git a/hw/misc/milkymist-hpdmc.c b/hw/misc/milkymist-hpdmc.c
index e6140ee..8596437 100644
--- a/hw/misc/milkymist-hpdmc.c
+++ b/hw/misc/milkymist-hpdmc.c
@@ -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 {
diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c
index 1da21a6..f95e2f4 100644
--- a/hw/misc/milkymist-pfpu.c
+++ b/hw/misc/milkymist-pfpu.c
@@ -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>
diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c
index edd5de0..a4820c5 100644
--- a/hw/misc/slavio_misc.c
+++ b/hw/misc/slavio_misc.c
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 30/60] trace: switch hw/usb/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (28 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 29/60] trace: switch hw/misc/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 31/60] trace: switch hw/scsi/ " Daniel P. Berrange
                   ` (33 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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        | 6 +++---
 hw/usb/hcd-uhci.c        | 2 +-
 hw/usb/hcd-xhci.c        | 2 +-
 hw/usb/host-libusb.c     | 2 +-
 14 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index ec58269..e1596cb 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 98b5c9d..c7b85c4 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -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
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 25913ad..e41cf29 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -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);
diff --git a/hw/usb/combined-packet.c b/hw/usb/combined-packet.c
index 48cac87..fb5b87f 100644
--- a/hw/usb/combined-packet.c
+++ b/hw/usb/combined-packet.c
@@ -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)
 {
diff --git a/hw/usb/core.c b/hw/usb/core.c
index 45fa00c..68668c3 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -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)
 {
diff --git a/hw/usb/desc.c b/hw/usb/desc.c
index 5e0e1d1..5d64552 100644
--- a/hw/usb/desc.c
+++ b/hw/usb/desc.c
@@ -2,7 +2,7 @@
 
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
-#include "trace.h"
+#include "hw/usb/trace.h"
 
 /* ------------------------------------------------------------------ */
 
diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c
index a33f21c..5359688 100644
--- a/hw/usb/dev-hub.c
+++ b/hw/usb/dev-hub.c
@@ -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"
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 1be85ae..4c73547 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -23,7 +23,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"
 
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index 3a8ff18..46efc5a 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -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"
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index b093db7..fb0e798 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -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)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 43b5181..8481490 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -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
@@ -937,9 +937,9 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
 #ifdef trace_event_get_state
 static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
 {
-    bool print16 = !!trace_event_get_state(common_dstate,
+    bool print16 = !!trace_event_get_state(hw_usb_dstate,
                                            TRACE_USB_OHCI_TD_PKT_SHORT);
-    bool printall = !!trace_event_get_state(common_dstate,
+    bool printall = !!trace_event_get_state(hw_usb_dstate,
                                             TRACE_USB_OHCI_TD_PKT_FULL);
     const int width = 16;
     int i;
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index ca72a80..ee7de68 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -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
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 188f954..6871b06 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -25,7 +25,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
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index e94672c..8dcfb83 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -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"
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 31/60] trace: switch hw/scsi/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (29 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 30/60] trace: switch hw/usb/ " Daniel P. Berrange
@ 2016-08-09 15:31 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 32/60] trace: switch hw/nvram/ " Daniel P. Berrange
                   ` (32 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index e1596cb..8d7b678 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/scsi/Makefile.objs b/hw/scsi/Makefile.objs
index 5a2248b..cdf229b 100644
--- a/hw/scsi/Makefile.objs
+++ b/hw/scsi/Makefile.objs
@@ -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
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index 595f88b..1a94cb7 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -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"
 
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 1f2f2d3..2a37377 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -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"
 
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index e968302..8a8a59a 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -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"
 
diff --git a/hw/scsi/mptconfig.c b/hw/scsi/mptconfig.c
index 7071854..84fa3e4 100644
--- a/hw/scsi/mptconfig.c
+++ b/hw/scsi/mptconfig.c
@@ -22,7 +22,7 @@
 
 #include "mptsas.h"
 #include "mpi.h"
-#include "trace.h"
+#include "hw/scsi/trace.h"
 
 /* Generic functions for marshaling and unmarshaling.  */
 
diff --git a/hw/scsi/mptendian.c b/hw/scsi/mptendian.c
index b7fe2a2..1584246 100644
--- a/hw/scsi/mptendian.c
+++ b/hw/scsi/mptendian.c
@@ -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"
diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
index 0e0a22f..ad3021d 100644
--- a/hw/scsi/mptsas.c
+++ b/hw/scsi/mptsas.c
@@ -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"
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 297216d..e79721c 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -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"
 
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 5116f4a..6309e8d 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 32/60] trace: switch hw/nvram/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (30 preceding siblings ...)
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 31/60] trace: switch hw/scsi/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 33/60] trace: switch hw/display/ " Daniel P. Berrange
                   ` (31 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 8d7b678..aca8fb0 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/nvram/Makefile.objs b/hw/nvram/Makefile.objs
index e9a6694..f0ca020 100644
--- a/hw/nvram/Makefile.objs
+++ b/hw/nvram/Makefile.objs
@@ -3,3 +3,5 @@ common-obj-y += eeprom93xx.o
 common-obj-y += fw_cfg.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
diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c
index 57d5ab2..cb4d4cc 100644
--- a/hw/nvram/ds1225y.c
+++ b/hw/nvram/ds1225y.c
@@ -24,7 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
-#include "trace.h"
+#include "hw/nvram/trace.h"
 
 typedef struct {
     MemoryRegion iomem;
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 6a68e59..db155af 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -30,7 +30,7 @@
 #include "hw/nvram/fw_cfg.h"
 #include "hw/sysbus.h"
 #include "hw/boards.h"
-#include "trace.h"
+#include "hw/nvram/trace.h"
 #include "qemu/error-report.h"
 #include "qemu/config-file.h"
 #include "qemu/cutils.h"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 33/60] trace: switch hw/display/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (31 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 32/60] trace: switch hw/nvram/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 34/60] trace: switch hw/input/ " Daniel P. Berrange
                   ` (30 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index aca8fb0..b3978f4 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index 063889b..8279083 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -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
diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c
index 70ef2c7..5342e07 100644
--- a/hw/display/g364fb.c
+++ b/hw/display/g364fb.c
@@ -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 {
diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c
index b72fdb1..a11125c 100644
--- a/hw/display/jazz_led.c
+++ b/hw/display/jazz_led.c
@@ -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 {
diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c
index 9c00184..7fc6141 100644
--- a/hw/display/milkymist-tmu2.c
+++ b/hw/display/milkymist-tmu2.c
@@ -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"
 
diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c
index 177fdac..2180e6d 100644
--- a/hw/display/milkymist-vgafb.c
+++ b/hw/display/milkymist-vgafb.c
@@ -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"
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
index 9ad9d9e..d1f0db3 100644
--- a/hw/display/qxl-render.c
+++ b/hw/display/qxl-render.c
@@ -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)
 {
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 0e2682d..8cc4781 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -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"
 
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 2a88b3c..8dafd26 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -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
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index 758d33a..8a3851f 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -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"
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 7fe6ed8..270d6f4 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -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"
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index e51a05e..b188130 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -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"
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 46b7d5e..0e4c335 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -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> */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 34/60] trace: switch hw/input/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (32 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 33/60] trace: switch hw/display/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 35/60] trace: switch hw/timer/ " Daniel P. Berrange
                   ` (29 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index b3978f4..49cc98c 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/input/Makefile.objs b/hw/input/Makefile.objs
index 7715d72..fc40638 100644
--- a/hw/input/Makefile.objs
+++ b/hw/input/Makefile.objs
@@ -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
diff --git a/hw/input/hid.c b/hw/input/hid.c
index 5e2850e..dd9c13a 100644
--- a/hw/input/hid.c
+++ b/hw/input/hid.c
@@ -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
diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c
index 40dfca1..41f2211 100644
--- a/hw/input/milkymist-softusb.c
+++ b/hw/input/milkymist-softusb.c
@@ -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"
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index a8aa36f..c57e117 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -28,7 +28,7 @@
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
 
-#include "trace.h"
+#include "hw/input/trace.h"
 
 /* debug PC keyboard */
 //#define DEBUG_KBD
diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c
index ccdf730..5210f8b 100644
--- a/hw/input/virtio-input.c
+++ b/hw/input/virtio-input.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 35/60] trace: switch hw/timer/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (33 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 34/60] trace: switch hw/input/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 36/60] trace: switch hw/dma/ " Daniel P. Berrange
                   ` (28 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 49cc98c..553c738 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index 7ba8c23..e764fc1 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -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
diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c
index 9b70ee0..081e160 100644
--- a/hw/timer/aspeed_timer.c
+++ b/hw/timer/aspeed_timer.c
@@ -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
 
diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c
index dd000f5..cb0f13e 100644
--- a/hw/timer/grlib_gptimer.c
+++ b/hw/timer/grlib_gptimer.c
@@ -29,7 +29,7 @@
 #include "qemu/timer.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 */
diff --git a/hw/timer/lm32_timer.c b/hw/timer/lm32_timer.c
index e45a65b..c6c0d95 100644
--- a/hw/timer/lm32_timer.c
+++ b/hw/timer/lm32_timer.c
@@ -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"
diff --git a/hw/timer/milkymist-sysctl.c b/hw/timer/milkymist-sysctl.c
index 2194832..789c11c 100644
--- a/hw/timer/milkymist-sysctl.c
+++ b/hw/timer/milkymist-sysctl.c
@@ -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"
diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c
index fb3e08b..afc44f6 100644
--- a/hw/timer/slavio_timer.c
+++ b/hw/timer/slavio_timer.c
@@ -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"
 
 /*
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 36/60] trace: switch hw/dma/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (34 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 35/60] trace: switch hw/timer/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 37/60] trace: switch hw/sparc/ " Daniel P. Berrange
                   ` (27 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 553c738..ce8d111 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/dma/Makefile.objs b/hw/dma/Makefile.objs
index 087c8e6..c3f6aae 100644
--- a/hw/dma/Makefile.objs
+++ b/hw/dma/Makefile.objs
@@ -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
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index f345c54..fd89223 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -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)
diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index 2f2576f..088cbb5 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -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                                     */
diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c
index 9d545e4..fc2cc94 100644
--- a/hw/dma/sparc32_dma.c
+++ b/hw/dma/sparc32_dma.c
@@ -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
diff --git a/hw/dma/sun4m_iommu.c b/hw/dma/sun4m_iommu.c
index b3cbc54..b7bd15e 100644
--- a/hw/dma/sun4m_iommu.c
+++ b/hw/dma/sun4m_iommu.c
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 37/60] trace: switch hw/sparc/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (35 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 36/60] trace: switch hw/dma/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 38/60] trace: switch hw/sd/ " Daniel P. Berrange
                   ` (26 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index ce8d111..83e9506 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/sparc/Makefile.objs b/hw/sparc/Makefile.objs
index c987b5b..f509dc7 100644
--- a/hw/sparc/Makefile.objs
+++ b/hw/sparc/Makefile.objs
@@ -1 +1,3 @@
 obj-y += sun4m.o leon3.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 6e16478..2cc29d4 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -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"
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 478fda8..ac7228f 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -45,7 +45,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"
 
 /*
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 38/60] trace: switch hw/sd/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (36 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 37/60] trace: switch hw/sparc/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 39/60] trace: switch hw/isa/ " Daniel P. Berrange
                   ` (25 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs             | 2 +-
 hw/sd/Makefile.objs       | 2 ++
 hw/sd/milkymist-memcard.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 83e9506..af169ff 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/sd/Makefile.objs b/hw/sd/Makefile.objs
index 31c8330..9fe778a 100644
--- a/hw/sd/Makefile.objs
+++ b/hw/sd/Makefile.objs
@@ -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
diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index 1f2f0ed..ce93fc2 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 39/60] trace: switch hw/isa/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (37 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 38/60] trace: switch hw/sd/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 40/60] trace: switch hw/mem/ " Daniel P. Berrange
                   ` (24 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs        | 2 +-
 hw/isa/Makefile.objs | 2 ++
 hw/isa/pc87312.c     | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index af169ff..14c7df1 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs
index 9164556..a273afd 100644
--- a/hw/isa/Makefile.objs
+++ b/hw/isa/Makefile.objs
@@ -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
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index c3ebf3e..6f2a187 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 40/60] trace: switch hw/mem/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (38 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 39/60] trace: switch hw/isa/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 41/60] trace: switch hw/i386/ " Daniel P. Berrange
                   ` (23 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs        | 2 +-
 hw/mem/Makefile.objs | 3 +++
 hw/mem/pc-dimm.c     | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 14c7df1..af4fea7 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/mem/Makefile.objs b/hw/mem/Makefile.objs
index f12f8b9..ae1f513 100644
--- a/hw/mem/Makefile.objs
+++ b/hw/mem/Makefile.objs
@@ -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
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 9e8dab0..bcbaa32 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -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 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 41/60] trace: switch hw/i386/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (39 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 40/60] trace: switch hw/mem/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 42/60] trace: switch hw/9pfs/ " Daniel P. Berrange
                   ` (22 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index af4fea7..1dc55aa 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 90e94ff..ffbbb6c 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -8,3 +8,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
diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c
index ce26b2a..af486ce 100644
--- a/hw/i386/x86-iommu.c
+++ b/hw/i386/x86-iommu.c
@@ -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)
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index aa78393..88ea922 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -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"
diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
index c093b34..742a3d9 100644
--- a/hw/i386/xen/xen_pvdevice.c
+++ b/hw/i386/xen/xen_pvdevice.c
@@ -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"
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 42/60] trace: switch hw/9pfs/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (40 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 41/60] trace: switch hw/i386/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 43/60] trace: switch hw/ppc/ " Daniel P. Berrange
                   ` (21 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs         | 2 +-
 hw/9pfs/9p.c          | 2 +-
 hw/9pfs/Makefile.objs | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 1dc55aa..4734bac 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index b6b02b4..2531c82 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -21,7 +21,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;
diff --git a/hw/9pfs/Makefile.objs b/hw/9pfs/Makefile.objs
index da0ae0c..28eb2e5 100644
--- a/hw/9pfs/Makefile.objs
+++ b/hw/9pfs/Makefile.objs
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 43/60] trace: switch hw/ppc/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (41 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 42/60] trace: switch hw/9pfs/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 44/60] trace: switch hw/pci/ " Daniel P. Berrange
                   ` (20 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 4734bac..0458667 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs
index 91a3420..8cf7759 100644
--- a/hw/ppc/Makefile.objs
+++ b/hw/ppc/Makefile.objs
@@ -23,3 +23,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
+
+common-obj-y += trace.o
+common-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index e425252..1816fac 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -36,7 +36,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
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 054af1e..c5c97b1 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -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"
 
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 57564e5..4236315 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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"
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 73af112..6d277b6 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -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"
 
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 6bc4d4d..e8e7900 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -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"
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 949c44f..598a79c 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -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"
 
diff --git a/hw/ppc/spapr_rtas_ddw.c b/hw/ppc/spapr_rtas_ddw.c
index 177dcff..3dad98c 100644
--- a/hw/ppc/spapr_rtas_ddw.c
+++ b/hw/ppc/spapr_rtas_ddw.c
@@ -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)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 44/60] trace: switch hw/pci/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (42 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 43/60] trace: switch hw/ppc/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 45/60] trace: switch hw/s390x/ " Daniel P. Berrange
                   ` (19 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs        | 2 +-
 hw/pci/Makefile.objs | 2 ++
 hw/pci/pci.c         | 2 +-
 hw/pci/pci_host.c    | 2 +-
 hw/ppc/Makefile.objs | 4 ++--
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 0458667..d63efb2 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index 9f905e6..b075774 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -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
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 24fae16..8c1c7b9 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -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"
diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c
index 5eaa935..2ecf5b9 100644
--- a/hw/pci/pci_host.c
+++ b/hw/pci/pci_host.c
@@ -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
diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs
index 8cf7759..39bc56f 100644
--- a/hw/ppc/Makefile.objs
+++ b/hw/ppc/Makefile.objs
@@ -24,5 +24,5 @@ obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o
 # PowerPC 440 Xilinx ML507 reference board.
 obj-$(CONFIG_XILINX) += virtex_ml507.o
 
-common-obj-y += trace.o
-common-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 45/60] trace: switch hw/s390x/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (43 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 44/60] trace: switch hw/pci/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 46/60] trace: switch hw/vfio/ " Daniel P. Berrange
                   ` (18 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index d63efb2..296c824 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs
index 41ac4ec..ac66483 100644
--- a/hw/s390x/Makefile.objs
+++ b/hw/s390x/Makefile.objs
@@ -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
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index bb8e4be..c0c3c48 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -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 {
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index a554a24..e489277 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -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,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 46/60] trace: switch hw/vfio/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (44 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 45/60] trace: switch hw/s390x/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 47/60] trace: switch hw/acpi/ " Daniel P. Berrange
                   ` (17 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 296c824..19645ec 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/vfio/Makefile.objs b/hw/vfio/Makefile.objs
index c25e32b..33f7d4f 100644
--- a/hw/vfio/Makefile.objs
+++ b/hw/vfio/Makefile.objs
@@ -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
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index b313e7c..5092def 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -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"
 
 struct vfio_group_head vfio_group_list =
     QLIST_HEAD_INITIALIZER(vfio_group_list);
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index bec694c..72acb72 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -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)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 7bfa17c..e9d0fc9 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -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
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index a559e7b..5ddfb30 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -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"
 
diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c
index 7443d34..b1b9895 100644
--- a/hw/vfio/spapr.c
+++ b/hw/vfio/spapr.c
@@ -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)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 47/60] trace: switch hw/acpi/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (45 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 46/60] trace: switch hw/vfio/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 48/60] trace: switch hw/arm/ " Daniel P. Berrange
                   ` (16 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 19645ec..1cbd038 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs
index 4b7da66..d2744a4 100644
--- a/hw/acpi/Makefile.objs
+++ b/hw/acpi/Makefile.objs
@@ -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
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index c13b65c..a33efaf 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -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"
 
 #define ACPI_CPU_HOTPLUG_REG_LEN 12
 #define ACPI_CPU_SELECTOR_OFFSET_WR 0
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index ec4e64b..e442970 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 48/60] trace: switch hw/arm/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (46 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 47/60] trace: switch hw/acpi/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 49/60] trace: switch hw/alpha/ " Daniel P. Berrange
                   ` (15 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs            | 2 +-
 hw/arm/Makefile.objs     | 2 ++
 hw/arm/virt-acpi-build.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 1cbd038..fbcf040 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
index 12764ef..ac9fa9a 100644
--- a/hw/arm/Makefile.objs
+++ b/hw/arm/Makefile.objs
@@ -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) += ast2400.o palmetto-bmc.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 28fc59c..775be61 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 49/60] trace: switch hw/alpha/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (47 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 48/60] trace: switch hw/arm/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 50/60] trace: switch ui/ " Daniel P. Berrange
                   ` (14 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs          | 2 +-
 hw/alpha/Makefile.objs | 2 ++
 hw/alpha/pci.c         | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index fbcf040..510083c 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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
diff --git a/hw/alpha/Makefile.objs b/hw/alpha/Makefile.objs
index 5c74275..e8e0573 100644
--- a/hw/alpha/Makefile.objs
+++ b/hw/alpha/Makefile.objs
@@ -1 +1,3 @@
 obj-y += dp264.o pci.o typhoon.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/hw/alpha/pci.c b/hw/alpha/pci.c
index 8dde637..3fafb1b 100644
--- a/hw/alpha/pci.c
+++ b/hw/alpha/pci.c
@@ -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.  */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 50/60] trace: switch ui/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (48 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 49/60] trace: switch hw/alpha/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 51/60] trace: switch audio/ " Daniel P. Berrange
                   ` (13 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 510083c..b81db74 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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-i386/trace-events
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index dc936f1..c9d1847 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -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
diff --git a/ui/console.c b/ui/console.c
index c24bfe4..8adfff7 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -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
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 3f5d328..1c12d34 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -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"
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 0df5a36..49c9e00 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -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"
diff --git a/ui/gtk.c b/ui/gtk.c
index 58d20ee..58c66be 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -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"
diff --git a/ui/input.c b/ui/input.c
index ed88cda..b3b881b 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -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"
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 99132b6..9065e74 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -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"
 
diff --git a/ui/vnc.c b/ui/vnc.c
index 853b57e..564c80e 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 51/60] trace: switch audio/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (49 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 50/60] trace: switch ui/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 52/60] trace: switch net/ " Daniel P. Berrange
                   ` (12 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs       | 2 +-
 audio/Makefile.objs | 2 ++
 audio/alsaaudio.c   | 2 +-
 audio/ossaudio.c    | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index b81db74..bcd830e 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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-i386/trace-events
 trace-events-y += target-sparc/trace-events
diff --git a/audio/Makefile.objs b/audio/Makefile.objs
index 481d1aa..4eef4b4 100644
--- a/audio/Makefile.objs
+++ b/audio/Makefile.objs
@@ -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)
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 3652a7b..1111b71 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -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"
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 0edd7ea..c04da5e 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 52/60] trace: switch net/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (50 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 51/60] trace: switch audio/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 53/60] trace: switch target-i386/ " Daniel P. Berrange
                   ` (11 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs       | 2 +-
 net/Makefile.objs   | 2 ++
 net/filter-mirror.c | 2 +-
 net/vhost-user.c    | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index bcd830e..2f892ed 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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-i386/trace-events
 trace-events-y += target-sparc/trace-events
 trace-events-y += target-s390x/trace-events
diff --git a/net/Makefile.objs b/net/Makefile.objs
index b7c22fd..4939b48 100644
--- a/net/Makefile.objs
+++ b/net/Makefile.objs
@@ -16,3 +16,5 @@ common-obj-$(CONFIG_NETMAP) += netmap.o
 common-obj-y += filter.o
 common-obj-y += filter-buffer.o
 common-obj-y += filter-mirror.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/net/filter-mirror.c b/net/filter-mirror.c
index 35df374..a0d1eca 100644
--- a/net/filter-mirror.c
+++ b/net/filter-mirror.c
@@ -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"
diff --git a/net/vhost-user.c b/net/vhost-user.c
index b0595f8..b2b53ca 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 53/60] trace: switch target-i386/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (51 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 52/60] trace: switch net/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 54/60] trace: switch target-sparc/ " Daniel P. Berrange
                   ` (10 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs             | 2 +-
 target-i386/Makefile.objs | 2 ++
 target-i386/kvm.c         | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 2f892ed..3fc6365 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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-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
diff --git a/target-i386/Makefile.objs b/target-i386/Makefile.objs
index b223d79..a73e6f3 100644
--- a/target-i386/Makefile.objs
+++ b/target-i386/Makefile.objs
@@ -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
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 0b2016a..d4a63e7 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -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
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 54/60] trace: switch target-sparc/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (52 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 53/60] trace: switch target-i386/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 55/60] trace: switch target-s390x/ " Daniel P. Berrange
                   ` (9 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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(-)

diff --git a/Makefile.objs b/Makefile.objs
index 3fc6365..9cddc6d 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -156,7 +156,7 @@ trace-events-subdirs += ui
 trace-events-subdirs += audio
 trace-events-subdirs += net
 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
diff --git a/target-sparc/Makefile.objs b/target-sparc/Makefile.objs
index ec90569..0ca6e73 100644
--- a/target-sparc/Makefile.objs
+++ b/target-sparc/Makefile.objs
@@ -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
diff --git a/target-sparc/int32_helper.c b/target-sparc/int32_helper.c
index 09afe13..d930e10 100644
--- a/target-sparc/int32_helper.c
+++ b/target-sparc/int32_helper.c
@@ -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"
 
diff --git a/target-sparc/int64_helper.c b/target-sparc/int64_helper.c
index 29360fa..5b9f2ce 100644
--- a/target-sparc/int64_helper.c
+++ b/target-sparc/int64_helper.c
@@ -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
 
diff --git a/target-sparc/mmu_helper.c b/target-sparc/mmu_helper.c
index 32b629f..dcafe3a 100644
--- a/target-sparc/mmu_helper.c
+++ b/target-sparc/mmu_helper.c
@@ -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 */
diff --git a/target-sparc/win_helper.c b/target-sparc/win_helper.c
index a8a6c0c..f95ecc3 100644
--- a/target-sparc/win_helper.c
+++ b/target-sparc/win_helper.c
@@ -20,7 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.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)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 55/60] trace: switch target-s390x/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (53 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 54/60] trace: switch target-sparc/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 56/60] trace: switch target-ppc/ " Daniel P. Berrange
                   ` (8 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs              | 2 +-
 target-s390x/Makefile.objs | 2 ++
 target-s390x/cpu.c         | 2 +-
 target-s390x/ioinst.c      | 2 +-
 target-s390x/kvm.c         | 2 +-
 target-s390x/mmu_helper.c  | 2 +-
 6 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 9cddc6d..5734475 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -157,7 +157,7 @@ trace-events-subdirs += audio
 trace-events-subdirs += net
 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
diff --git a/target-s390x/Makefile.objs b/target-s390x/Makefile.objs
index dd62cbd..97bfbfd 100644
--- a/target-s390x/Makefile.objs
+++ b/target-s390x/Makefile.objs
@@ -3,3 +3,5 @@ obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
 obj-y += gdbstub.o
 obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o
 obj-$(CONFIG_KVM) += kvm.o
+trace-obj-y += trace.o
+trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index e43e2d6..1d93d03 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -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"
diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index a5a288b..43c3a96 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -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,
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 80ac621..7732ae5 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -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"
diff --git a/target-s390x/mmu_helper.c b/target-s390x/mmu_helper.c
index b11a027..5ebf8d8 100644
--- a/target-s390x/mmu_helper.c
+++ b/target-s390x/mmu_helper.c
@@ -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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 56/60] trace: switch target-ppc/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (54 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 55/60] trace: switch target-s390x/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 57/60] trace: switch qom/ " Daniel P. Berrange
                   ` (7 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs            | 2 +-
 target-ppc/Makefile.objs | 2 ++
 target-ppc/kvm.c         | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 5734475..9ba93dd 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -158,7 +158,7 @@ trace-events-subdirs += net
 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
 
diff --git a/target-ppc/Makefile.objs b/target-ppc/Makefile.objs
index e667e69..7a71b38 100644
--- a/target-ppc/Makefile.objs
+++ b/target-ppc/Makefile.objs
@@ -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
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 84764ed..7d55145 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -38,7 +38,7 @@
 #include "hw/ppc/spapr_vio.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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 57/60] trace: switch qom/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (55 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 56/60] trace: switch target-ppc/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 58/60] trace: switch linux-user/ " Daniel P. Berrange
                   ` (6 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs     | 2 +-
 qom/Makefile.objs | 2 ++
 qom/object.c      | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 9ba93dd..53a26fb 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -159,7 +159,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-files = trace-events $(trace-events-subdirs:%=%/trace-events)
diff --git a/qom/Makefile.objs b/qom/Makefile.objs
index 516349e..8cc7800 100644
--- a/qom/Makefile.objs
+++ b/qom/Makefile.objs
@@ -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
diff --git a/qom/object.c b/qom/object.c
index 8166b7d..553f385 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -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?  */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 58/60] trace: switch linux-user/ directory to modular trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (56 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 57/60] trace: switch qom/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 59/60] trace: remove the global include/trace.h file Daniel P. Berrange
                   ` (5 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile.objs            | 2 +-
 linux-user/Makefile.objs | 2 ++
 linux-user/signal.c      | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 53a26fb..c2ee78e 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -160,7 +160,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-files = trace-events $(trace-events-subdirs:%=%/trace-events)
 
diff --git a/linux-user/Makefile.objs b/linux-user/Makefile.objs
index 8c93058..7a05775 100644
--- a/linux-user/Makefile.objs
+++ b/linux-user/Makefile.objs
@@ -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
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 9a4d894..3db2faa 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -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,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 59/60] trace: remove the global include/trace.h file
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (57 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 58/60] trace: switch linux-user/ " Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach Daniel P. Berrange
                   ` (4 subsequent siblings)
  63 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, 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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 .gitignore                               |  9 ++--
 Makefile                                 | 56 ++++++++++++++++------
 Makefile.objs                            |  5 +-
 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                      | 79 +++-----------------------------
 9 files changed, 57 insertions(+), 116 deletions(-)
 delete mode 100644 include/trace.h

diff --git a/.gitignore b/.gitignore
index 7249070..4920850 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
@@ -117,6 +113,7 @@ docker-src.*
 *~
 trace.h
 trace.c
+trace-ust.h
 trace-events-common
 trace-ust.h
 trace-dtrace.h
diff --git a/Makefile b/Makefile
index 2b9ba60..c668909 100644
--- a/Makefile
+++ b/Makefile
@@ -56,33 +56,26 @@ GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
 GENERATED_HEADERS += qmp-introspect.h
 GENERATED_SOURCES += qmp-introspect.c
 
-GENERATED_HEADERS += trace/generated-tracers.h
-ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
-GENERATED_HEADERS += trace/generated-tracers-dtrace.h
-endif
-GENERATED_SOURCES += trace/generated-tracers.c
-
 GENERATED_HEADERS += trace/generated-tcg-tracers.h
 
 GENERATED_HEADERS += trace/generated-helpers-wrappers.h
 GENERATED_HEADERS += trace/generated-helpers.h
 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
+ifdef CONFIG_TRACE_UST
+GENERATED_HEADERS += trace/trace-ust-all.h
+GENERATED_SOURCES += trace/trace-ust-all.c
 endif
 
-GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace.h)
-GENERATED_SOURCES += $(trace-events-subdirs:%=%/trace.c)
+GENERATED_HEADERS += trace.h $(trace-events-subdirs:%=%/trace.h)
+GENERATED_SOURCES += trace.c $(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)
+GENERATED_HEADERS += trace-dtrace.h $(trace-events-subdirs:%=%/trace-dtrace.h)
+GENERATED_DTRACE += trace-dtrace.dtrace $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
 endif
 ifdef CONFIG_TRACE_UST
-GENERATED_HEADERS += $(trace-events-subdirs:%=%/trace-ust.h)
+GENERATED_HEADERS += trace-ust.h $(trace-events-subdirs:%=%/trace-ust.h)
 endif
 
 %/trace.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
@@ -119,6 +112,39 @@ endif
 %/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
 
 
+trace.h: $(SRC_PATH)/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=h \
+		--backends=$(TRACE_BACKENDS) \
+		--group=core \
+		< $< > $@,"  GEN   $@")
+
+trace.c: $(SRC_PATH)/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=c \
+		--backends=$(TRACE_BACKENDS) \
+		--group=core \
+		< $< > $@,"  GEN   $@")
+
+trace-ust.h: $(SRC_PATH)/trace-events $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=ust-events-h \
+		--backends=$(TRACE_BACKENDS) \
+		--group=core \
+		< $< > $@,"  GEN   $@")
+
+trace-dtrace.dtrace: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
+	$(call quiet-command,$(TRACETOOL) \
+		--format=d \
+		--backends=$(TRACE_BACKENDS) \
+		--group=core \
+		< $< > $@,"  GEN   $@")
+
+trace-dtrace.h: trace-dtrace.dtrace
+	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
+
+trace-dtrace.o: trace-dtrace.dtrace
+
 # Don't try to regenerate Makefile or configure
 # We don't generate any of them
 Makefile: ;
diff --git a/Makefile.objs b/Makefile.objs
index c2ee78e..ba5f75f 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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,4 +163,6 @@ trace-events-subdirs += linux-user
 
 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_DTRACE) += trace-dtrace.o
+trace-obj-y += $(trace-events-subdirs:%=%/)
diff --git a/include/trace.h b/include/trace.h
deleted file mode 100644
index ac9ff3d..0000000
--- a/include/trace.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef TRACE_H
-#define TRACE_H
-
-#include "trace/generated-tracers.h"
-
-#endif /* TRACE_H */
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index 1319990..6df33fc 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -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"',
         '')
 
 
diff --git a/scripts/tracetool/backend/ust.py b/scripts/tracetool/backend/ust.py
index 599c12e..92b2837 100644
--- a/scripts/tracetool/backend/ust.py
+++ b/scripts/tracetool/backend/ust.py
@@ -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"',
         '')
 
 
diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/format/ust_events_c.py
index 8be8116..264784c 100644
--- a/scripts/tracetool/format/ust_events_c.py
+++ b/scripts/tracetool/format/ust_events_c.py
@@ -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"')
diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/format/ust_events_h.py
index f4258e5..70d525f 100644
--- a/scripts/tracetool/format/ust_events_h.py
+++ b/scripts/tracetool/format/ust_events_h.py
@@ -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"
 
diff --git a/trace/Makefile.objs b/trace/Makefile.objs
index 00ebe3a..3af5431 100644
--- a/trace/Makefile.objs
+++ b/trace/Makefile.objs
@@ -17,89 +17,23 @@ $(BUILD_DIR)/trace-events-common: $(trace-events-y:%=$(SRC_PATH)/%)
 ######################################################################
 # Auto-generated event descriptions for LTTng ust code
 
-ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
+ifdef CONFIG_TRACE_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-common $(tracetool-y)
+$(obj)/trace-ust-all.h: $(BUILD_DIR)/trace-events-all $(tracetool-y)
 	$(call quiet-command,$(TRACETOOL) \
 		--format=ust-events-h \
 		--backends=$(TRACE_BACKENDS) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
+		< $< > $@,"  GEN   $@")
 
-$(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) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
-
-$(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
-	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-ust.c-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
+$(obj)/trace-ust-all.c: $(BUILD_DIR)/trace-events-all $(tracetool-y)
 	$(call quiet-command,$(TRACETOOL) \
 		--format=ust-events-c \
 		--backends=$(TRACE_BACKENDS) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
-
-$(obj)/generated-tracers.h: $(obj)/generated-ust-provider.h $(obj)/generated-ust-provider-all.h
-$(obj)/generated-tracers.c: $(obj)/generated-ust.c
+		< $< > $@,"  GEN   $@")
 
 endif
 
 
-######################################################################
-# Auto-generated tracing routines
-
-##################################################
-# Execution level
-
-$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
-	@cmp -s $< $@ || cp $< $@
-$(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) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
-
-##############################
-# non-DTrace
-
-$(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
-	@cmp -s $< $@ || cp $< $@
-$(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) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
-
-$(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
-
-##############################
-# DTrace
-
-# Normal practice is to name DTrace probe file with a '.d' extension
-# but that gets picked up by QEMU's Makefile as an external dependency
-# rule file. So we use '.dtrace' instead
-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-common $(BUILD_DIR)/config-host.mak $(tracetool-y)
-	$(call quiet-command,$(TRACETOOL) \
-		--format=d \
-		--backends=$(TRACE_BACKENDS) \
-		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
-
-$(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers-dtrace.dtrace
-	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
-
-$(obj)/generated-tracers-dtrace.o: $(obj)/generated-tracers-dtrace.dtrace
-
-util-obj-y += generated-tracers-dtrace.o
-endif
-
 ##################################################
 # Translation level
 
@@ -144,10 +78,9 @@ $(obj)/generated-tcg-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_
 ######################################################################
 # Backend code
 
-util-obj-y += generated-tracers.o
 util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
 util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o
-util-obj-$(CONFIG_TRACE_UST) += generated-ust.o
+util-obj-$(CONFIG_TRACE_UST) += trace-ust-all.o
 util-obj-y += control.o
 target-obj-y += control-target.o
 util-obj-y += qmp.o
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (58 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 59/60] trace: remove the global include/trace.h file Daniel P. Berrange
@ 2016-08-09 15:32 ` Daniel P. Berrange
  2016-08-10 14:33   ` Lluís Vilanova
  2016-08-09 17:03 ` [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files no-reply
                   ` (3 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 15:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Daniel P. Berrange

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 52 insertions(+), 9 deletions(-)

diff --git a/docs/tracing.txt b/docs/tracing.txt
index 29f2f9a..b7ba179 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -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 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
@@ -357,6 +397,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"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 08/60] trace: provide mechanism for registering trace events
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 08/60] trace: provide mechanism for registering trace events Daniel P. Berrange
@ 2016-08-09 16:17   ` Paolo Bonzini
  2016-08-09 16:18     ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Paolo Bonzini @ 2016-08-09 16:17 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Stefan Hajnoczi



On 09/08/2016 17:31, Daniel P. Berrange wrote:
> +    out('void trace_register_events(void)',
> +        '{',
> +        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT);',
> +        '}',
> +        'trace_init(trace_register_events)')

Should this function be static?

Paolo

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 08/60] trace: provide mechanism for registering trace events
  2016-08-09 16:17   ` Paolo Bonzini
@ 2016-08-09 16:18     ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 16:18 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Stefan Hajnoczi

On Tue, Aug 09, 2016 at 06:17:04PM +0200, Paolo Bonzini wrote:
> 
> 
> On 09/08/2016 17:31, Daniel P. Berrange wrote:
> > +    out('void trace_register_events(void)',
> > +        '{',
> > +        '    trace_event_register_group(trace_events, TRACE_EVENT_COUNT);',
> > +        '}',
> > +        'trace_init(trace_register_events)')
> 
> Should this function be static?

Yes it should be actually - left over from before I was using the
qemu-module support to register these.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs Daniel P. Berrange
@ 2016-08-09 16:18   ` Paolo Bonzini
  2016-08-09 16:24     ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Paolo Bonzini @ 2016-08-09 16:18 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Stefan Hajnoczi



On 09/08/2016 17:31, Daniel P. Berrange wrote:
> Since there will shortly be multiple event groups allowed,
> we can no longer use the TraceEventID and TraceEventVCPUID
> enums in the trace control APIs. There will in fact be
> multiple distinct enums, and the enum values will only be
> required to be unique per group.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  trace/control-internal.h | 14 +++++++-------
>  trace/control-target.c   |  6 +++---
>  trace/control.h          | 25 ++++++-------------------
>  trace/event-internal.h   |  4 ++--
>  trace/simple.c           |  6 +++---
>  trace/simple.h           |  2 +-
>  6 files changed, 22 insertions(+), 35 deletions(-)
> 
> diff --git a/trace/control-internal.h b/trace/control-internal.h
> index 634effe..b7048d4 100644
> --- a/trace/control-internal.h
> +++ b/trace/control-internal.h
> @@ -24,13 +24,13 @@ static inline bool trace_event_is_pattern(const char *str)
>      return strchr(str, '*') != NULL;
>  }
>  
> -static inline TraceEventID trace_event_get_id(TraceEvent *ev)
> +static inline size_t trace_event_get_id(TraceEvent *ev)
>  {
>      assert(ev != NULL);
>      return ev->id;

Perhaps "unsigned" is a better match than size_t?

Paolo

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs
  2016-08-09 16:18   ` Paolo Bonzini
@ 2016-08-09 16:24     ` Daniel P. Berrange
  2016-08-09 16:26       ` Paolo Bonzini
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 16:24 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Stefan Hajnoczi

On Tue, Aug 09, 2016 at 06:18:51PM +0200, Paolo Bonzini wrote:
> 
> 
> On 09/08/2016 17:31, Daniel P. Berrange wrote:
> > Since there will shortly be multiple event groups allowed,
> > we can no longer use the TraceEventID and TraceEventVCPUID
> > enums in the trace control APIs. There will in fact be
> > multiple distinct enums, and the enum values will only be
> > required to be unique per group.
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> >  trace/control-internal.h | 14 +++++++-------
> >  trace/control-target.c   |  6 +++---
> >  trace/control.h          | 25 ++++++-------------------
> >  trace/event-internal.h   |  4 ++--
> >  trace/simple.c           |  6 +++---
> >  trace/simple.h           |  2 +-
> >  6 files changed, 22 insertions(+), 35 deletions(-)
> > 
> > diff --git a/trace/control-internal.h b/trace/control-internal.h
> > index 634effe..b7048d4 100644
> > --- a/trace/control-internal.h
> > +++ b/trace/control-internal.h
> > @@ -24,13 +24,13 @@ static inline bool trace_event_is_pattern(const char *str)
> >      return strchr(str, '*') != NULL;
> >  }
> >  
> > -static inline TraceEventID trace_event_get_id(TraceEvent *ev)
> > +static inline size_t trace_event_get_id(TraceEvent *ev)
> >  {
> >      assert(ev != NULL);
> >      return ev->id;
> 
> Perhaps "unsigned" is a better match than size_t?

I don't mind either way - I just happen to personally always use size_t
for anything that ends up being used primarily as an array index.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs
  2016-08-09 16:24     ` Daniel P. Berrange
@ 2016-08-09 16:26       ` Paolo Bonzini
  2016-09-02 21:13         ` Stefan Hajnoczi
  0 siblings, 1 reply; 113+ messages in thread
From: Paolo Bonzini @ 2016-08-09 16:26 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi



On 09/08/2016 18:24, Daniel P. Berrange wrote:
>>> > > -static inline TraceEventID trace_event_get_id(TraceEvent *ev)
>>> > > +static inline size_t trace_event_get_id(TraceEvent *ev)
>>> > >  {
>>> > >      assert(ev != NULL);
>>> > >      return ev->id;
>> > 
>> > Perhaps "unsigned" is a better match than size_t?
> I don't mind either way - I just happen to personally always use size_t
> for anything that ends up being used primarily as an array index.

Makes sense.  I was thinking of simpletrace's 32-bit id instead.

Paolo

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (59 preceding siblings ...)
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach Daniel P. Berrange
@ 2016-08-09 17:03 ` no-reply
  2016-08-09 17:11   ` Daniel P. Berrange
  2016-08-10 14:05 ` Lluís Vilanova
                   ` (2 subsequent siblings)
  63 siblings, 1 reply; 113+ messages in thread
From: no-reply @ 2016-08-09 17:03 UTC (permalink / raw)
  To: berrange; +Cc: famz, qemu-devel, stefanha

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.

Message-id: 1470756748-18933-1-git-send-email-berrange@redhat.com
Type: series
Subject: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
make J=8 docker-test-quick@centos6

# we need CURL DPRINTF patch
# http://patchew.org/QEMU/1470027888-24381-1-git-send-email-famz%40redhat.com/
#make J=8 docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/1470756748-18933-1-git-send-email-berrange@redhat.com -> patchew/1470756748-18933-1-git-send-email-berrange@redhat.com
Switched to a new branch 'test'
f782d9f trace: update docs to reflect new code generation approach
8b58708 trace: remove the global include/trace.h file
19403bf trace: switch linux-user/ directory to modular trace.h file
0a68cb2 trace: switch qom/ directory to modular trace.h file
da8cde7 trace: switch target-ppc/ directory to modular trace.h file
172fdf5 trace: switch target-s390x/ directory to modular trace.h file
001334e trace: switch target-sparc/ directory to modular trace.h file
fbf7e8d trace: switch target-i386/ directory to modular trace.h file
5b3a404 trace: switch net/ directory to modular trace.h file
e4008a1 trace: switch audio/ directory to modular trace.h file
0d0c118 trace: switch ui/ directory to modular trace.h file
a424af5 trace: switch hw/alpha/ directory to modular trace.h file
6899dbc trace: switch hw/arm/ directory to modular trace.h file
698e90e trace: switch hw/acpi/ directory to modular trace.h file
6798bcb trace: switch hw/vfio/ directory to modular trace.h file
777af60 trace: switch hw/s390x/ directory to modular trace.h file
0d37f07 trace: switch hw/pci/ directory to modular trace.h file
8a745ba trace: switch hw/ppc/ directory to modular trace.h file
d315fff trace: switch hw/9pfs/ directory to modular trace.h file
200d752 trace: switch hw/i386/ directory to modular trace.h file
5963cc6 trace: switch hw/mem/ directory to modular trace.h file
3cd532b trace: switch hw/isa/ directory to modular trace.h file
6e0943c trace: switch hw/sd/ directory to modular trace.h file
d48f418 trace: switch hw/sparc/ directory to modular trace.h file
f30fb3c trace: switch hw/dma/ directory to modular trace.h file
aeff5ce trace: switch hw/timer/ directory to modular trace.h file
0a357f4 trace: switch hw/input/ directory to modular trace.h file
788e458 trace: switch hw/display/ directory to modular trace.h file
9e0ec18 trace: switch hw/nvram/ directory to modular trace.h file
f66d633 trace: switch hw/scsi/ directory to modular trace.h file
2c27a5c trace: switch hw/usb/ directory to modular trace.h file
c2c6a4a trace: switch hw/misc/ directory to modular trace.h file
5e51950 trace: switch hw/audio/ directory to modular trace.h file
24e7612 trace: switch hw/virtio/ directory to modular trace.h file
3f96b32 trace: switch hw/net/ directory to modular trace.h file
6cb5b07 trace: switch hw/intc/ directory to modular trace.h file
7138800 trace: switch hw/char/ directory to modular trace.h file
8e60ca5 trace: switch hw/block/ directory to modular trace.h file
ce95a93 trace: switch block/ directory to modular trace.h file
c1f9359 trace: switch migration/ directory to modular trace.h file
a9399ee trace: switch crypto/ directory to modular trace.h file
cf9d0b1 trace: switch util/ directory to modular trace.h file
b22e603 trace: switch io/ directory to modular trace.h file
b7dfca1 trace: introduce some Makefile rules for module code gen
eb94362 trace: introduce ID range offsets per trace-events file
5b37803 trace: introduce a formal group name for trace events
85db364 trace: get rid of generated-events.h/generated-events.c
b2a27bd trace: remove generated-events.h from many includes
08d783c3 trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value
3c2bc9c trace: remove use of event ID enums from APIs
35a51ca trace: remove fixed global event state arrays
584727d trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h
cc33976 trace: provide mechanism for registering trace events
832db43 trace: remove some now unused functions
59adbd8 trace: convert code to use event iterators
58f9e9d trace: add trace event iterator APIs
969db6a trace: move hw/virtio/virtio-balloon.c trace points into correct file
2a9286e trace: move hw/mem/pc-dimm.c trace points into correct file
b8fe348 trace: move util/qemu-coroutine*.c trace points into correct file
b4b74ca trace: move util/buffer.c trace points into correct file

=== 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
  ARCHIVE qemu.tgz
  ARCHIVE dtc.tgz
  COPY RUNNER
  RUN test-quick in centos6
No C++ compiler available; disabling C++ specific optional code
Install prefix    /tmp/qemu-test/src/tests/docker/install
BIOS directory    /tmp/qemu-test/src/tests/docker/install/share/qemu
binary directory  /tmp/qemu-test/src/tests/docker/install/bin
library directory /tmp/qemu-test/src/tests/docker/install/lib
module directory  /tmp/qemu-test/src/tests/docker/install/lib/qemu
libexec directory /tmp/qemu-test/src/tests/docker/install/libexec
include directory /tmp/qemu-test/src/tests/docker/install/include
config directory  /tmp/qemu-test/src/tests/docker/install/etc
local state directory   /tmp/qemu-test/src/tests/docker/install/var
Manual directory  /tmp/qemu-test/src/tests/docker/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 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -g 
QEMU_CFLAGS       -I/usr/include/pixman-1    -fPIE -DPIE -m64 -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  -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
RDMA support      no
TCG interpreter   no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
uuid support      no
libcap-ng support no
vhost-net support yes
vhost-scsi 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
GlusterFS support no
Archipelago support no
gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   yes
QOM debugging     yes
vhdx              no
lzo support       no
snappy support    no
bzip2 support     no
NUMA host support no
tcmalloc support  no
jemalloc support  no
avx2 optimization no
  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   x86_64-softmmu/config-devices.mak
  GEN   qapi-types.h
  GEN   qapi-visit.h
  GEN   aarch64-softmmu/config-devices.mak
  GEN   qapi-event.h
  GEN   qmp-introspect.h
  GEN   trace.h
  GEN   util/trace.h
  GEN   crypto/trace.h
  GEN   io/trace.h
  GEN   migration/trace.h
  GEN   block/trace.h
  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-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   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   trace.c
  GEN   audio/trace.c
  GEN   block/trace.c
  GEN   crypto/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   qom/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/qmp-input-visitor.o
  CC    qapi/qmp-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/compatfd.o
  CC    util/unicode.o
  CC    util/qemu-timer-common.o
  CC    util/event_notifier-posix.o
/tmp/qemu-test/src/trace/control.c: In function ‘trace_event_register_group’:
/tmp/qemu-test/src/trace/control.c:76: error: ‘for’ loop initial declarations are only allowed in C99 mode
/tmp/qemu-test/src/trace/control.c:76: note: use option -std=c99 or -std=gnu99 to compile your code
make: *** [trace/control.o] Error 1
make: *** Waiting for unfinished jobs....
  CC    util/mmap-alloc.o
tests/docker/Makefile.include:104: recipe for target 'docker-run-test-quick@centos6' failed
make: *** [docker-run-test-quick@centos6] Error 1
=== OUTPUT END ===

Test command exited with code: 2


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-09 17:03 ` [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files no-reply
@ 2016-08-09 17:11   ` Daniel P. Berrange
  2016-08-10  1:41     ` Fam Zheng
  2016-08-10  1:58     ` Fam Zheng
  0 siblings, 2 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-09 17:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: famz, stefanha

On Tue, Aug 09, 2016 at 10:03:49AM -0700, no-reply@ec2-52-6-146-230.compute-1.amazonaws.com 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
> locally.
> 
> Message-id: 1470756748-18933-1-git-send-email-berrange@redhat.com
> Type: series
> Subject: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> set -e
> git submodule update --init dtc
> make J=8 docker-test-quick@centos6
> 
> # we need CURL DPRINTF patch
> # http://patchew.org/QEMU/1470027888-24381-1-git-send-email-famz%40redhat.com/
> #make J=8 docker-test-mingw@fedora

[snip]

> === 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
>   ARCHIVE qemu.tgz
>   ARCHIVE dtc.tgz
>   COPY RUNNER
>   RUN test-quick in centos6

Can we get this report to include details of the

  a) the software versions of gcc, binutils, and any -devel packages
     we're building against

  b) the exact arguments + env variables used to invoke configure,
     not merely its output

so we don't have to go digging into the docker test systemm to
try and reverse engineer this info

> No C++ compiler available; disabling C++ specific optional code
> Install prefix    /tmp/qemu-test/src/tests/docker/install
> BIOS directory    /tmp/qemu-test/src/tests/docker/install/share/qemu
> binary directory  /tmp/qemu-test/src/tests/docker/install/bin
> library directory /tmp/qemu-test/src/tests/docker/install/lib
> module directory  /tmp/qemu-test/src/tests/docker/install/lib/qemu
> libexec directory /tmp/qemu-test/src/tests/docker/install/libexec
> include directory /tmp/qemu-test/src/tests/docker/install/include
> config directory  /tmp/qemu-test/src/tests/docker/install/etc
> local state directory   /tmp/qemu-test/src/tests/docker/install/var
> Manual directory  /tmp/qemu-test/src/tests/docker/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 -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -g 
> QEMU_CFLAGS       -I/usr/include/pixman-1    -fPIE -DPIE -m64 -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  -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
> RDMA support      no
> TCG interpreter   no
> fdt support       yes
> preadv support    yes
> fdatasync         yes
> madvise           yes
> posix_madvise     yes
> uuid support      no
> libcap-ng support no
> vhost-net support yes
> vhost-scsi 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
> GlusterFS support no
> Archipelago support no
> gcov              gcov
> gcov enabled      no
> TPM support       yes
> libssh2 support   no
> TPM passthrough   yes
> QOM debugging     yes
> vhdx              no
> lzo support       no
> snappy support    no
> bzip2 support     no
> NUMA host support no
> tcmalloc support  no
> jemalloc support  no
> avx2 optimization no

[snip]

>   CC    trace/control.o
>   CC    trace/qmp.o
>   CC    util/osdep.o
>   CC    util/cutils.o
>   CC    util/compatfd.o
>   CC    util/unicode.o
>   CC    util/qemu-timer-common.o
>   CC    util/event_notifier-posix.o
> /tmp/qemu-test/src/trace/control.c: In function ‘trace_event_register_group’:
> /tmp/qemu-test/src/trace/control.c:76: error: ‘for’ loop initial declarations are only allowed in C99 mode
> /tmp/qemu-test/src/trace/control.c:76: note: use option -std=c99 or -std=gnu99 to compile your code
> make: *** [trace/control.o] Error 1
> make: *** Waiting for unfinished jobs....
>   CC    util/mmap-alloc.o
> tests/docker/Makefile.include:104: recipe for target 'docker-run-test-quick@centos6' failed
> make: *** [docker-run-test-quick@centos6] Error 1
> === OUTPUT END ===


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-09 17:11   ` Daniel P. Berrange
@ 2016-08-10  1:41     ` Fam Zheng
  2016-08-10  8:06       ` Daniel P. Berrange
  2016-08-10  1:58     ` Fam Zheng
  1 sibling, 1 reply; 113+ messages in thread
From: Fam Zheng @ 2016-08-10  1:41 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, stefanha

On Tue, 08/09 18:11, Daniel P. Berrange wrote:
> 
> Can we get this report to include details of the
> 
>   a) the software versions of gcc, binutils, and any -devel packages
>      we're building against
> 
>   b) the exact arguments + env variables used to invoke configure,
>      not merely its output
> 
> so we don't have to go digging into the docker test systemm to
> try and reverse engineer this info

The whole point of docker test system is offer a relatively easy reproducer to
developers, so I'm reluctant to engineer patchew or the test script it runs for
that.

On the other hand, it's reasonable to allow the docker testing code to be more
verbose than currently.  Or maybe we can patch ./configure to output these
information?

Fam

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-09 17:11   ` Daniel P. Berrange
  2016-08-10  1:41     ` Fam Zheng
@ 2016-08-10  1:58     ` Fam Zheng
  1 sibling, 0 replies; 113+ messages in thread
From: Fam Zheng @ 2016-08-10  1:58 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, stefanha

On Tue, 08/09 18:11, Daniel P. Berrange wrote:
> so we don't have to go digging into the docker test systemm to
> try and reverse engineer this info

Actually, digging this info is pretty easy if you already use docker test
locally (if you don't, may I ask why?). Just append DEBUG=1 and you can mess
with things in the building env. Something like this

    $ make docker-test-quick@centos6 DEBUG=1

Then you'll be dropped in the shell that is all set up to run the build command.

Fam

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-10  1:41     ` Fam Zheng
@ 2016-08-10  8:06       ` Daniel P. Berrange
  2016-08-10  8:13         ` Fam Zheng
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-10  8:06 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, stefanha

On Wed, Aug 10, 2016 at 09:41:40AM +0800, Fam Zheng wrote:
> On Tue, 08/09 18:11, Daniel P. Berrange wrote:
> > 
> > Can we get this report to include details of the
> > 
> >   a) the software versions of gcc, binutils, and any -devel packages
> >      we're building against
> > 
> >   b) the exact arguments + env variables used to invoke configure,
> >      not merely its output
> > 
> > so we don't have to go digging into the docker test systemm to
> > try and reverse engineer this info
> 
> The whole point of docker test system is offer a relatively easy reproducer to
> developers, so I'm reluctant to engineer patchew or the test script it runs for
> that.

That's just pointlessly creating extra work for the developers reading
these build reports. If you outputted the info I suggest, it can help
developers diagnose the problems more quickly. Even if running the
docker env locally is possible & even easy, it doesn't make it faster
than reading the relevant info from email report in front of you.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-10  8:06       ` Daniel P. Berrange
@ 2016-08-10  8:13         ` Fam Zheng
  2016-08-10  8:24           ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Fam Zheng @ 2016-08-10  8:13 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, stefanha

On Wed, 08/10 09:06, Daniel P. Berrange wrote:
> On Wed, Aug 10, 2016 at 09:41:40AM +0800, Fam Zheng wrote:
> > On Tue, 08/09 18:11, Daniel P. Berrange wrote:
> > > 
> > > Can we get this report to include details of the
> > > 
> > >   a) the software versions of gcc, binutils, and any -devel packages
> > >      we're building against
> > > 
> > >   b) the exact arguments + env variables used to invoke configure,
> > >      not merely its output
> > > 
> > > so we don't have to go digging into the docker test systemm to
> > > try and reverse engineer this info
> > 
> > The whole point of docker test system is offer a relatively easy reproducer to
> > developers, so I'm reluctant to engineer patchew or the test script it runs for
> > that.
> 
> That's just pointlessly creating extra work for the developers reading
> these build reports. If you outputted the info I suggest, it can help
> developers diagnose the problems more quickly. Even if running the
> docker env locally is possible & even easy, it doesn't make it faster
> than reading the relevant info from email report in front of you.

I agree with your point, I just don't know how to do a) neatly, except for a
vast change to configure.

Fam

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-10  8:13         ` Fam Zheng
@ 2016-08-10  8:24           ` Daniel P. Berrange
  2016-08-10  8:39             ` Fam Zheng
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-10  8:24 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, stefanha

On Wed, Aug 10, 2016 at 04:13:10PM +0800, Fam Zheng wrote:
> On Wed, 08/10 09:06, Daniel P. Berrange wrote:
> > On Wed, Aug 10, 2016 at 09:41:40AM +0800, Fam Zheng wrote:
> > > On Tue, 08/09 18:11, Daniel P. Berrange wrote:
> > > > 
> > > > Can we get this report to include details of the
> > > > 
> > > >   a) the software versions of gcc, binutils, and any -devel packages
> > > >      we're building against
> > > > 
> > > >   b) the exact arguments + env variables used to invoke configure,
> > > >      not merely its output
> > > > 
> > > > so we don't have to go digging into the docker test systemm to
> > > > try and reverse engineer this info
> > > 
> > > The whole point of docker test system is offer a relatively easy reproducer to
> > > developers, so I'm reluctant to engineer patchew or the test script it runs for
> > > that.
> > 
> > That's just pointlessly creating extra work for the developers reading
> > these build reports. If you outputted the info I suggest, it can help
> > developers diagnose the problems more quickly. Even if running the
> > docker env locally is possible & even easy, it doesn't make it faster
> > than reading the relevant info from email report in front of you.
> 
> I agree with your point, I just don't know how to do a) neatly, except for a
> vast change to configure.

Why do you need todo it in configure ?  I was thinking your docker receipe
that invokes configure could just do it - not least because the commands to
run to get the data will be different based on which distro you're running
in the docker image in question.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-10  8:24           ` Daniel P. Berrange
@ 2016-08-10  8:39             ` Fam Zheng
  2016-08-10  8:50               ` Daniel P. Berrange
  2016-08-10 15:54               ` Paolo Bonzini
  0 siblings, 2 replies; 113+ messages in thread
From: Fam Zheng @ 2016-08-10  8:39 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, stefanha

On Wed, 08/10 09:24, Daniel P. Berrange wrote:
> On Wed, Aug 10, 2016 at 04:13:10PM +0800, Fam Zheng wrote:
> > On Wed, 08/10 09:06, Daniel P. Berrange wrote:
> > > On Wed, Aug 10, 2016 at 09:41:40AM +0800, Fam Zheng wrote:
> > > > On Tue, 08/09 18:11, Daniel P. Berrange wrote:
> > > > > 
> > > > > Can we get this report to include details of the
> > > > > 
> > > > >   a) the software versions of gcc, binutils, and any -devel packages
> > > > >      we're building against
> > > > > 
> > > > >   b) the exact arguments + env variables used to invoke configure,
> > > > >      not merely its output
> > > > > 
> > > > > so we don't have to go digging into the docker test systemm to
> > > > > try and reverse engineer this info
> > > > 
> > > > The whole point of docker test system is offer a relatively easy reproducer to
> > > > developers, so I'm reluctant to engineer patchew or the test script it runs for
> > > > that.
> > > 
> > > That's just pointlessly creating extra work for the developers reading
> > > these build reports. If you outputted the info I suggest, it can help
> > > developers diagnose the problems more quickly. Even if running the
> > > docker env locally is possible & even easy, it doesn't make it faster
> > > than reading the relevant info from email report in front of you.
> > 
> > I agree with your point, I just don't know how to do a) neatly, except for a
> > vast change to configure.
> 
> Why do you need todo it in configure ?  I was thinking your docker receipe
> that invokes configure could just do it - not least because the commands to
> run to get the data will be different based on which distro you're running
> in the docker image in question.

Then the script needs to be updated to work with different package management
systems (rpm and deb). For now they only call standard Linux commands.  That's
least of the problem, though.

The more tricky question is how the script can tell which packages are relevant
(or, used). I assume the number of packages in a docker image is quite limited
(fedora has 396, ubuntu 574), but dumping the whole list is still noisy
nevertheless. Also, depending on the configure option, a submodule can be used
instead, or a local built library. Not that we have a lot of these now, but
it's a factor of complication.

On the other hand, configure knows when to use pkg-config --modversion, or git
describe, or something else, depending on how and where it discovers the
compiler and -devel libs etc..

Fam

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-10  8:39             ` Fam Zheng
@ 2016-08-10  8:50               ` Daniel P. Berrange
  2016-08-10 15:54               ` Paolo Bonzini
  1 sibling, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-10  8:50 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, stefanha

On Wed, Aug 10, 2016 at 04:39:21PM +0800, Fam Zheng wrote:
> On Wed, 08/10 09:24, Daniel P. Berrange wrote:
> > On Wed, Aug 10, 2016 at 04:13:10PM +0800, Fam Zheng wrote:
> > > On Wed, 08/10 09:06, Daniel P. Berrange wrote:
> > > > On Wed, Aug 10, 2016 at 09:41:40AM +0800, Fam Zheng wrote:
> > > > > On Tue, 08/09 18:11, Daniel P. Berrange wrote:
> > > > > > 
> > > > > > Can we get this report to include details of the
> > > > > > 
> > > > > >   a) the software versions of gcc, binutils, and any -devel packages
> > > > > >      we're building against
> > > > > > 
> > > > > >   b) the exact arguments + env variables used to invoke configure,
> > > > > >      not merely its output
> > > > > > 
> > > > > > so we don't have to go digging into the docker test systemm to
> > > > > > try and reverse engineer this info
> > > > > 
> > > > > The whole point of docker test system is offer a relatively easy reproducer to
> > > > > developers, so I'm reluctant to engineer patchew or the test script it runs for
> > > > > that.
> > > > 
> > > > That's just pointlessly creating extra work for the developers reading
> > > > these build reports. If you outputted the info I suggest, it can help
> > > > developers diagnose the problems more quickly. Even if running the
> > > > docker env locally is possible & even easy, it doesn't make it faster
> > > > than reading the relevant info from email report in front of you.
> > > 
> > > I agree with your point, I just don't know how to do a) neatly, except for a
> > > vast change to configure.
> > 
> > Why do you need todo it in configure ?  I was thinking your docker receipe
> > that invokes configure could just do it - not least because the commands to
> > run to get the data will be different based on which distro you're running
> > in the docker image in question.
> 
> Then the script needs to be updated to work with different package management
> systems (rpm and deb). For now they only call standard Linux commands.  That's
> least of the problem, though.
> 
> The more tricky question is how the script can tell which packages are relevant
> (or, used). I assume the number of packages in a docker image is quite limited
> (fedora has 396, ubuntu 574), but dumping the whole list is still noisy
> nevertheless. Also, depending on the configure option, a submodule can be used
> instead, or a local built library. Not that we have a lot of these now, but
> it's a factor of complication.
> 
> On the other hand, configure knows when to use pkg-config --modversion, or git
> describe, or something else, depending on how and where it discovers the
> compiler and -devel libs etc..

In the tests/docker/dockerfiles/*.docker files you install a bunch of
RPMs we build against. I was just thinking to report versions of those
particular RPMs.

IIt would be sufficient if you just captured the output of the
'dnf install' command (or equivalent) to, say /tmp/installed.txt.
Then have build_qemu() in common.rc simply cat /tmp/installed.txt
before running configure. That way all the distro-specific bits
stay in the *.docker files.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays Daniel P. Berrange
@ 2016-08-10 14:00   ` Lluís Vilanova
  2016-08-10 14:47     ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-08-10 14:00 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:
[...]
> diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
> index 9203377..bab6404 100644
> --- a/scripts/tracetool/format/events_c.py
> +++ b/scripts/tracetool/format/events_c.py
> @@ -25,7 +25,10 @@ def generate(events, backend):
>          '#include "trace/control.h"',
>          '')
 
> -    out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
> +    out('uint16_t dstate[TRACE_EVENT_COUNT];')
> +    out('bool dstate_init[TRACE_EVENT_COUNT];')
> +
> +    out('static TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
 
>      for e in events:
>          if "vcpu" in e.properties:

I'd rather keep them as 'trace_events_dstate' and 'trace_events_dstate_init' if
most references are auto-generated. Or maybe I just missed something.

Also, maybe we should just try to get rid of the dstate_init structure. Only
vcpu events need late initialization, which could be something like:

   trace_events_enabled_count--;
   dstate[ev->id]--;
   trace_event_set_state_dynamic(dstate, ev, true);

Non-vcpu events shouldn't need late initialization.


[...]
> diff --git a/stubs/trace-control.c b/stubs/trace-control.c
> index fe59836..31566c2 100644
> --- a/stubs/trace-control.c
> +++ b/stubs/trace-control.c
> @@ -11,16 +11,12 @@
>  #include "trace/control.h"
 
 
> -void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
> +void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev, bool state)
>  {
> -    TraceEventID id;
>      assert(trace_event_get_state_static(ev));
> -    id = trace_event_get_id(ev);
> -    trace_events_enabled_count += state - trace_events_dstate[id];
> -    trace_events_dstate[id] = state;
>  }

Should not be empty (here, stub means it's not target code).


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (60 preceding siblings ...)
  2016-08-09 17:03 ` [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files no-reply
@ 2016-08-10 14:05 ` Lluís Vilanova
  2016-08-10 14:52   ` Daniel P. Berrange
  2016-09-08 13:23 ` Lluís Vilanova
  2016-09-13 14:54 ` Stefan Hajnoczi
  63 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-08-10 14:05 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> I previously split the global trace-events file up into one file
> per-subdirectory to avoid merge conflict hell.

> This series builds on that to now actually generate the individual
> trace files per-subdirectory too. The key benefit of doing this is
> that a change in a trace-events file will no longer cause a rebuild
> of the entire world. Instead only that one affected sub-directory
> will have files rebuilt.

Is re-compilation time worth the effort?


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen Daniel P. Berrange
@ 2016-08-10 14:18   ` Lluís Vilanova
  2016-08-10 14:48     ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-08-10 14:18 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:
[...]
> diff --git a/Makefile b/Makefile
> index 48673cb..2b9ba60 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -70,9 +70,55 @@ 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 += $(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) \
> +		--group=$(shell dirname $@ | tr /- _) \
> +		< $< > $@,"  GEN   $@")
> +
> +%/trace.c: $(SRC_PATH)/%/trace-events $(tracetool-y)
> +	$(call quiet-command,$(TRACETOOL) \
> +		--format=c \
> +		--backends=$(TRACE_BACKENDS) \
> +		--group=$(shell dirname $@ | tr /- _) \
> +		< $< > $@,"  GEN   $@")
> +
> +%/trace-ust.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
> +	$(call quiet-command,$(TRACETOOL) \
> +		--format=ust-events-h \
> +		--backends=$(TRACE_BACKENDS) \
> +		--group=$(shell dirname $@ | tr /- _) \
> +		< $< > $@,"  GEN   $@")
> +
> +%/trace-dtrace.dtrace: $(SRC_PATH)/%/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
> +	$(call quiet-command,$(TRACETOOL) \
> +		--format=d \
> +		--backends=$(TRACE_BACKENDS) \
> +		--group=$(shell dirname $@ | tr /- _) \
> +		< $< > $@,"  GEN   $@")
> +
> +%/trace-dtrace.h: %/trace-dtrace.dtrace $(tracetool-y)
> +	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
> +
> +%/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
> +
> +
>  # Don't try to regenerate Makefile or configure
>  # We don't generate any of them
>  Makefile: ;

I'd rather keep the "generated-" prefix on all files that usually are not
directly included by QEMU developers.


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach Daniel P. Berrange
@ 2016-08-10 14:33   ` Lluís Vilanova
  2016-08-10 14:51     ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-08-10 14:33 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

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

> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
>  1 file changed, 52 insertions(+), 9 deletions(-)

> diff --git a/docs/tracing.txt b/docs/tracing.txt
> index 29f2f9a..b7ba179 100644
> --- a/docs/tracing.txt
> +++ b/docs/tracing.txt
> @@ -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 extra fun the current "trace-events" files use values from the
> +"powerful number" integer sequence :-)

Can we get rid of the "@id_offset(NN)"? If we're generating a trace-events-all
all the same, we can use that to generate all the per-directory file *and* still
keep the simpler flat event ids.

For example, first we concatenate /trace-events, /io/trace-events and
/hw/usb/trace-events into /trace-events-all to produce:

   @group core
   @dir /
   # contents of /trace-events
   @group io
   @dir /io
   # contents of /io/trace-events
   @group hw_usb
   @dir /hw/usb
   # contents of /hw/usb/trace-events

Then we can use /trace-events-all to generate all the per-directory trace.h
files while ensuring a perfectly flat event identifier space (a single
generated-events.c is used).

This should minimize changes to tracing code and avoid further restrictions
(like the "top-level vcpu" one).


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays
  2016-08-10 14:00   ` Lluís Vilanova
@ 2016-08-10 14:47     ` Daniel P. Berrange
  2016-08-10 16:13       ` Lluís Vilanova
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-10 14:47 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Wed, Aug 10, 2016 at 04:00:17PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> [...]
> > diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
> > index 9203377..bab6404 100644
> > --- a/scripts/tracetool/format/events_c.py
> > +++ b/scripts/tracetool/format/events_c.py
> > @@ -25,7 +25,10 @@ def generate(events, backend):
> >          '#include "trace/control.h"',
> >          '')
>  
> > -    out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
> > +    out('uint16_t dstate[TRACE_EVENT_COUNT];')
> > +    out('bool dstate_init[TRACE_EVENT_COUNT];')
> > +
> > +    out('static TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
>  
> >      for e in events:
> >          if "vcpu" in e.properties:
> 
> I'd rather keep them as 'trace_events_dstate' and 'trace_events_dstate_init' if
> most references are auto-generated. Or maybe I just missed something.

Later patches rename this again, giving it a custom prefix for each
group

> Also, maybe we should just try to get rid of the dstate_init structure. Only
> vcpu events need late initialization, which could be something like:
> 
>    trace_events_enabled_count--;
>    dstate[ev->id]--;
>    trace_event_set_state_dynamic(dstate, ev, true);
> 
> Non-vcpu events shouldn't need late initialization.

I'd rather not try to refactor that logic at the same time - it could
be done as a later patch, or if you want to submit a patch to fix that
I can rebase on top of it.

> [...]
> > diff --git a/stubs/trace-control.c b/stubs/trace-control.c
> > index fe59836..31566c2 100644
> > --- a/stubs/trace-control.c
> > +++ b/stubs/trace-control.c
> > @@ -11,16 +11,12 @@
> >  #include "trace/control.h"
>  
>  
> > -void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
> > +void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev, bool state)
> >  {
> > -    TraceEventID id;
> >      assert(trace_event_get_state_static(ev));
> > -    id = trace_event_get_id(ev);
> > -    trace_events_enabled_count += state - trace_events_dstate[id];
> > -    trace_events_dstate[id] = state;
> >  }
> 
> Should not be empty (here, stub means it's not target code).

Oh hmm, for qemu-img & friends, i geuss

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen
  2016-08-10 14:18   ` Lluís Vilanova
@ 2016-08-10 14:48     ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-10 14:48 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Wed, Aug 10, 2016 at 04:18:44PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> [...]
> > diff --git a/Makefile b/Makefile
> > index 48673cb..2b9ba60 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -70,9 +70,55 @@ 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 += $(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) \
> > +		--group=$(shell dirname $@ | tr /- _) \
> > +		< $< > $@,"  GEN   $@")
> > +
> > +%/trace.c: $(SRC_PATH)/%/trace-events $(tracetool-y)
> > +	$(call quiet-command,$(TRACETOOL) \
> > +		--format=c \
> > +		--backends=$(TRACE_BACKENDS) \
> > +		--group=$(shell dirname $@ | tr /- _) \
> > +		< $< > $@,"  GEN   $@")
> > +
> > +%/trace-ust.h: $(SRC_PATH)/%/trace-events $(tracetool-y)
> > +	$(call quiet-command,$(TRACETOOL) \
> > +		--format=ust-events-h \
> > +		--backends=$(TRACE_BACKENDS) \
> > +		--group=$(shell dirname $@ | tr /- _) \
> > +		< $< > $@,"  GEN   $@")
> > +
> > +%/trace-dtrace.dtrace: $(SRC_PATH)/%/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
> > +	$(call quiet-command,$(TRACETOOL) \
> > +		--format=d \
> > +		--backends=$(TRACE_BACKENDS) \
> > +		--group=$(shell dirname $@ | tr /- _) \
> > +		< $< > $@,"  GEN   $@")
> > +
> > +%/trace-dtrace.h: %/trace-dtrace.dtrace $(tracetool-y)
> > +	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
> > +
> > +%/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
> > +
> > +
> >  # Don't try to regenerate Makefile or configure
> >  # We don't generate any of them
> >  Makefile: ;
> 
> I'd rather keep the "generated-" prefix on all files that usually are not
> directly included by QEMU developers.

I don't think that's really needed - all these files are in sub-dirs
now and its a clear rule that  trace*.[hc] is auto-generated in every
sub-dir now. Also no oither code in QEMU thats auto-generated adds
this prefix on so trace is inconsistent with practice elsewhere.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-08-10 14:33   ` Lluís Vilanova
@ 2016-08-10 14:51     ` Daniel P. Berrange
  2016-08-10 16:11       ` Lluís Vilanova
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-10 14:51 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Wed, Aug 10, 2016 at 04:33:47PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > Describe use of per-subdir trace events files and how it impacts
> > code generation.
> 
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> >  docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
> >  1 file changed, 52 insertions(+), 9 deletions(-)
> 
> > diff --git a/docs/tracing.txt b/docs/tracing.txt
> > index 29f2f9a..b7ba179 100644
> > --- a/docs/tracing.txt
> > +++ b/docs/tracing.txt
> > @@ -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 extra fun the current "trace-events" files use values from the
> > +"powerful number" integer sequence :-)
> 
> Can we get rid of the "@id_offset(NN)"? If we're generating a trace-events-all
> all the same, we can use that to generate all the per-directory file *and* still
> keep the simpler flat event ids.

One thing that occurred to me is that we could take a hash of the
group name. Since we have few enough sub-dirs / groups, and a large
enough ID space, it ought to be possible to get a hash which is
unique. The trace tool can double check that all groups get a unique
hash

> For example, first we concatenate /trace-events, /io/trace-events and
> /hw/usb/trace-events into /trace-events-all to produce:
> 
>    @group core
>    @dir /
>    # contents of /trace-events
>    @group io
>    @dir /io
>    # contents of /io/trace-events
>    @group hw_usb
>    @dir /hw/usb
>    # contents of /hw/usb/trace-events
> 
> Then we can use /trace-events-all to generate all the per-directory trace.h
> files while ensuring a perfectly flat event identifier space (a single
> generated-events.c is used).
> 
> This should minimize changes to tracing code and avoid further restrictions
> (like the "top-level vcpu" one).

That means when any individual trace file is changed, we re-generate the
world, which is exactly what this series is designed to avoid.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-10 14:05 ` Lluís Vilanova
@ 2016-08-10 14:52   ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-10 14:52 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Wed, Aug 10, 2016 at 04:05:06PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > I previously split the global trace-events file up into one file
> > per-subdirectory to avoid merge conflict hell.
> 
> > This series builds on that to now actually generate the individual
> > trace files per-subdirectory too. The key benefit of doing this is
> > that a change in a trace-events file will no longer cause a rebuild
> > of the entire world. Instead only that one affected sub-directory
> > will have files rebuilt.
> 
> Is re-compilation time worth the effort?

Absolutely yes, especially if you have build for multiple targets
enabled. Rebuilding all files when you have all 30+ targets enabled
takes an incredibly long time.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-10  8:39             ` Fam Zheng
  2016-08-10  8:50               ` Daniel P. Berrange
@ 2016-08-10 15:54               ` Paolo Bonzini
  1 sibling, 0 replies; 113+ messages in thread
From: Paolo Bonzini @ 2016-08-10 15:54 UTC (permalink / raw)
  To: Fam Zheng, Daniel P. Berrange; +Cc: qemu-devel, stefanha



On 10/08/2016 10:39, Fam Zheng wrote:
> Then the script needs to be updated to work with different package management
> systems (rpm and deb). For now they only call standard Linux commands.  That's
> least of the problem, though.
> 
> The more tricky question is how the script can tell which packages are relevant
> (or, used). I assume the number of packages in a docker image is quite limited
> (fedora has 396, ubuntu 574), but dumping the whole list is still noisy
> nevertheless. Also, depending on the configure option, a submodule can be used
> instead, or a local built library. Not that we have a lot of these now, but
> it's a factor of complication.
> 
> On the other hand, configure knows when to use pkg-config --modversion, or git
> describe, or something else, depending on how and where it discovers the
> compiler and -devel libs etc..

Can you include a description of how to reproduce with "make
docker-test-FOO@BAR DEBUG=1"?

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-08-10 14:51     ` Daniel P. Berrange
@ 2016-08-10 16:11       ` Lluís Vilanova
  2016-08-11  8:13         ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-08-10 16:11 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Wed, Aug 10, 2016 at 04:33:47PM +0200, Lluís Vilanova wrote:
>> Daniel P Berrange writes:
>> 
>> > Describe use of per-subdir trace events files and how it impacts
>> > code generation.
>> 
>> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
>> > ---
>> >  docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
>> >  1 file changed, 52 insertions(+), 9 deletions(-)
>> 
>> > diff --git a/docs/tracing.txt b/docs/tracing.txt
>> > index 29f2f9a..b7ba179 100644
>> > --- a/docs/tracing.txt
>> > +++ b/docs/tracing.txt
>> > @@ -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 extra fun the current "trace-events" files use values from the
>> > +"powerful number" integer sequence :-)
>> 
>> Can we get rid of the "@id_offset(NN)"? If we're generating a trace-events-all
>> all the same, we can use that to generate all the per-directory file *and* still
>> keep the simpler flat event ids.

> One thing that occurred to me is that we could take a hash of the
> group name. Since we have few enough sub-dirs / groups, and a large
> enough ID space, it ought to be possible to get a hash which is
> unique. The trace tool can double check that all groups get a unique
> hash

Eliminating "@id_offset" is nice, but I would prefer to eliminate the event
hierarchy too.


>> For example, first we concatenate /trace-events, /io/trace-events and
>> /hw/usb/trace-events into /trace-events-all to produce:
>> 
>> @group core
>> @dir /
>> # contents of /trace-events
>> @group io
>> @dir /io
>> # contents of /io/trace-events
>> @group hw_usb
>> @dir /hw/usb
>> # contents of /hw/usb/trace-events
>> 
>> Then we can use /trace-events-all to generate all the per-directory trace.h
>> files while ensuring a perfectly flat event identifier space (a single
>> generated-events.c is used).
>> 
>> This should minimize changes to tracing code and avoid further restrictions
>> (like the "top-level vcpu" one).

> That means when any individual trace file is changed, we re-generate the
> world, which is exactly what this series is designed to avoid.

Nope. We re-generate /trace-events-all, but each individual file generated
afterwards (taken from the "@dir" directive) will change only if its new
contents do (the Makefile uses cmp to check if files need updating from their
corresponding timestamp file).


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays
  2016-08-10 14:47     ` Daniel P. Berrange
@ 2016-08-10 16:13       ` Lluís Vilanova
  0 siblings, 0 replies; 113+ messages in thread
From: Lluís Vilanova @ 2016-08-10 16:13 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Wed, Aug 10, 2016 at 04:00:17PM +0200, Lluís Vilanova wrote:
>> Daniel P Berrange writes:
>> [...]
>> > diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
>> > index 9203377..bab6404 100644
>> > --- a/scripts/tracetool/format/events_c.py
>> > +++ b/scripts/tracetool/format/events_c.py
>> > @@ -25,7 +25,10 @@ def generate(events, backend):
>> >          '#include "trace/control.h"',
>> >          '')
>> 
>> > -    out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
>> > +    out('uint16_t dstate[TRACE_EVENT_COUNT];')
>> > +    out('bool dstate_init[TRACE_EVENT_COUNT];')
>> > +
>> > +    out('static TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
>> 
>> >      for e in events:
>> >          if "vcpu" in e.properties:
>> 
>> I'd rather keep them as 'trace_events_dstate' and 'trace_events_dstate_init' if
>> most references are auto-generated. Or maybe I just missed something.

> Later patches rename this again, giving it a custom prefix for each
> group

I saw them later, sorry. But I still think these too should be renamed, to make
it clear it's related to tracing.


>> Also, maybe we should just try to get rid of the dstate_init structure. Only
>> vcpu events need late initialization, which could be something like:
>> 
>> trace_events_enabled_count--;
>> dstate[ev->id]--;
>> trace_event_set_state_dynamic(dstate, ev, true);
>> 
>> Non-vcpu events shouldn't need late initialization.

> I'd rather not try to refactor that logic at the same time - it could
> be done as a later patch, or if you want to submit a patch to fix that
> I can rebase on top of it.

I can do that.


>> [...]
>> > diff --git a/stubs/trace-control.c b/stubs/trace-control.c
>> > index fe59836..31566c2 100644
>> > --- a/stubs/trace-control.c
>> > +++ b/stubs/trace-control.c
>> > @@ -11,16 +11,12 @@
>> >  #include "trace/control.h"
>> 
>> 
>> > -void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
>> > +void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev, bool state)
>> >  {
>> > -    TraceEventID id;
>> >      assert(trace_event_get_state_static(ev));
>> > -    id = trace_event_get_id(ev);
>> > -    trace_events_enabled_count += state - trace_events_dstate[id];
>> > -    trace_events_dstate[id] = state;
>> >  }
>> 
>> Should not be empty (here, stub means it's not target code).

> Oh hmm, for qemu-img & friends, i geuss

Exactly.


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-08-10 16:11       ` Lluís Vilanova
@ 2016-08-11  8:13         ` Daniel P. Berrange
  2016-08-11 10:11           ` Lluís Vilanova
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-08-11  8:13 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Wed, Aug 10, 2016 at 06:11:24PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > On Wed, Aug 10, 2016 at 04:33:47PM +0200, Lluís Vilanova wrote:
> >> Daniel P Berrange writes:
> >> 
> >> > Describe use of per-subdir trace events files and how it impacts
> >> > code generation.
> >> 
> >> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> >> > ---
> >> >  docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++---------
> >> >  1 file changed, 52 insertions(+), 9 deletions(-)
> >> 
> >> > diff --git a/docs/tracing.txt b/docs/tracing.txt
> >> > index 29f2f9a..b7ba179 100644
> >> > --- a/docs/tracing.txt
> >> > +++ b/docs/tracing.txt
> >> > @@ -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 extra fun the current "trace-events" files use values from the
> >> > +"powerful number" integer sequence :-)
> >> 
> >> Can we get rid of the "@id_offset(NN)"? If we're generating a trace-events-all
> >> all the same, we can use that to generate all the per-directory file *and* still
> >> keep the simpler flat event ids.
> 
> > One thing that occurred to me is that we could take a hash of the
> > group name. Since we have few enough sub-dirs / groups, and a large
> > enough ID space, it ought to be possible to get a hash which is
> > unique. The trace tool can double check that all groups get a unique
> > hash
> 
> Eliminating "@id_offset" is nice, but I would prefer to eliminate the event
> hierarchy too.

Having the event groups is the only way to avoid re-numbering all events
when a new one is added.

> >> For example, first we concatenate /trace-events, /io/trace-events and
> >> /hw/usb/trace-events into /trace-events-all to produce:
> >> 
> >> @group core
> >> @dir /
> >> # contents of /trace-events
> >> @group io
> >> @dir /io
> >> # contents of /io/trace-events
> >> @group hw_usb
> >> @dir /hw/usb
> >> # contents of /hw/usb/trace-events
> >> 
> >> Then we can use /trace-events-all to generate all the per-directory trace.h
> >> files while ensuring a perfectly flat event identifier space (a single
> >> generated-events.c is used).
> >> 
> >> This should minimize changes to tracing code and avoid further restrictions
> >> (like the "top-level vcpu" one).
> 
> > That means when any individual trace file is changed, we re-generate the
> > world, which is exactly what this series is designed to avoid.
> 
> Nope. We re-generate /trace-events-all, but each individual file generated
> afterwards (taken from the "@dir" directive) will change only if its new
> contents do (the Makefile uses cmp to check if files need updating from their
> corresponding timestamp file).

The contents will still need to change too if we have a global numbering
space as your suggestion requires. The event groups are the only way to
avoid that.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-08-11  8:13         ` Daniel P. Berrange
@ 2016-08-11 10:11           ` Lluís Vilanova
  2016-09-02 21:24             ` Stefan Hajnoczi
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-08-11 10:11 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Wed, Aug 10, 2016 at 06:11:24PM +0200, Lluís Vilanova wrote:
>> Daniel P Berrange writes:
>> 
>> > On Wed, Aug 10, 2016 at 04:33:47PM +0200, Lluís Vilanova wrote:
>> >> Daniel P Berrange writes:
[...]
>> >> For example, first we concatenate /trace-events, /io/trace-events and
>> >> /hw/usb/trace-events into /trace-events-all to produce:
>> >> 
>> >> @group core
>> >> @dir /
>> >> # contents of /trace-events
>> >> @group io
>> >> @dir /io
>> >> # contents of /io/trace-events
>> >> @group hw_usb
>> >> @dir /hw/usb
>> >> # contents of /hw/usb/trace-events
>> >> 
>> >> Then we can use /trace-events-all to generate all the per-directory trace.h
>> >> files while ensuring a perfectly flat event identifier space (a single
>> >> generated-events.c is used).
>> >> 
>> >> This should minimize changes to tracing code and avoid further restrictions
>> >> (like the "top-level vcpu" one).
>> 
>> > That means when any individual trace file is changed, we re-generate the
>> > world, which is exactly what this series is designed to avoid.
>> 
>> Nope. We re-generate /trace-events-all, but each individual file generated
>> afterwards (taken from the "@dir" directive) will change only if its new
>> contents do (the Makefile uses cmp to check if files need updating from their
>> corresponding timestamp file).

> The contents will still need to change too if we have a global numbering
> space as your suggestion requires. The event groups are the only way to
> avoid that.

Aha, that's true. I didn't think of that, sorry.


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 05/60] trace: add trace event iterator APIs
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 05/60] trace: add trace event iterator APIs Daniel P. Berrange
@ 2016-09-02 20:52   ` Stefan Hajnoczi
  2016-09-14 12:32     ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Stefan Hajnoczi @ 2016-09-02 20:52 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

On Tue, Aug 09, 2016 at 04:31:33PM +0100, Daniel P. Berrange wrote:
> +TraceEvent *trace_event_iter_next(TraceEventIter *iter)
> +{
> +    TraceEvent *ev;
> +
> +    if (iter->event >= TRACE_EVENT_COUNT) {
> +        return NULL;
> +    }
> +
> +    ev = &(trace_events[iter->event]);
> +
> +    do {
> +        iter->event++;
> +    } while (iter->event < TRACE_EVENT_COUNT &&
> +             iter->pattern &&
> +             !pattern_glob(iter->pattern,
> +                           trace_event_get_name(&(trace_events[iter->event]))));
> +
> +    return ev;
> +}

Shouldn't ev be updated inside the while loop?  Otherwise the iterator
always returns &trace_events[0] the first time it's called.

A doc comment would help clarify the intended semantics of
trace_event_iter_next().

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 06/60] trace: convert code to use event iterators
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 06/60] trace: convert code to use event iterators Daniel P. Berrange
@ 2016-09-02 20:55   ` Stefan Hajnoczi
  0 siblings, 0 replies; 113+ messages in thread
From: Stefan Hajnoczi @ 2016-09-02 20:55 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

On Tue, Aug 09, 2016 at 04:31:34PM +0100, Daniel P. Berrange wrote:
> This converts the HMP/QMP monitor API implementations
> and some internal trace control methods to use the new
> trace event iterator APIs.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  monitor.c       | 16 ++++++----
>  trace/control.c | 92 +++++++++++++++++++++++++++++++++------------------------
>  trace/qmp.c     | 16 ++++++----
>  3 files changed, 73 insertions(+), 51 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 09/60] trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 09/60] trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h Daniel P. Berrange
@ 2016-09-02 21:03   ` Stefan Hajnoczi
  0 siblings, 0 replies; 113+ messages in thread
From: Stefan Hajnoczi @ 2016-09-02 21:03 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

On Tue, Aug 09, 2016 at 04:31:37PM +0100, Daniel P. Berrange wrote:
> +/* Keep this a multiple of 8, or better yet a multiple
> + * of the platform word size, since the struct
> + * will be padded out to that regardless.
> + */
> +#define TRACE_MAX_VCPU_EVENT 32

Hard-coding this is awkward.  Can it be generated by tracetool at build
time so the bitmap is always large enough without manually bumping this
definition?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs
  2016-08-09 16:26       ` Paolo Bonzini
@ 2016-09-02 21:13         ` Stefan Hajnoczi
  2016-09-14 12:32           ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Stefan Hajnoczi @ 2016-09-02 21:13 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Daniel P. Berrange, qemu-devel, Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

On Tue, Aug 09, 2016 at 06:26:49PM +0200, Paolo Bonzini wrote:
> 
> 
> On 09/08/2016 18:24, Daniel P. Berrange wrote:
> >>> > > -static inline TraceEventID trace_event_get_id(TraceEvent *ev)
> >>> > > +static inline size_t trace_event_get_id(TraceEvent *ev)
> >>> > >  {
> >>> > >      assert(ev != NULL);
> >>> > >      return ev->id;
> >> > 
> >> > Perhaps "unsigned" is a better match than size_t?
> > I don't mind either way - I just happen to personally always use size_t
> > for anything that ends up being used primarily as an array index.
> 
> Makes sense.  I was thinking of simpletrace's 32-bit id instead.

I think unsigned is slightly clearer since it expresses the intent that
the values are limited to 32 bits.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-08-11 10:11           ` Lluís Vilanova
@ 2016-09-02 21:24             ` Stefan Hajnoczi
  2016-09-14 12:34               ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Stefan Hajnoczi @ 2016-09-02 21:24 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel, Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

On Thu, Aug 11, 2016 at 12:11:06PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > On Wed, Aug 10, 2016 at 06:11:24PM +0200, Lluís Vilanova wrote:
> >> Daniel P Berrange writes:
> >> 
> >> > On Wed, Aug 10, 2016 at 04:33:47PM +0200, Lluís Vilanova wrote:
> >> >> Daniel P Berrange writes:
> [...]
> >> >> For example, first we concatenate /trace-events, /io/trace-events and
> >> >> /hw/usb/trace-events into /trace-events-all to produce:
> >> >> 
> >> >> @group core
> >> >> @dir /
> >> >> # contents of /trace-events
> >> >> @group io
> >> >> @dir /io
> >> >> # contents of /io/trace-events
> >> >> @group hw_usb
> >> >> @dir /hw/usb
> >> >> # contents of /hw/usb/trace-events
> >> >> 
> >> >> Then we can use /trace-events-all to generate all the per-directory trace.h
> >> >> files while ensuring a perfectly flat event identifier space (a single
> >> >> generated-events.c is used).
> >> >> 
> >> >> This should minimize changes to tracing code and avoid further restrictions
> >> >> (like the "top-level vcpu" one).
> >> 
> >> > That means when any individual trace file is changed, we re-generate the
> >> > world, which is exactly what this series is designed to avoid.
> >> 
> >> Nope. We re-generate /trace-events-all, but each individual file generated
> >> afterwards (taken from the "@dir" directive) will change only if its new
> >> contents do (the Makefile uses cmp to check if files need updating from their
> >> corresponding timestamp file).
> 
> > The contents will still need to change too if we have a global numbering
> > space as your suggestion requires. The event groups are the only way to
> > avoid that.
> 
> Aha, that's true. I didn't think of that, sorry.

Nevertheless, I agree that @id_offset() should be eliminated to avoid
collisions and manual effort when trace-events files are added.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (61 preceding siblings ...)
  2016-08-10 14:05 ` Lluís Vilanova
@ 2016-09-08 13:23 ` Lluís Vilanova
  2016-09-08 13:43   ` Daniel P. Berrange
  2016-09-13 17:08   ` Daniel P. Berrange
  2016-09-13 14:54 ` Stefan Hajnoczi
  63 siblings, 2 replies; 113+ messages in thread
From: Lluís Vilanova @ 2016-09-08 13:23 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> I previously split the global trace-events file up into one file
> per-subdirectory to avoid merge conflict hell.
[...]

Sorry, I could not find the message where the infrastructure is modified to
provide this. But I think there's a more efficient way to provide modular
auto-generated tracing code without the hierarchical indexing you proposed.

What about using global variables? Instead of the dstate array, each event could
have this on the "public" header:

  /* define for static state */
  #define TRACE_EVENTNAME_ENABLED 1
  /* pointer to event descriptor */
  extern TraceEvent *TRACE_EVENTNAME;
  /* variable with dynamic state */
  extern bool ___TRACE_EVENTNAME_DSTATE;

  void trace_eventname(...) {
      if (trace_event_get_stateTRACE_EVENTNAME_ENABLED && ___trace_eventname_dstate) {
          /* ... */
      }
  }

The use of event IDs on generic code can be adapted like this:

  #define trace_event_get_state_dynamic_by_id(id) \
      (unlikely(trace_events_enabled_count) && \
       (___ ## id ## _DSTATE))

And then we can concatenate all "trace-events" files to generate the .c files:

  struct TraceEvent {
      /* ... */
      bool *dstate;
  };

  bool ___TRACE_EVENTNAME_DSTATE;

  struct TraceEvent ___trace_events[] = {
      {
          .name = "eventname",
          .sstate = 1,
          .dstate = ___trace_eventname_dstate;
      }
  }

  TraceEvent *TRACE_EVENTNAME = &___trace_events[...];

So updating a single "trace-events" file does not force a recompile of the whole
QEMU, but we retain the performance of the flat dstate array (now a per-event
pointer) and the simpler flat structure for iteration based on event names.


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-08 13:23 ` Lluís Vilanova
@ 2016-09-08 13:43   ` Daniel P. Berrange
  2016-09-09 11:03     ` Lluís Vilanova
  2016-09-13 17:08   ` Daniel P. Berrange
  1 sibling, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-08 13:43 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > I previously split the global trace-events file up into one file
> > per-subdirectory to avoid merge conflict hell.
> [...]
> 
> Sorry, I could not find the message where the infrastructure is modified to
> provide this. But I think there's a more efficient way to provide modular
> auto-generated tracing code without the hierarchical indexing you proposed.

[snip]

>   struct TraceEvent ___trace_events[] = {
>       {
>           .name = "eventname",
>           .sstate = 1,
>           .dstate = ___trace_eventname_dstate;
>       }
>   }
> 
>   TraceEvent *TRACE_EVENTNAME = &___trace_events[...];

Life would be simpler if we had the 'bool dstate' as part of the
TraceEvent struct, but doing so would essentially be reverting this
previous change:

  commit 585ec7273e6fdab902b2128bc6c2a8136aafef04
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   Wed Oct 28 07:06:27 2015 +0100

    trace: track enabled events in a separate array
    
    This is more cache friendly on the fast path, where we already have
    the event id available.

I asked Paolo about this previously and he indicated it was a notable
performance improvement, so we can't put dstate back into the TraceEvent
struct :-(

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 04/60] trace: move hw/virtio/virtio-balloon.c trace points into correct file
  2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 04/60] trace: move hw/virtio/virtio-balloon.c " Daniel P. Berrange
@ 2016-09-08 18:09   ` Eric Blake
  2016-09-14 14:50     ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Eric Blake @ 2016-09-08 18:09 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

On 08/09/2016 10:31 AM, Daniel P. Berrange wrote:
> The trace points for hw/virtio/virtio-balloon.c were mistakenly put
> in the top level trace-events file, instead of util/trace-events.

Is it worth updating the commit messages to commit ids that caused that
need for 1-4 in your series?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-08 13:43   ` Daniel P. Berrange
@ 2016-09-09 11:03     ` Lluís Vilanova
  2016-09-09 12:08       ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-09-09 11:03 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
>> Daniel P Berrange writes:
>> 
>> > I previously split the global trace-events file up into one file
>> > per-subdirectory to avoid merge conflict hell.
>> [...]
>> 
>> Sorry, I could not find the message where the infrastructure is modified to
>> provide this. But I think there's a more efficient way to provide modular
>> auto-generated tracing code without the hierarchical indexing you proposed.

> [snip]

>> struct TraceEvent ___trace_events[] = {
>> {
>> .name = "eventname",
>> .sstate = 1,
>> .dstate = ___trace_eventname_dstate;
>> }
>> }
>> 
>> TraceEvent *TRACE_EVENTNAME = &___trace_events[...];

> Life would be simpler if we had the 'bool dstate' as part of the
> TraceEvent struct, but doing so would essentially be reverting this
> previous change:

>   commit 585ec7273e6fdab902b2128bc6c2a8136aafef04
>   Author: Paolo Bonzini <pbonzini@redhat.com>
>   Date:   Wed Oct 28 07:06:27 2015 +0100

>     trace: track enabled events in a separate array
    
>     This is more cache friendly on the fast path, where we already have
>     the event id available.

> I asked Paolo about this previously and he indicated it was a notable
> performance improvement, so we can't put dstate back into the TraceEvent
> struct :-(

Sorry, there was a typo in my example code that led to this misunderstanding.

I meant this for the global auto-generated .c:

  struct TraceEvent {
      /* ... */
      bool *dstate;
  };

  bool ___TRACE_EVENTNAME_DSTATE;

  struct TraceEvent ___trace_events[] = {
      {
          .name = "eventname",
          .sstate = 1,
          .dstate = &___TRACE_EVENTNAME_DSTATE;
      }
  }

  TraceEvent *TRACE_EVENTNAME = &___trace_events[...];


If you look at the modified macro I pasted for "trace/control-internal.h":


  #define trace_event_get_state_dynamic_by_id(id) \
      (unlikely(trace_events_enabled_count) && \
       (___ ## id ## _DSTATE))

We're retaining the fast-path performance of the seggregated boolean dstate
array, while the event descriptor contains a pointer to the per-event dstate
global boolean variable in case you want to get/set the dstate based on an event
pointer.

Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-09 11:03     ` Lluís Vilanova
@ 2016-09-09 12:08       ` Daniel P. Berrange
  2016-09-09 13:16         ` Lluís Vilanova
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-09 12:08 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Fri, Sep 09, 2016 at 01:03:51PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
> >> Daniel P Berrange writes:
> >> 
> >> > I previously split the global trace-events file up into one file
> >> > per-subdirectory to avoid merge conflict hell.
> >> [...]
> >> 
> >> Sorry, I could not find the message where the infrastructure is modified to
> >> provide this. But I think there's a more efficient way to provide modular
> >> auto-generated tracing code without the hierarchical indexing you proposed.
> 
> > [snip]
> 
> >> struct TraceEvent ___trace_events[] = {
> >> {
> >> .name = "eventname",
> >> .sstate = 1,
> >> .dstate = ___trace_eventname_dstate;
> >> }
> >> }
> >> 
> >> TraceEvent *TRACE_EVENTNAME = &___trace_events[...];
> 
> > Life would be simpler if we had the 'bool dstate' as part of the
> > TraceEvent struct, but doing so would essentially be reverting this
> > previous change:
> 
> >   commit 585ec7273e6fdab902b2128bc6c2a8136aafef04
> >   Author: Paolo Bonzini <pbonzini@redhat.com>
> >   Date:   Wed Oct 28 07:06:27 2015 +0100
> 
> >     trace: track enabled events in a separate array
>     
> >     This is more cache friendly on the fast path, where we already have
> >     the event id available.
> 
> > I asked Paolo about this previously and he indicated it was a notable
> > performance improvement, so we can't put dstate back into the TraceEvent
> > struct :-(
> 
> Sorry, there was a typo in my example code that led to this misunderstanding.
> 
> I meant this for the global auto-generated .c:
> 
>   struct TraceEvent {
>       /* ... */
>       bool *dstate;
>   };
> 
>   bool ___TRACE_EVENTNAME_DSTATE;
> 
>   struct TraceEvent ___trace_events[] = {
>       {
>           .name = "eventname",
>           .sstate = 1,
>           .dstate = &___TRACE_EVENTNAME_DSTATE;
>       }
>   }
> 
>   TraceEvent *TRACE_EVENTNAME = &___trace_events[...];
> 
> 
> If you look at the modified macro I pasted for "trace/control-internal.h":
> 
> 
>   #define trace_event_get_state_dynamic_by_id(id) \
>       (unlikely(trace_events_enabled_count) && \
>        (___ ## id ## _DSTATE))
> 
> We're retaining the fast-path performance of the seggregated boolean dstate
> array, while the event descriptor contains a pointer to the per-event dstate
> global boolean variable in case you want to get/set the dstate based on an event
> pointer.

The various  _DSTATE variables are still arbitrarily scattered in
memory, as opposed to in a contiguous cache friendly array, which
is one of the goals of Paolo's original change.

That said, I'm unclear on how much of the performance win from
Paolo's change came from eliminating the struct field de-reference,
vs having the contiguous array. I'm guessing most of the win is
from the former, the latter only being important if we hit multiple
related tracepoints on close succession.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-09 12:08       ` Daniel P. Berrange
@ 2016-09-09 13:16         ` Lluís Vilanova
  2016-09-13 17:53           ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-09-09 13:16 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Fri, Sep 09, 2016 at 01:03:51PM +0200, Lluís Vilanova wrote:
>> Daniel P Berrange writes:
>> 
>> > On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
>> >> Daniel P Berrange writes:
>> >> 
>> >> > I previously split the global trace-events file up into one file
>> >> > per-subdirectory to avoid merge conflict hell.
>> >> [...]
>> >> 
>> >> Sorry, I could not find the message where the infrastructure is modified to
>> >> provide this. But I think there's a more efficient way to provide modular
>> >> auto-generated tracing code without the hierarchical indexing you proposed.
>> 
>> > [snip]
>> 
>> >> struct TraceEvent ___trace_events[] = {
>> >> {
>> >> .name = "eventname",
>> >> .sstate = 1,
>> >> .dstate = ___trace_eventname_dstate;
>> >> }
>> >> }
>> >> 
>> >> TraceEvent *TRACE_EVENTNAME = &___trace_events[...];
>> 
>> > Life would be simpler if we had the 'bool dstate' as part of the
>> > TraceEvent struct, but doing so would essentially be reverting this
>> > previous change:
>> 
>> >   commit 585ec7273e6fdab902b2128bc6c2a8136aafef04
>> >   Author: Paolo Bonzini <pbonzini@redhat.com>
>> >   Date:   Wed Oct 28 07:06:27 2015 +0100
>> 
>> >     trace: track enabled events in a separate array
>> 
>> >     This is more cache friendly on the fast path, where we already have
>> >     the event id available.
>> 
>> > I asked Paolo about this previously and he indicated it was a notable
>> > performance improvement, so we can't put dstate back into the TraceEvent
>> > struct :-(
>> 
>> Sorry, there was a typo in my example code that led to this misunderstanding.
>> 
>> I meant this for the global auto-generated .c:
>> 
>> struct TraceEvent {
>> /* ... */
>> bool *dstate;
>> };
>> 
>> bool ___TRACE_EVENTNAME_DSTATE;
>> 
>> struct TraceEvent ___trace_events[] = {
>> {
>> .name = "eventname",
>> .sstate = 1,
>> .dstate = &___TRACE_EVENTNAME_DSTATE;
>> }
>> }
>> 
>> TraceEvent *TRACE_EVENTNAME = &___trace_events[...];
>> 
>> 
>> If you look at the modified macro I pasted for "trace/control-internal.h":
>> 
>> 
>> #define trace_event_get_state_dynamic_by_id(id) \
>> (unlikely(trace_events_enabled_count) && \
>> (___ ## id ## _DSTATE))
>> 
>> We're retaining the fast-path performance of the seggregated boolean dstate
>> array, while the event descriptor contains a pointer to the per-event dstate
>> global boolean variable in case you want to get/set the dstate based on an event
>> pointer.

> The various  _DSTATE variables are still arbitrarily scattered in
> memory, as opposed to in a contiguous cache friendly array, which
> is one of the goals of Paolo's original change.

> That said, I'm unclear on how much of the performance win from
> Paolo's change came from eliminating the struct field de-reference,
> vs having the contiguous array. I'm guessing most of the win is
> from the former, the latter only being important if we hit multiple
> related tracepoints on close succession.

The latter can also be achieved by packing them all together in a single
section, but I don't know if that's acceptable within portable QEMU code. For
example:

  bool ___TRACE_EVENTNAME_DSTATE __attribute__((section("dstate_array")))


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
                   ` (62 preceding siblings ...)
  2016-09-08 13:23 ` Lluís Vilanova
@ 2016-09-13 14:54 ` Stefan Hajnoczi
  2016-09-13 15:10   ` Daniel P. Berrange
  63 siblings, 1 reply; 113+ messages in thread
From: Stefan Hajnoczi @ 2016-09-13 14:54 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 171 bytes --]

Dan: Ping?

A few people have reviewed this series.  A v2 would be appreciated.  I'd
like to merge it quickly and as early into the development cycle as
possible.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-13 14:54 ` Stefan Hajnoczi
@ 2016-09-13 15:10   ` Daniel P. Berrange
  2016-09-13 16:05     ` Lluís Vilanova
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-13 15:10 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel

On Tue, Sep 13, 2016 at 03:54:01PM +0100, Stefan Hajnoczi wrote:
> Dan: Ping?
> 
> A few people have reviewed this series.  A v2 would be appreciated.  I'd
> like to merge it quickly and as early into the development cycle as
> possible.

Sorry, been focused on other series, but will try and post an update this
week considering the feedback.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-13 15:10   ` Daniel P. Berrange
@ 2016-09-13 16:05     ` Lluís Vilanova
  2016-09-13 16:27       ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-09-13 16:05 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Stefan Hajnoczi, qemu-devel

Daniel P Berrange writes:

> On Tue, Sep 13, 2016 at 03:54:01PM +0100, Stefan Hajnoczi wrote:
>> Dan: Ping?
>> 
>> A few people have reviewed this series.  A v2 would be appreciated.  I'd
>> like to merge it quickly and as early into the development cycle as
>> possible.

> Sorry, been focused on other series, but will try and post an update this
> week considering the feedback.

I can help in implementing the global variable approach I described, if you
want.

Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-13 16:05     ` Lluís Vilanova
@ 2016-09-13 16:27       ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-13 16:27 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel

On Tue, Sep 13, 2016 at 06:05:07PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > On Tue, Sep 13, 2016 at 03:54:01PM +0100, Stefan Hajnoczi wrote:
> >> Dan: Ping?
> >> 
> >> A few people have reviewed this series.  A v2 would be appreciated.  I'd
> >> like to merge it quickly and as early into the development cycle as
> >> possible.
> 
> > Sorry, been focused on other series, but will try and post an update this
> > week considering the feedback.
> 
> I can help in implementing the global variable approach I described, if you
> want.

Thanks for the offer, but the series is hairy enough to rebase that trying
to split the work will just create even more rebase pain than there already
is.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-08 13:23 ` Lluís Vilanova
  2016-09-08 13:43   ` Daniel P. Berrange
@ 2016-09-13 17:08   ` Daniel P. Berrange
  2016-09-13 18:36     ` Lluís Vilanova
  1 sibling, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-13 17:08 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > I previously split the global trace-events file up into one file
> > per-subdirectory to avoid merge conflict hell.
> [...]
> 
> Sorry, I could not find the message where the infrastructure is modified to
> provide this. But I think there's a more efficient way to provide modular
> auto-generated tracing code without the hierarchical indexing you proposed.

NB, the simpletrace backend requires a globally unique 32-bit integer ID
to be assigned to each trace event, so even with the approach you suggest
below we still need to be able to assign a global ID for each event.

So while your suggest below avoids having to pass around the dstate
arrays, which is nice, we still have to assign event id offsets to
each trace-event file in some manner TBD.

> 
> What about using global variables? Instead of the dstate array, each event could
> have this on the "public" header:
> 
>   /* define for static state */
>   #define TRACE_EVENTNAME_ENABLED 1
>   /* pointer to event descriptor */
>   extern TraceEvent *TRACE_EVENTNAME;
>   /* variable with dynamic state */
>   extern bool ___TRACE_EVENTNAME_DSTATE;
> 
>   void trace_eventname(...) {
>       if (trace_event_get_stateTRACE_EVENTNAME_ENABLED && ___trace_eventname_dstate) {
>           /* ... */
>       }
>   }
> 
> The use of event IDs on generic code can be adapted like this:
> 
>   #define trace_event_get_state_dynamic_by_id(id) \
>       (unlikely(trace_events_enabled_count) && \
>        (___ ## id ## _DSTATE))
> 
> And then we can concatenate all "trace-events" files to generate the .c files:
> 
>   struct TraceEvent {
>       /* ... */
>       bool *dstate;
>   };
> 
>   bool ___TRACE_EVENTNAME_DSTATE;
> 
>   struct TraceEvent ___trace_events[] = {
>       {
>           .name = "eventname",
>           .sstate = 1,
>           .dstate = ___trace_eventname_dstate;
>       }
>   }
> 
>   TraceEvent *TRACE_EVENTNAME = &___trace_events[...];
> 
> So updating a single "trace-events" file does not force a recompile of the whole
> QEMU, but we retain the performance of the flat dstate array (now a per-event
> pointer) and the simpler flat structure for iteration based on event names.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-09 13:16         ` Lluís Vilanova
@ 2016-09-13 17:53           ` Daniel P. Berrange
  2016-09-14 13:20             ` Lluís Vilanova
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-13 17:53 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Fri, Sep 09, 2016 at 03:16:50PM +0200, Lluís Vilanova wrote:
> > The various  _DSTATE variables are still arbitrarily scattered in
> > memory, as opposed to in a contiguous cache friendly array, which
> > is one of the goals of Paolo's original change.
> 
> > That said, I'm unclear on how much of the performance win from
> > Paolo's change came from eliminating the struct field de-reference,
> > vs having the contiguous array. I'm guessing most of the win is
> > from the former, the latter only being important if we hit multiple
> > related tracepoints on close succession.
> 
> The latter can also be achieved by packing them all together in a single
> section, but I don't know if that's acceptable within portable QEMU code. For
> example:
> 
>   bool ___TRACE_EVENTNAME_DSTATE __attribute__((section("dstate_array")))

Acutally, it should be sufficient if we just generate all the dstate
variables in one place in the .c file - the compiler isn't going to
scatter a set of variables declared one after each other.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-13 17:08   ` Daniel P. Berrange
@ 2016-09-13 18:36     ` Lluís Vilanova
  2016-09-14  8:25       ` Daniel P. Berrange
  0 siblings, 1 reply; 113+ messages in thread
From: Lluís Vilanova @ 2016-09-13 18:36 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
>> Daniel P Berrange writes:
>> 
>> > I previously split the global trace-events file up into one file
>> > per-subdirectory to avoid merge conflict hell.
>> [...]
>> 
>> Sorry, I could not find the message where the infrastructure is modified to
>> provide this. But I think there's a more efficient way to provide modular
>> auto-generated tracing code without the hierarchical indexing you proposed.

> NB, the simpletrace backend requires a globally unique 32-bit integer ID
> to be assigned to each trace event, so even with the approach you suggest
> below we still need to be able to assign a global ID for each event.

> So while your suggest below avoids having to pass around the dstate
> arrays, which is nice, we still have to assign event id offsets to
> each trace-event file in some manner TBD.

Corect me if I'm wrong, but if we only require these consecutive IDs for
simpletrace, they don't need to be visible to the tracing headers (these IDs are
only used in "trace/generated-tracers.c"). Therefore, we can get them from the
trace-events-all file, and minimize the complexity of the changes to tracetool.


Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-13 18:36     ` Lluís Vilanova
@ 2016-09-14  8:25       ` Daniel P. Berrange
  2016-09-14 13:26         ` Lluís Vilanova
  0 siblings, 1 reply; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-14  8:25 UTC (permalink / raw)
  To: qemu-devel, Stefan Hajnoczi

On Tue, Sep 13, 2016 at 08:36:25PM +0200, Lluís Vilanova wrote:
> Daniel P Berrange writes:
> 
> > On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
> >> Daniel P Berrange writes:
> >> 
> >> > I previously split the global trace-events file up into one file
> >> > per-subdirectory to avoid merge conflict hell.
> >> [...]
> >> 
> >> Sorry, I could not find the message where the infrastructure is modified to
> >> provide this. But I think there's a more efficient way to provide modular
> >> auto-generated tracing code without the hierarchical indexing you proposed.
> 
> > NB, the simpletrace backend requires a globally unique 32-bit integer ID
> > to be assigned to each trace event, so even with the approach you suggest
> > below we still need to be able to assign a global ID for each event.
> 
> > So while your suggest below avoids having to pass around the dstate
> > arrays, which is nice, we still have to assign event id offsets to
> > each trace-event file in some manner TBD.
> 
> Corect me if I'm wrong, but if we only require these consecutive IDs for
> simpletrace, they don't need to be visible to the tracing headers (these IDs are
> only used in "trace/generated-tracers.c"). Therefore, we can get them from the
> trace-events-all file, and minimize the complexity of the changes to tracetool.

The IDs need to be present in the generated tracers files which are split
up.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 05/60] trace: add trace event iterator APIs
  2016-09-02 20:52   ` Stefan Hajnoczi
@ 2016-09-14 12:32     ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-14 12:32 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Stefan Hajnoczi

On Fri, Sep 02, 2016 at 04:52:18PM -0400, Stefan Hajnoczi wrote:
> On Tue, Aug 09, 2016 at 04:31:33PM +0100, Daniel P. Berrange wrote:
> > +TraceEvent *trace_event_iter_next(TraceEventIter *iter)
> > +{
> > +    TraceEvent *ev;
> > +
> > +    if (iter->event >= TRACE_EVENT_COUNT) {
> > +        return NULL;
> > +    }
> > +
> > +    ev = &(trace_events[iter->event]);
> > +
> > +    do {
> > +        iter->event++;
> > +    } while (iter->event < TRACE_EVENT_COUNT &&
> > +             iter->pattern &&
> > +             !pattern_glob(iter->pattern,
> > +                           trace_event_get_name(&(trace_events[iter->event]))));
> > +
> > +    return ev;
> > +}
> 
> Shouldn't ev be updated inside the while loop?  Otherwise the iterator
> always returns &trace_events[0] the first time it's called.

Sigh, yes, well spotted.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs
  2016-09-02 21:13         ` Stefan Hajnoczi
@ 2016-09-14 12:32           ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-14 12:32 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Paolo Bonzini, qemu-devel, Stefan Hajnoczi

On Fri, Sep 02, 2016 at 05:13:48PM -0400, Stefan Hajnoczi wrote:
> On Tue, Aug 09, 2016 at 06:26:49PM +0200, Paolo Bonzini wrote:
> > 
> > 
> > On 09/08/2016 18:24, Daniel P. Berrange wrote:
> > >>> > > -static inline TraceEventID trace_event_get_id(TraceEvent *ev)
> > >>> > > +static inline size_t trace_event_get_id(TraceEvent *ev)
> > >>> > >  {
> > >>> > >      assert(ev != NULL);
> > >>> > >      return ev->id;
> > >> > 
> > >> > Perhaps "unsigned" is a better match than size_t?
> > > I don't mind either way - I just happen to personally always use size_t
> > > for anything that ends up being used primarily as an array index.
> > 
> > Makes sense.  I was thinking of simpletrace's 32-bit id instead.
> 
> I think unsigned is slightly clearer since it expresses the intent that
> the values are limited to 32 bits.

I'll switch to 'uint32_t' since that unambigously matches that
simpletrace mandates.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach
  2016-09-02 21:24             ` Stefan Hajnoczi
@ 2016-09-14 12:34               ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-14 12:34 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Stefan Hajnoczi

On Fri, Sep 02, 2016 at 05:24:04PM -0400, Stefan Hajnoczi wrote:
> On Thu, Aug 11, 2016 at 12:11:06PM +0200, Lluís Vilanova wrote:
> > Daniel P Berrange writes:
> > 
> > > On Wed, Aug 10, 2016 at 06:11:24PM +0200, Lluís Vilanova wrote:
> > >> Daniel P Berrange writes:
> > >> 
> > >> > On Wed, Aug 10, 2016 at 04:33:47PM +0200, Lluís Vilanova wrote:
> > >> >> Daniel P Berrange writes:
> > [...]
> > >> >> For example, first we concatenate /trace-events, /io/trace-events and
> > >> >> /hw/usb/trace-events into /trace-events-all to produce:
> > >> >> 
> > >> >> @group core
> > >> >> @dir /
> > >> >> # contents of /trace-events
> > >> >> @group io
> > >> >> @dir /io
> > >> >> # contents of /io/trace-events
> > >> >> @group hw_usb
> > >> >> @dir /hw/usb
> > >> >> # contents of /hw/usb/trace-events
> > >> >> 
> > >> >> Then we can use /trace-events-all to generate all the per-directory trace.h
> > >> >> files while ensuring a perfectly flat event identifier space (a single
> > >> >> generated-events.c is used).
> > >> >> 
> > >> >> This should minimize changes to tracing code and avoid further restrictions
> > >> >> (like the "top-level vcpu" one).
> > >> 
> > >> > That means when any individual trace file is changed, we re-generate the
> > >> > world, which is exactly what this series is designed to avoid.
> > >> 
> > >> Nope. We re-generate /trace-events-all, but each individual file generated
> > >> afterwards (taken from the "@dir" directive) will change only if its new
> > >> contents do (the Makefile uses cmp to check if files need updating from their
> > >> corresponding timestamp file).
> > 
> > > The contents will still need to change too if we have a global numbering
> > > space as your suggestion requires. The event groups are the only way to
> > > avoid that.
> > 
> > Aha, that's true. I didn't think of that, sorry.
> 
> Nevertheless, I agree that @id_offset() should be eliminated to avoid
> collisions and manual effort when trace-events files are added.

I think I have a workable solution to eliminate this. During build I'll
create a file 'trace-event-file-list' which contains a list of paths to
'trace-event' files in the tree. We'll then use the line number in this
file as the id offset for events. The generated $SUBDIR/trace.h file
will depend on trace-event-file-list.

So we'll have fully automatic numbering for each trace-event file and
will only get a full rebuild if someone adds a completely new trace-event
file, which is acceptable.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-13 17:53           ` Daniel P. Berrange
@ 2016-09-14 13:20             ` Lluís Vilanova
  0 siblings, 0 replies; 113+ messages in thread
From: Lluís Vilanova @ 2016-09-14 13:20 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Fri, Sep 09, 2016 at 03:16:50PM +0200, Lluís Vilanova wrote:
>> > The various  _DSTATE variables are still arbitrarily scattered in
>> > memory, as opposed to in a contiguous cache friendly array, which
>> > is one of the goals of Paolo's original change.
>> 
>> > That said, I'm unclear on how much of the performance win from
>> > Paolo's change came from eliminating the struct field de-reference,
>> > vs having the contiguous array. I'm guessing most of the win is
>> > from the former, the latter only being important if we hit multiple
>> > related tracepoints on close succession.
>> 
>> The latter can also be achieved by packing them all together in a single
>> section, but I don't know if that's acceptable within portable QEMU code. For
>> example:
>> 
>> bool ___TRACE_EVENTNAME_DSTATE __attribute__((section("dstate_array")))

> Acutally, it should be sufficient if we just generate all the dstate
> variables in one place in the .c file - the compiler isn't going to
> scatter a set of variables declared one after each other.

That should work.

Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files
  2016-09-14  8:25       ` Daniel P. Berrange
@ 2016-09-14 13:26         ` Lluís Vilanova
  0 siblings, 0 replies; 113+ messages in thread
From: Lluís Vilanova @ 2016-09-14 13:26 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi

Daniel P Berrange writes:

> On Tue, Sep 13, 2016 at 08:36:25PM +0200, Lluís Vilanova wrote:
>> Daniel P Berrange writes:
>> 
>> > On Thu, Sep 08, 2016 at 03:23:26PM +0200, Lluís Vilanova wrote:
>> >> Daniel P Berrange writes:
>> >> 
>> >> > I previously split the global trace-events file up into one file
>> >> > per-subdirectory to avoid merge conflict hell.
>> >> [...]
>> >> 
>> >> Sorry, I could not find the message where the infrastructure is modified to
>> >> provide this. But I think there's a more efficient way to provide modular
>> >> auto-generated tracing code without the hierarchical indexing you proposed.
>> 
>> > NB, the simpletrace backend requires a globally unique 32-bit integer ID
>> > to be assigned to each trace event, so even with the approach you suggest
>> > below we still need to be able to assign a global ID for each event.
>> 
>> > So while your suggest below avoids having to pass around the dstate
>> > arrays, which is nice, we still have to assign event id offsets to
>> > each trace-event file in some manner TBD.
>> 
>> Corect me if I'm wrong, but if we only require these consecutive IDs for
>> simpletrace, they don't need to be visible to the tracing headers (these IDs are
>> only used in "trace/generated-tracers.c"). Therefore, we can get them from the
>> trace-events-all file, and minimize the complexity of the changes to tracetool.

> The IDs need to be present in the generated tracers files which are split
> up.

I'm not sure if I'm just missing what you mean.

Changing any of the trace-events files will trigger a recompilation of the .c
files specific to the simpletrace backend, but won't trigger a recompile of all
QEMU files including any of the tracing headers (just the files including the
"trace.h" corresponding to the modified "trace-events").

Cheers,
  Lluis

^ permalink raw reply	[flat|nested] 113+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.8 v1 04/60] trace: move hw/virtio/virtio-balloon.c trace points into correct file
  2016-09-08 18:09   ` Eric Blake
@ 2016-09-14 14:50     ` Daniel P. Berrange
  0 siblings, 0 replies; 113+ messages in thread
From: Daniel P. Berrange @ 2016-09-14 14:50 UTC (permalink / raw)
  To: Eric Blake; +Cc: qemu-devel, Stefan Hajnoczi

On Thu, Sep 08, 2016 at 01:09:01PM -0500, Eric Blake wrote:
> On 08/09/2016 10:31 AM, Daniel P. Berrange wrote:
> > The trace points for hw/virtio/virtio-balloon.c were mistakenly put
> > in the top level trace-events file, instead of util/trace-events.
> 
> Is it worth updating the commit messages to commit ids that caused that
> need for 1-4 in your series?

Sure, will do.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 113+ messages in thread

end of thread, other threads:[~2016-09-14 14:50 UTC | newest]

Thread overview: 113+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09 15:31 [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 01/60] trace: move util/buffer.c trace points into correct file Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 02/60] trace: move util/qemu-coroutine*.c " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 03/60] trace: move hw/mem/pc-dimm.c " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 04/60] trace: move hw/virtio/virtio-balloon.c " Daniel P. Berrange
2016-09-08 18:09   ` Eric Blake
2016-09-14 14:50     ` Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 05/60] trace: add trace event iterator APIs Daniel P. Berrange
2016-09-02 20:52   ` Stefan Hajnoczi
2016-09-14 12:32     ` Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 06/60] trace: convert code to use event iterators Daniel P. Berrange
2016-09-02 20:55   ` Stefan Hajnoczi
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 07/60] trace: remove some now unused functions Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 08/60] trace: provide mechanism for registering trace events Daniel P. Berrange
2016-08-09 16:17   ` Paolo Bonzini
2016-08-09 16:18     ` Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 09/60] trace: remove use of TRACE_VCPU_EVENT_COUNT in cpu.h Daniel P. Berrange
2016-09-02 21:03   ` Stefan Hajnoczi
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays Daniel P. Berrange
2016-08-10 14:00   ` Lluís Vilanova
2016-08-10 14:47     ` Daniel P. Berrange
2016-08-10 16:13       ` Lluís Vilanova
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs Daniel P. Berrange
2016-08-09 16:18   ` Paolo Bonzini
2016-08-09 16:24     ` Daniel P. Berrange
2016-08-09 16:26       ` Paolo Bonzini
2016-09-02 21:13         ` Stefan Hajnoczi
2016-09-14 12:32           ` Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 12/60] trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 13/60] trace: remove generated-events.h from many includes Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 14/60] trace: get rid of generated-events.h/generated-events.c Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 15/60] trace: introduce a formal group name for trace events Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 16/60] trace: introduce ID range offsets per trace-events file Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 17/60] trace: introduce some Makefile rules for module code gen Daniel P. Berrange
2016-08-10 14:18   ` Lluís Vilanova
2016-08-10 14:48     ` Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 18/60] trace: switch io/ directory to modular trace.h file Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 19/60] trace: switch util/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 20/60] trace: switch crypto/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 21/60] trace: switch migration/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 22/60] trace: switch block/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 23/60] trace: switch hw/block/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 24/60] trace: switch hw/char/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 25/60] trace: switch hw/intc/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 26/60] trace: switch hw/net/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 27/60] trace: switch hw/virtio/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 28/60] trace: switch hw/audio/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 29/60] trace: switch hw/misc/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 30/60] trace: switch hw/usb/ " Daniel P. Berrange
2016-08-09 15:31 ` [Qemu-devel] [PATCH for-2.8 v1 31/60] trace: switch hw/scsi/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 32/60] trace: switch hw/nvram/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 33/60] trace: switch hw/display/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 34/60] trace: switch hw/input/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 35/60] trace: switch hw/timer/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 36/60] trace: switch hw/dma/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 37/60] trace: switch hw/sparc/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 38/60] trace: switch hw/sd/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 39/60] trace: switch hw/isa/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 40/60] trace: switch hw/mem/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 41/60] trace: switch hw/i386/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 42/60] trace: switch hw/9pfs/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 43/60] trace: switch hw/ppc/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 44/60] trace: switch hw/pci/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 45/60] trace: switch hw/s390x/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 46/60] trace: switch hw/vfio/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 47/60] trace: switch hw/acpi/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 48/60] trace: switch hw/arm/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 49/60] trace: switch hw/alpha/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 50/60] trace: switch ui/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 51/60] trace: switch audio/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 52/60] trace: switch net/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 53/60] trace: switch target-i386/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 54/60] trace: switch target-sparc/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 55/60] trace: switch target-s390x/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 56/60] trace: switch target-ppc/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 57/60] trace: switch qom/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 58/60] trace: switch linux-user/ " Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 59/60] trace: remove the global include/trace.h file Daniel P. Berrange
2016-08-09 15:32 ` [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach Daniel P. Berrange
2016-08-10 14:33   ` Lluís Vilanova
2016-08-10 14:51     ` Daniel P. Berrange
2016-08-10 16:11       ` Lluís Vilanova
2016-08-11  8:13         ` Daniel P. Berrange
2016-08-11 10:11           ` Lluís Vilanova
2016-09-02 21:24             ` Stefan Hajnoczi
2016-09-14 12:34               ` Daniel P. Berrange
2016-08-09 17:03 ` [Qemu-devel] [PATCH for-2.8 v1 00/60] Modular build of trace event files no-reply
2016-08-09 17:11   ` Daniel P. Berrange
2016-08-10  1:41     ` Fam Zheng
2016-08-10  8:06       ` Daniel P. Berrange
2016-08-10  8:13         ` Fam Zheng
2016-08-10  8:24           ` Daniel P. Berrange
2016-08-10  8:39             ` Fam Zheng
2016-08-10  8:50               ` Daniel P. Berrange
2016-08-10 15:54               ` Paolo Bonzini
2016-08-10  1:58     ` Fam Zheng
2016-08-10 14:05 ` Lluís Vilanova
2016-08-10 14:52   ` Daniel P. Berrange
2016-09-08 13:23 ` Lluís Vilanova
2016-09-08 13:43   ` Daniel P. Berrange
2016-09-09 11:03     ` Lluís Vilanova
2016-09-09 12:08       ` Daniel P. Berrange
2016-09-09 13:16         ` Lluís Vilanova
2016-09-13 17:53           ` Daniel P. Berrange
2016-09-14 13:20             ` Lluís Vilanova
2016-09-13 17:08   ` Daniel P. Berrange
2016-09-13 18:36     ` Lluís Vilanova
2016-09-14  8:25       ` Daniel P. Berrange
2016-09-14 13:26         ` Lluís Vilanova
2016-09-13 14:54 ` Stefan Hajnoczi
2016-09-13 15:10   ` Daniel P. Berrange
2016-09-13 16:05     ` Lluís Vilanova
2016-09-13 16:27       ` Daniel P. Berrange

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.