Skip to contentSkip to conversation

trace: Remove trace.h from console.h (less dependencies)

PATCH Applied Stefan Weil 2 participants 3 messages Nov 10, 2013 – Nov 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 trace: Remove trace.h from console.h (less dependencies)

This reduces the dependencies on trace.h.
Only two source files which need console.h also need trace.h.

---

Without this patch, 449 .o files depend on trace.h and must be rebuild whenever the file trace-events is changed.

The patch reduces this number to 382 for the default QEMU build.

 hw/display/vmware_vga.c |    1 +
 include/ui/console.h    |    1 -
 ui/console.c            |    1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
hw/display/vmware_vga.c +1 -0
index a6a8cdc..aba292c 100644
@@ -23,6 +23,7 @@
  */
 #include "hw/hw.h"
 #include "hw/loader.h"
+#include "trace.h"
 #include "ui/console.h"
 #include "hw/pci/pci.h"
 
include/ui/console.h +0 -1
index 98edf41..4156a87 100644
@@ -6,7 +6,6 @@
 #include "qapi/qmp/qdict.h"
 #include "qemu/notify.h"
 #include "monitor/monitor.h"
-#include "trace.h"
 #include "qapi-types.h"
 #include "qapi/error.h"
 
ui/console.c +1 -0
index aad4fc9..11d5e6a 100644
@@ -27,6 +27,7 @@
 #include "qemu/timer.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
+#include "trace.h"
 
 //#define DEBUG_CONSOLE
 #define DEFAULT_BACKSCROLL 512
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/2 trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies)

This reduces the dependencies on trace.h.
Only one source file which needs hcd-ehci.h also needs trace.h.

---

This patch reduces the number of .o files which depend on trace.h in a default QEMU build from 382 to 379.

That's not a big reduction, but now there is no longer a .h file which directly includes trace.h, so future improvements (splitting trace headers, one header per source file, no longer compile 379 files after each change of trace-events) are easier to implement.

 hw/usb/hcd-ehci.c |    1 +
 hw/usb/hcd-ehci.h |    1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
hw/usb/hcd-ehci.c +1 -0
index 22bdbf4..0ba38c9 100644
@@ -28,6 +28,7 @@
  */
 
 #include "hw/usb/hcd-ehci.h"
+#include "trace.h"
 
 /* Capability Registers Base Address - section 2.2 */
 #define CAPLENGTH        0x0000  /* 1-byte, 0x0001 reserved */
hw/usb/hcd-ehci.h +0 -1
index 065c9fa..1ad4b96 100644
@@ -21,7 +21,6 @@
 #include "qemu/timer.h"
 #include "hw/usb.h"
 #include "monitor/monitor.h"
-#include "trace.h"
 #include "sysemu/dma.h"
 #include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
Signature · 1 line
1.7.9.5
#2 lore raw
In reply to Stefan Weil
Quoted 2 lines · Stefan Weil

This reduces the dependencies on trace.h.
Only two source files which need console.h also need trace.h.

Thanks, applied both patches to the trivial patches queue, after actually verifying that the result is sane ;)

/mjt