Browse Source

trace: switch position of headers to what Meson requires

Meson doesn't enjoy the same flexibility we have with Make in choosing
the include path.  In particular the tracing headers are using
$(build_root)/$(<D).

In order to keep the include directives unchanged,
the simplest solution is to generate headers with patterns like
"trace/trace-audio.h" and place forwarding headers in the source tree
such that for example "audio/trace.h" includes "trace/trace-audio.h".

This patch is too ugly to be applied to the Makefiles now.  It's only
a way to separate the changes to the tracing header files from the
Meson rewrite of the tracing logic.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pull/96/head
Paolo Bonzini 6 years ago
parent
commit
243af0225a
  1. 1
      .gitignore
  2. 46
      Makefile
  3. 1
      Makefile.objs
  4. 1
      accel/kvm/trace.h
  5. 2
      accel/tcg/cputlb.c
  6. 1
      accel/tcg/trace.h
  7. 2
      accel/tcg/user-exec.c
  8. 1
      audio/trace.h
  9. 1
      authz/trace.h
  10. 1
      backends/tpm/trace.h
  11. 1
      backends/trace.h
  12. 1
      block/trace.h
  13. 1
      chardev/trace.h
  14. 1
      crypto/trace.h
  15. 2
      dma-helpers.c
  16. 2
      exec.c
  17. 2
      gdbstub.c
  18. 1
      hw/9pfs/trace.h
  19. 1
      hw/acpi/trace.h
  20. 1
      hw/alpha/trace.h
  21. 1
      hw/arm/trace.h
  22. 1
      hw/audio/trace.h
  23. 1
      hw/block/dataplane/trace.h
  24. 1
      hw/block/trace.h
  25. 1
      hw/char/trace.h
  26. 2
      hw/core/cpu.c
  27. 1
      hw/core/trace.h
  28. 1
      hw/display/trace.h
  29. 1
      hw/dma/trace.h
  30. 1
      hw/gpio/trace.h
  31. 1
      hw/hppa/trace.h
  32. 1
      hw/hyperv/trace.h
  33. 1
      hw/i2c/trace.h
  34. 1
      hw/i386/trace.h
  35. 1
      hw/i386/xen/trace.h
  36. 1
      hw/ide/trace.h
  37. 1
      hw/input/trace.h
  38. 1
      hw/intc/trace.h
  39. 1
      hw/isa/trace.h
  40. 1
      hw/mem/trace.h
  41. 1
      hw/mips/trace.h
  42. 1
      hw/misc/macio/trace.h
  43. 1
      hw/misc/trace.h
  44. 1
      hw/net/trace.h
  45. 1
      hw/nvram/trace.h
  46. 1
      hw/pci-host/trace.h
  47. 1
      hw/pci/trace.h
  48. 1
      hw/ppc/trace.h
  49. 1
      hw/rdma/trace.h
  50. 1
      hw/rdma/vmw/trace.h
  51. 1
      hw/riscv/trace.h
  52. 1
      hw/rtc/trace.h
  53. 1
      hw/s390x/trace.h
  54. 1
      hw/scsi/trace.h
  55. 1
      hw/sd/trace.h
  56. 1
      hw/sparc/trace.h
  57. 1
      hw/sparc64/trace.h
  58. 1
      hw/ssi/trace.h
  59. 1
      hw/timer/trace.h
  60. 1
      hw/tpm/trace.h
  61. 1
      hw/usb/trace.h
  62. 1
      hw/vfio/trace.h
  63. 1
      hw/virtio/trace.h
  64. 1
      hw/watchdog/trace.h
  65. 1
      hw/xen/trace.h
  66. 2
      include/user/syscall-trace.h
  67. 1
      io/trace.h
  68. 2
      job-qmp.c
  69. 2
      job.c
  70. 1
      linux-user/trace.h
  71. 1
      migration/trace.h
  72. 1
      monitor/trace.h
  73. 1
      nbd/trace.h
  74. 1
      net/trace.h
  75. 1
      qapi/trace.h
  76. 1
      qom/trace.h
  77. 5
      scripts/tracetool/format/c.py
  78. 2
      scripts/tracetool/format/tcg_h.py
  79. 2
      scripts/tracetool/format/tcg_helper_c.py
  80. 1
      scsi/trace.h
  81. 2
      softmmu/balloon.c
  82. 2
      softmmu/ioport.c
  83. 2
      softmmu/memory.c
  84. 2
      softmmu/vl.c
  85. 1
      target/arm/trace.h
  86. 1
      target/hppa/trace.h
  87. 1
      target/i386/trace.h
  88. 1
      target/mips/trace.h
  89. 1
      target/ppc/trace.h
  90. 1
      target/riscv/trace.h
  91. 1
      target/s390x/trace.h
  92. 1
      target/sparc/trace.h
  93. 2
      trace/control-target.c
  94. 2
      trace/control.c
  95. 1
      ui/trace.h
  96. 1
      util/trace.h

1
.gitignore

@ -146,7 +146,6 @@ docker-src.*
*~
*.ast_raw
*.depend_raw
trace.h
trace.c
trace-ust.h
trace-ust.h

46
Makefile

@ -159,8 +159,8 @@ generated-files-$(CONFIG_TRACE_UST) += trace-ust-all.c
generated-files-y += module_block.h
TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h)
TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c)
TRACE_HEADERS = trace/trace-root.h
TRACE_SOURCES = trace/trace-root.c
TRACE_DTRACE =
ifdef CONFIG_TRACE_DTRACE
TRACE_HEADERS += trace-dtrace-root.h $(trace-events-subdirs:%=%/trace-dtrace.h)
@ -170,33 +170,37 @@ ifdef CONFIG_TRACE_UST
TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h)
endif
generated-files-y += $(TRACE_HEADERS)
generated-files-y += $(TRACE_SOURCES)
generated-files-y += $(BUILD_DIR)/trace-events-all
generated-files-y += .git-submodule-status
trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
trace-group-suffix = $(shell echo $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
tracetool-y = $(SRC_PATH)/scripts/tracetool.py
tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
%/trace.h: %/trace.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
%/trace.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
define __trace_rules
TRACE_HEADERS += trace/trace-$2.h
TRACE_SOURCES += trace/trace-$2.c
trace-obj-y += trace/trace-$2.o
trace/trace-$2.h: trace/trace-$2.h-timestamp
@cmp $$< $$@ >/dev/null 2>&1 || cp $$< $$@
trace/trace-$2.h-timestamp: $(SRC_PATH)/$1/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--group=$(call trace-group-name,$@) \
--group=$2 \
--format=h \
--backends=$(TRACE_BACKENDS) \
$< > $@,"GEN","$(@:%-timestamp=%)")
$$< > $$@,"GEN","$$(@:%-timestamp=%)")
%/trace.c: %/trace.c-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
%/trace.c-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
trace/trace-$2.c: trace/trace-$2.c-timestamp
@cmp $$< $$@ >/dev/null 2>&1 || cp $$< $$@
trace/trace-$2.c-timestamp: $(SRC_PATH)/$1/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--group=$(call trace-group-name,$@) \
--group=$2 \
--format=c \
--backends=$(TRACE_BACKENDS) \
$< > $@,"GEN","$(@:%-timestamp=%)")
$$< > $$@,"GEN","$$(@:%-timestamp=%)")
endef
%/trace-ust.h: %/trace-ust.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
@ -222,18 +226,18 @@ tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
%/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
trace-root.h: trace-root.h-timestamp
trace/trace-root.h: trace/trace-root.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
trace-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
trace/trace-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--group=root \
--format=h \
--backends=$(TRACE_BACKENDS) \
$< > $@,"GEN","$(@:%-timestamp=%)")
trace-root.c: trace-root.c-timestamp
trace/trace-root.c: trace/trace-root.c-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
trace-root.c-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
trace/trace-root.c-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--group=root \
--format=c \
@ -477,6 +481,12 @@ dummy := $(call unnest-vars,, \
common-obj-m \
trace-obj-y)
dummy := $(foreach DIR,$(trace-events-subdirs),$(eval $(call __trace_rules,$(DIR),$(call trace-group-suffix,$(DIR)))))
generated-files-y += $(TRACE_HEADERS)
generated-files-y += $(TRACE_SOURCES)
include $(SRC_PATH)/tests/Makefile.include
all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules $(vhost-user-json-y)

1
Makefile.objs

@ -209,7 +209,6 @@ trace-events-subdirs += util
trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
trace-obj-y = trace-root.o
trace-obj-y += $(trace-events-subdirs:%=%/trace.o)
trace-obj-$(CONFIG_TRACE_UST) += trace-ust-all.o
trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace-root.o
trace-obj-$(CONFIG_TRACE_DTRACE) += $(trace-events-subdirs:%=%/trace-dtrace.o)

1
accel/kvm/trace.h

@ -0,0 +1 @@
#include "trace/trace-accel_kvm.h"

2
accel/tcg/cputlb.c

@ -34,7 +34,7 @@
#include "qemu/atomic.h"
#include "qemu/atomic128.h"
#include "translate-all.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "trace/mem.h"
#ifdef CONFIG_PLUGIN
#include "qemu/plugin-memory.h"

1
accel/tcg/trace.h

@ -0,0 +1 @@
#include "trace/trace-accel_tcg.h"

2
accel/tcg/user-exec.c

@ -26,7 +26,7 @@
#include "translate-all.h"
#include "exec/helper-proto.h"
#include "qemu/atomic128.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "trace/mem.h"
#undef EAX

1
audio/trace.h

@ -0,0 +1 @@
#include "trace/trace-audio.h"

1
authz/trace.h

@ -0,0 +1 @@
#include "trace/trace-authz.h"

1
backends/tpm/trace.h

@ -0,0 +1 @@
#include "trace/trace-backends_tpm.h"

1
backends/trace.h

@ -0,0 +1 @@
#include "trace/trace-backends.h"

1
block/trace.h

@ -0,0 +1 @@
#include "trace/trace-block.h"

1
chardev/trace.h

@ -0,0 +1 @@
#include "trace/trace-chardev.h"

1
crypto/trace.h

@ -0,0 +1 @@
#include "trace/trace-crypto.h"

2
dma-helpers.c

@ -10,7 +10,7 @@
#include "qemu/osdep.h"
#include "sysemu/block-backend.h"
#include "sysemu/dma.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "qemu/thread.h"
#include "qemu/main-loop.h"
#include "sysemu/cpus.h"

2
exec.c

@ -50,7 +50,7 @@
#include "sysemu/hw_accel.h"
#include "exec/address-spaces.h"
#include "sysemu/xen-mapcache.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#ifdef CONFIG_FALLOCATE_PUNCH_HOLE
#include <linux/falloc.h>

2
gdbstub.c

@ -30,7 +30,7 @@
#include "qemu/ctype.h"
#include "qemu/cutils.h"
#include "qemu/module.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#ifdef CONFIG_USER_ONLY
#include "qemu.h"
#else

1
hw/9pfs/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_9pfs.h"

1
hw/acpi/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_acpi.h"

1
hw/alpha/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_alpha.h"

1
hw/arm/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_arm.h"

1
hw/audio/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_audio.h"

1
hw/block/dataplane/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_block_dataplane.h"

1
hw/block/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_block.h"

1
hw/char/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_char.h"

2
hw/core/cpu.c

@ -31,7 +31,7 @@
#include "sysemu/tcg.h"
#include "hw/boards.h"
#include "hw/qdev-properties.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "qemu/plugin.h"
CPUInterruptHandler cpu_interrupt_handler;

1
hw/core/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_core.h"

1
hw/display/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_display.h"

1
hw/dma/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_dma.h"

1
hw/gpio/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_gpio.h"

1
hw/hppa/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_hppa.h"

1
hw/hyperv/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_hyperv.h"

1
hw/i2c/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_i2c.h"

1
hw/i386/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_i386.h"

1
hw/i386/xen/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_i386_xen.h"

1
hw/ide/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_ide.h"

1
hw/input/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_input.h"

1
hw/intc/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_intc.h"

1
hw/isa/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_isa.h"

1
hw/mem/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_mem.h"

1
hw/mips/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_mips.h"

1
hw/misc/macio/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_misc_macio.h"

1
hw/misc/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_misc.h"

1
hw/net/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_net.h"

1
hw/nvram/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_nvram.h"

1
hw/pci-host/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_pci_host.h"

1
hw/pci/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_pci.h"

1
hw/ppc/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_ppc.h"

1
hw/rdma/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_rdma.h"

1
hw/rdma/vmw/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_rdma_vmw.h"

1
hw/riscv/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_riscv.h"

1
hw/rtc/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_rtc.h"

1
hw/s390x/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_s390x.h"

1
hw/scsi/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_scsi.h"

1
hw/sd/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_sd.h"

1
hw/sparc/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_sparc.h"

1
hw/sparc64/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_sparc64.h"

1
hw/ssi/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_ssi.h"

1
hw/timer/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_timer.h"

1
hw/tpm/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_tpm.h"

1
hw/usb/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_usb.h"

1
hw/vfio/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_vfio.h"

1
hw/virtio/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_virtio.h"

1
hw/watchdog/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_watchdog.h"

1
hw/xen/trace.h

@ -0,0 +1 @@
#include "trace/trace-hw_xen.h"

2
include/user/syscall-trace.h

@ -10,7 +10,7 @@
#ifndef _SYSCALL_TRACE_H_
#define _SYSCALL_TRACE_H_
#include "trace-root.h"
#include "trace/trace-root.h"
/*
* These helpers just provide a common place for the various

1
io/trace.h

@ -0,0 +1 @@
#include "trace/trace-io.h"

2
job-qmp.c

@ -27,7 +27,7 @@
#include "qemu/job.h"
#include "qapi/qapi-commands-job.h"
#include "qapi/error.h"
#include "trace-root.h"
#include "trace/trace-root.h"
/* Get a job using its ID and acquire its AioContext */
static Job *find_job(const char *id, AioContext **aio_context, Error **errp)

2
job.c

@ -29,7 +29,7 @@
#include "qemu/id.h"
#include "qemu/main-loop.h"
#include "block/aio-wait.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "qapi/qapi-events-job.h"
static QLIST_HEAD(, Job) jobs = QLIST_HEAD_INITIALIZER(jobs);

1
linux-user/trace.h

@ -0,0 +1 @@
#include "trace/trace-linux_user.h"

1
migration/trace.h

@ -0,0 +1 @@
#include "trace/trace-migration.h"

1
monitor/trace.h

@ -0,0 +1 @@
#include "trace/trace-monitor.h"

1
nbd/trace.h

@ -0,0 +1 @@
#include "trace/trace-nbd.h"

1
net/trace.h

@ -0,0 +1 @@
#include "trace/trace-net.h"

1
qapi/trace.h

@ -0,0 +1 @@
#include "trace/trace-qapi.h"

1
qom/trace.h

@ -0,0 +1 @@
#include "trace/trace-qom.h"

5
scripts/tracetool/format/c.py

@ -19,10 +19,7 @@ def generate(events, backend, group):
active_events = [e for e in events
if "disable" not in e.properties]
if group == "root":
header = "trace-root.h"
else:
header = "trace.h"
header = "trace-" + group + ".h"
out('/* This file is autogenerated by tracetool, do not edit. */',
'',

2
scripts/tracetool/format/tcg_h.py

@ -28,7 +28,7 @@ def vcpu_transform_args(args):
def generate(events, backend, group):
if group == "root":
header = "trace-root.h"
header = "trace/trace-root.h"
else:
header = "trace.h"

2
scripts/tracetool/format/tcg_helper_c.py

@ -41,7 +41,7 @@ def vcpu_transform_args(args, mode):
def generate(events, backend, group):
if group == "root":
header = "trace-root.h"
header = "trace/trace-root.h"
else:
header = "trace.h"

1
scsi/trace.h

@ -0,0 +1 @@
#include "trace/trace-scsi.h"

2
softmmu/balloon.c

@ -28,7 +28,7 @@
#include "qemu/atomic.h"
#include "sysemu/kvm.h"
#include "sysemu/balloon.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-misc.h"
#include "qapi/qmp/qerror.h"

2
softmmu/ioport.c

@ -28,7 +28,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "exec/ioport.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "exec/memory.h"
#include "exec/address-spaces.h"

2
softmmu/memory.c

@ -24,7 +24,7 @@
#include "qemu/main-loop.h"
#include "qemu/qemu-print.h"
#include "qom/object.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "exec/memory-internal.h"
#include "exec/ram_addr.h"

2
softmmu/vl.c

@ -90,7 +90,7 @@
#include "disas/disas.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "trace/control.h"
#include "qemu/plugin.h"
#include "qemu/queue.h"

1
target/arm/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_arm.h"

1
target/hppa/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_hppa.h"

1
target/i386/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_i386.h"

1
target/mips/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_mips.h"

1
target/ppc/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_ppc.h"

1
target/riscv/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_riscv.h"

1
target/s390x/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_s390x.h"

1
target/sparc/trace.h

@ -0,0 +1 @@
#include "trace/trace-target_sparc.h"

2
trace/control-target.c

@ -9,7 +9,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "trace-root.h"
#include "trace/trace-root.h"
#include "trace/control.h"

2
trace/control.c

@ -27,7 +27,7 @@
#include "qemu/error-report.h"
#include "qemu/config-file.h"
#include "monitor/monitor.h"
#include "trace-root.h"
#include "trace/trace-root.h"
int trace_events_enabled_count;

1
ui/trace.h

@ -0,0 +1 @@
#include "trace/trace-ui.h"

1
util/trace.h

@ -0,0 +1 @@
#include "trace/trace-util.h"
Loading…
Cancel
Save