Kbuild: Introduce QEMU_PIPE option

If set, 'make qemu' will direct its console output to a named pipe and
disable the interactive monitor. Intended for use with the new sanity
check system which will parallelize test execution.

Change-Id: I902f77c02ed3f210891ff13147afea890e64d9c1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2015-07-16 10:59:01 -07:00 committed by Anas Nashif
commit 84fed36539
4 changed files with 15 additions and 3 deletions

View file

@ -1161,8 +1161,16 @@ tools/%: FORCE
QEMU_FLAGS = $(QEMU_FLAGS_$(SRCARCH)) -pidfile qemu.pid
ifneq ($(QEMU_PIPE),)
# Send console output to a pipe and disable the interactive monitor,
# used for running automated sanity tests
QEMU_FLAGS += -serial pipe:$(QEMU_PIPE) -monitor none
else
QEMU_FLAGS += -serial mon:stdio
endif
qemu: zephyr
@echo "To exit from QEMU enter: 'CTRL+a, x'"
$(if $(QEMU_PIPE),,@echo "To exit from QEMU enter: 'CTRL+a, x'")
@echo '[QEMU] CPU: $(QEMU_CPU_TYPE_$(SRCARCH))'
$(Q)$(QEMU) $(QEMU_FLAGS) $(QEMU_EXTRA_FLAGS) -kernel $(KERNEL_NAME).elf

View file

@ -497,6 +497,10 @@ Make Modifiers
* **make O=dir [targets]** Locates all output files in **dir**,
including :file:`.config.`.
* **make QEMU_PIPE=pipe qemu** When running QEMU, direct all its console
output to the specified UNIX pipe instead of stdout. The interactive monitor
is disabled in this mode.
Setting Up a Toolchain
**********************

View file

@ -12,7 +12,7 @@ arm_FLAGS += $(LTO_FLAG-$(CONFIG_LTO))
QEMU_CPU_TYPE_arm = cortex-m3
QEMU_FLAGS_arm = -cpu $(QEMU_CPU_TYPE_arm) \
-machine lm3s6965evb -nographic -serial mon:stdio
-machine lm3s6965evb -nographic
QEMU_arm = qemu-system-arm
export QEMU_FLAGS_arm QEMU_arm

View file

@ -27,7 +27,7 @@ QEMU_FLAGS_x86 = -m 32 -cpu $(QEMU_CPU_TYPE_x86) \
-no-reboot -nographic -display none -net none \
-clock dynticks -no-acpi -balloon none -no-hpet \
-L $(QEMU_BIOS) -bios bios.bin \
-serial mon:stdio -machine type=pc-0.14
-machine type=pc-0.14
QEMU_x86 = qemu-system-i386
export ISA_FLAG_x86 QEMU_FLAGS_x86 QEMU_x86 QEMU_CPU_TYPE_x86