[Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment

Philippe Mathieu-Daudé posted 1 patch 4 years, 10 months ago
Test docker-clang@ubuntu passed
Test s390x passed
Test asan failed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190703171005.26231-1-philmd@redhat.com
Maintainers: Stefan Hajnoczi <stefanha@redhat.com>
trace/control.c | 9 +++++++++
1 file changed, 9 insertions(+)
[Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
We can pass trace trace options with the -trace command line
argument.

Tracing might be useful when running qtests. To avoid to have
to modify the tests and recompile, add the possibility to pass
trace options via the shell environment.

We add:
- QEMU_TRACE_EVENTS:    List of events to enable (coma separated)
- QEMU_TRACE_EVENTFILE: File with list of events to enable
- QEMU_TRACE_LOGFILE:   File to log the trace events.

Example of use:

  $ QEMU_TRACE_EVENTS=pl011\* make check-qtest-arm
    TEST    check-qtest-arm: tests/boot-serial-test
  18650@1562168430.027490:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
  18650@1562168430.027535:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
  18650@1562168430.027544:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
  18650@1562168430.028037:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
  18650@1562168430.028049:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
  18650@1562168430.028057:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
  18653@1562168430.053250:pl011_write addr 0x00000000 value 0x00000054
  18653@1562168430.053276:pl011_irq_state irq state 0
  [...]

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
I'm not sure where to document that...
---
 trace/control.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/trace/control.c b/trace/control.c
index 43fb7868db..aea802623c 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -288,6 +288,8 @@ void trace_fini_vcpu(CPUState *vcpu)
 
 bool trace_init_backends(void)
 {
+    char *trace_env;
+
 #ifdef CONFIG_TRACE_SIMPLE
     if (!st_init()) {
         fprintf(stderr, "failed to initialize simple tracing backend.\n");
@@ -306,6 +308,13 @@ bool trace_init_backends(void)
     openlog(NULL, LOG_PID, LOG_DAEMON);
 #endif
 
+    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
+    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
+    trace_env = getenv("QEMU_TRACE_EVENTS");
+    if (trace_env) {
+        trace_enable_events(trace_env);
+    }
+
     return true;
 }
 
-- 
2.20.1


Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by no-reply@patchew.org 4 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/20190703171005.26231-1-philmd@redhat.com/



Hi,

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

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

PASS 9 check-qjson /literals/interpolation/unkown
PASS 10 check-qjson /literals/interpolation/string
PASS 11 check-qjson /dicts/simple_dict
==7812==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 fdc-test /x86_64/fdc/media_change
PASS 5 fdc-test /x86_64/fdc/sense_interrupt
PASS 6 fdc-test /x86_64/fdc/relative_seek
---
PASS 32 test-opts-visitor /visitor/opts/range/beyond
PASS 33 test-opts-visitor /visitor/opts/dict/unvisited
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-coroutine -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-coroutine" 
==7866==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7866==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffff213c000; bottom 0x7f0d6cff8000; size: 0x00f285144000 (1041614782464)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-coroutine /basic/no-dangling-access
---
PASS 11 test-aio /aio/event/wait
PASS 12 test-aio /aio/event/flush
PASS 13 test-aio /aio/event/wait/no-flush-cb
==7882==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 test-aio /aio/timer/schedule
PASS 15 test-aio /aio/coroutine/queue-chaining
PASS 16 test-aio /aio-gsource/flush
---
PASS 27 test-aio /aio-gsource/event/wait/no-flush-cb
PASS 28 test-aio /aio-gsource/timer/schedule
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-aio-multithread -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-aio-multithread" 
==7888==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 fdc-test /x86_64/fdc/read_no_dma_19
PASS 1 test-aio-multithread /aio/multi/lifecycle
PASS 13 fdc-test /x86_64/fdc/fuzz-registers
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/ide-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="ide-test" 
PASS 2 test-aio-multithread /aio/multi/schedule
==7906==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 ide-test /x86_64/ide/identify
PASS 3 test-aio-multithread /aio/multi/mutex/contended
==7917==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 ide-test /x86_64/ide/flush
==7928==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 ide-test /x86_64/ide/bmdma/simple_rw
==7934==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 ide-test /x86_64/ide/bmdma/trim
PASS 4 test-aio-multithread /aio/multi/mutex/handoff
==7940==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 ide-test /x86_64/ide/bmdma/short_prdt
PASS 5 test-aio-multithread /aio/multi/mutex/mcs
==7951==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 ide-test /x86_64/ide/bmdma/one_sector_short_prdt
PASS 6 test-aio-multithread /aio/multi/mutex/pthread
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-throttle -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-throttle" 
==7965==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-throttle /throttle/leak_bucket
PASS 2 test-throttle /throttle/compute_wait
PASS 3 test-throttle /throttle/init
---
PASS 13 test-throttle /throttle/config/ranges
PASS 14 test-throttle /throttle/config/max
PASS 15 test-throttle /throttle/config/iops_size
==7962==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-thread-pool -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-thread-pool" 
PASS 7 ide-test /x86_64/ide/bmdma/long_prdt
==7975==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-thread-pool /thread-pool/submit
PASS 2 test-thread-pool /thread-pool/submit-aio
PASS 3 test-thread-pool /thread-pool/submit-co
PASS 4 test-thread-pool /thread-pool/submit-many
==7977==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7977==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc63e1a000; bottom 0x7fa1797fe000; size: 0x005aea61c000 (390479331328)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 8 ide-test /x86_64/ide/bmdma/no_busmaster
PASS 5 test-thread-pool /thread-pool/cancel
PASS 9 ide-test /x86_64/ide/flush/nodev
==8053==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 ide-test /x86_64/ide/flush/empty_drive
==8058==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 test-thread-pool /thread-pool/cancel-async
PASS 11 ide-test /x86_64/ide/flush/retry_pci
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-hbitmap -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-hbitmap" 
---
PASS 2 test-hbitmap /hbitmap/size/0
PASS 3 test-hbitmap /hbitmap/size/unaligned
PASS 4 test-hbitmap /hbitmap/iter/empty
==8065==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 test-hbitmap /hbitmap/iter/partial
PASS 12 ide-test /x86_64/ide/flush/retry_isa
PASS 6 test-hbitmap /hbitmap/iter/granularity
---
PASS 12 test-hbitmap /hbitmap/set/two-elem
PASS 13 test-hbitmap /hbitmap/set/general
PASS 14 test-hbitmap /hbitmap/set/twice
==8076==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 test-hbitmap /hbitmap/set/overlap
PASS 16 test-hbitmap /hbitmap/reset/empty
PASS 13 ide-test /x86_64/ide/cdrom/pio
PASS 17 test-hbitmap /hbitmap/reset/general
==8082==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 18 test-hbitmap /hbitmap/reset/all
PASS 19 test-hbitmap /hbitmap/truncate/nop
PASS 20 test-hbitmap /hbitmap/truncate/grow/negligible
---
PASS 29 test-hbitmap /hbitmap/truncate/shrink/large
PASS 30 test-hbitmap /hbitmap/meta/zero
PASS 14 ide-test /x86_64/ide/cdrom/pio_large
==8088==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 ide-test /x86_64/ide/cdrom/dma
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/ahci-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="ahci-test" 
==8102==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 ahci-test /x86_64/ahci/sanity
PASS 31 test-hbitmap /hbitmap/meta/one
PASS 32 test-hbitmap /hbitmap/meta/byte
PASS 33 test-hbitmap /hbitmap/meta/word
==8108==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 ahci-test /x86_64/ahci/pci_spec
PASS 34 test-hbitmap /hbitmap/meta/sector
PASS 35 test-hbitmap /hbitmap/serialize/align
==8114==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 ahci-test /x86_64/ahci/pci_enable
==8120==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 ahci-test /x86_64/ahci/hba_spec
PASS 36 test-hbitmap /hbitmap/serialize/basic
PASS 37 test-hbitmap /hbitmap/serialize/part
PASS 38 test-hbitmap /hbitmap/serialize/zeroes
PASS 39 test-hbitmap /hbitmap/next_zero/next_zero_0
PASS 40 test-hbitmap /hbitmap/next_zero/next_zero_4
==8126==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 41 test-hbitmap /hbitmap/next_dirty_area/next_dirty_area_0
PASS 42 test-hbitmap /hbitmap/next_dirty_area/next_dirty_area_1
PASS 43 test-hbitmap /hbitmap/next_dirty_area/next_dirty_area_4
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bdrv-drain -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bdrv-drain" 
==8133==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bdrv-drain /bdrv-drain/nested
PASS 2 test-bdrv-drain /bdrv-drain/multiparent
PASS 3 test-bdrv-drain /bdrv-drain/set_aio_context
---
PASS 38 test-bdrv-drain /bdrv-drain/detach/driver_cb
PASS 39 test-bdrv-drain /bdrv-drain/attach/drain
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bdrv-graph-mod -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bdrv-graph-mod" 
==8164==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8175==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bdrv-graph-mod /bdrv-graph-mod/update-perm-tree
PASS 2 test-bdrv-graph-mod /bdrv-graph-mod/should-update-child
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-blockjob -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-blockjob" 
==8184==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-blockjob /blockjob/ids
PASS 2 test-blockjob /blockjob/cancel/created
PASS 3 test-blockjob /blockjob/cancel/running
---
PASS 8 test-blockjob /blockjob/cancel/concluded
PASS 6 ahci-test /x86_64/ahci/identify
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-blockjob-txn -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-blockjob-txn" 
==8191==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-blockjob-txn /single/success
PASS 2 test-blockjob-txn /single/failure
PASS 3 test-blockjob-txn /single/cancel
---
PASS 5 test-blockjob-txn /pair/failure
PASS 6 test-blockjob-txn /pair/cancel
PASS 7 test-blockjob-txn /pair/fail-cancel-race
==8189==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-block-backend -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-block-backend" 
==8200==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-block-backend /block-backend/drain_aio_error
PASS 2 test-block-backend /block-backend/drain_all_aio_error
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-block-iothread -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-block-iothread" 
PASS 7 ahci-test /x86_64/ahci/max
==8206==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-block-iothread /sync-op/pread
PASS 2 test-block-iothread /sync-op/pwrite
PASS 3 test-block-iothread /sync-op/load_vmstate
---
PASS 15 test-block-iothread /propagate/diamond
PASS 16 test-block-iothread /propagate/mirror
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-image-locking -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-image-locking" 
==8208==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8228==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-image-locking /image-locking/basic
PASS 2 test-image-locking /image-locking/set-perm-abort
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-x86-cpuid -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-x86-cpuid" 
---
PASS 4 test-xbzrle /xbzrle/encode_decode_1_byte
PASS 5 test-xbzrle /xbzrle/encode_decode_overflow
PASS 8 ahci-test /x86_64/ahci/reset
==8244==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 test-xbzrle /xbzrle/encode_decode
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-vmstate -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-vmstate" 
==8244==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffffcdda000; bottom 0x7f10381fe000; size: 0x00efc4bdc000 (1029797953536)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-vmstate /vmstate/tmp_struct
---
PASS 9 test-int128 /int128/int128_gt
PASS 10 test-int128 /int128/int128_rshift
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/rcutorture -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="rcutorture" 
==8268==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8268==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe9152b000; bottom 0x7f2b8cffe000; size: 0x00d30452d000 (906310635520)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 10 ahci-test /x86_64/ahci/io/pio/lba28/simple/low
PASS 1 rcutorture /rcu/torture/1reader
==8289==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8289==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc94c22000; bottom 0x7f27c3dfe000; size: 0x00d4d0e24000 (914037555200)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 11 ahci-test /x86_64/ahci/io/pio/lba28/simple/high
PASS 2 rcutorture /rcu/torture/10readers
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-list -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-list" 
==8311==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8311==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff0218e000; bottom 0x7fd3d31fe000; size: 0x002b2ef90000 (185471664128)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-rcu-list /rcu/qlist/single-threaded
PASS 12 ahci-test /x86_64/ahci/io/pio/lba28/double/zero
==8330==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8330==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffe1ae4000; bottom 0x7f65977fe000; size: 0x009a4a2e6000 (662669516800)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 2 test-rcu-list /rcu/qlist/short-few
PASS 13 ahci-test /x86_64/ahci/io/pio/lba28/double/low
==8357==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8357==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe0d61e000; bottom 0x7fd5693fe000; size: 0x0028a4220000 (174552383488)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 14 ahci-test /x86_64/ahci/io/pio/lba28/double/high
==8363==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-rcu-list /rcu/qlist/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-simpleq -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-simpleq" 
==8363==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd71e44000; bottom 0x7fb633b24000; size: 0x00473e320000 (305986142208)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-rcu-simpleq /rcu/qsimpleq/single-threaded
PASS 15 ahci-test /x86_64/ahci/io/pio/lba28/long/zero
PASS 2 test-rcu-simpleq /rcu/qsimpleq/short-few
==8382==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8382==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe8c61d000; bottom 0x7f2fd1bfe000; size: 0x00cebaa1f000 (887894437888)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 16 ahci-test /x86_64/ahci/io/pio/lba28/long/low
==8409==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-rcu-simpleq /rcu/qsimpleq/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-tailq -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-tailq" 
==8409==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe4fe1f000; bottom 0x7f127b1fe000; size: 0x00ebd4c21000 (1012886802432)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 17 ahci-test /x86_64/ahci/io/pio/lba28/long/high
PASS 1 test-rcu-tailq /rcu/qtailq/single-threaded
==8422==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 18 ahci-test /x86_64/ahci/io/pio/lba28/short/zero
PASS 2 test-rcu-tailq /rcu/qtailq/short-few
==8434==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 19 ahci-test /x86_64/ahci/io/pio/lba28/short/low
==8461==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 20 ahci-test /x86_64/ahci/io/pio/lba28/short/high
PASS 3 test-rcu-tailq /rcu/qtailq/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qdist -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qdist" 
==8467==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-qdist /qdist/none
PASS 2 test-qdist /qdist/pr
PASS 3 test-qdist /qdist/single/empty
---
PASS 7 test-qdist /qdist/binning/expand
PASS 8 test-qdist /qdist/binning/shrink
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qht -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qht" 
==8467==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff64f34000; bottom 0x7f8804dfe000; size: 0x007760136000 (512712990720)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 21 ahci-test /x86_64/ahci/io/pio/lba48/simple/zero
==8482==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8482==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffced976000; bottom 0x7f45f4dfe000; size: 0x00b6f8b78000 (785856823296)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 22 ahci-test /x86_64/ahci/io/pio/lba48/simple/low
==8488==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8488==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe8f92b000; bottom 0x7f673cbfe000; size: 0x009752d2d000 (649929609216)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 23 ahci-test /x86_64/ahci/io/pio/lba48/simple/high
==8494==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8494==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff2e4b0000; bottom 0x7f0a83ffe000; size: 0x00f4aa4b2000 (1050829070336)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 24 ahci-test /x86_64/ahci/io/pio/lba48/double/zero
==8500==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8500==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff55f65000; bottom 0x7f7c07ffe000; size: 0x00834df67000 (563948711936)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 25 ahci-test /x86_64/ahci/io/pio/lba48/double/low
==8506==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8506==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe32980000; bottom 0x7f472a7fe000; size: 0x00b708182000 (786114813952)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 26 ahci-test /x86_64/ahci/io/pio/lba48/double/high
==8512==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8512==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe0911d000; bottom 0x7f4bbcf24000; size: 0x00b24c1f9000 (765781315584)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 27 ahci-test /x86_64/ahci/io/pio/lba48/long/zero
==8518==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8518==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc1e92c000; bottom 0x7f00af9fe000; size: 0x00fb6ef2e000 (1079898202112)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 28 ahci-test /x86_64/ahci/io/pio/lba48/long/low
==8524==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8524==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd4c926000; bottom 0x7f489c924000; size: 0x00b4b0002000 (776046911488)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 29 ahci-test /x86_64/ahci/io/pio/lba48/long/high
==8530==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 30 ahci-test /x86_64/ahci/io/pio/lba48/short/zero
==8536==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 31 ahci-test /x86_64/ahci/io/pio/lba48/short/low
==8542==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-qht /qht/mode/default
PASS 2 test-qht /qht/mode/resize
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qht-par -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qht-par" 
PASS 32 ahci-test /x86_64/ahci/io/pio/lba48/short/high
==8555==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-qht-par /qht/parallel/2threads-0%updates-1s
PASS 33 ahci-test /x86_64/ahci/io/dma/lba28/fragmented
==8571==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-qht-par /qht/parallel/2threads-20%updates-1s
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bitops -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bitops" 
PASS 1 test-bitops /bitops/sextract32
---
PASS 3 test-qdev-global-props /qdev/properties/dynamic/global
PASS 4 test-qdev-global-props /qdev/properties/global/subclass
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/check-qom-interface -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="check-qom-interface" 
==8587==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 check-qom-interface /qom/interface/direct_impl
PASS 2 check-qom-interface /qom/interface/intermediate_impl
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/check-qom-proplist -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="check-qom-proplist" 
---
PASS 9 test-keyval /keyval/visit/alternate
PASS 10 test-keyval /keyval/visit/any
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-write-threshold -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-write-threshold" 
==8617==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-write-threshold /write-threshold/not-set-on-init
PASS 2 test-write-threshold /write-threshold/set-get
PASS 3 test-write-threshold /write-threshold/multi-set-get
---
PASS 27 test-crypto-cipher /crypto/cipher/null-iv
PASS 28 test-crypto-cipher /crypto/cipher/short-plaintext
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-secret -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-secret" 
==8641==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-secret /crypto/secret/direct
PASS 2 test-crypto-secret /crypto/secret/indirect/good
PASS 3 test-crypto-secret /crypto/secret/indirect/badfile
---
PASS 16 test-crypto-secret /crypto/secret/crypt/badiv
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-tlscredsx509 -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-tlscredsx509" 
PASS 37 ahci-test /x86_64/ahci/io/dma/lba28/simple/high
==8661==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 38 ahci-test /x86_64/ahci/io/dma/lba28/double/zero
PASS 1 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectserver
PASS 2 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectclient
==8667==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca1
PASS 39 ahci-test /x86_64/ahci/io/dma/lba28/double/low
PASS 4 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca2
==8673==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca3
PASS 6 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca1
PASS 7 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca2
PASS 8 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca3
PASS 40 ahci-test /x86_64/ahci/io/dma/lba28/double/high
PASS 9 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver1
==8679==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver2
PASS 11 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver3
PASS 41 ahci-test /x86_64/ahci/io/dma/lba28/long/zero
PASS 12 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver4
PASS 13 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver5
==8685==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 42 ahci-test /x86_64/ahci/io/dma/lba28/long/low
PASS 14 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver6
PASS 15 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver7
---
PASS 32 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive1
PASS 33 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive2
PASS 34 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive3
==8691==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 43 ahci-test /x86_64/ahci/io/dma/lba28/long/high
PASS 35 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain1
PASS 36 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain2
---
PASS 38 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/missingserver
PASS 39 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/missingclient
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-tlssession -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-tlssession" 
==8697==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-tlssession /qcrypto/tlssession/psk
PASS 44 ahci-test /x86_64/ahci/io/dma/lba28/short/zero
==8708==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 45 ahci-test /x86_64/ahci/io/dma/lba28/short/low
==8714==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 46 ahci-test /x86_64/ahci/io/dma/lba28/short/high
==8720==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-crypto-tlssession /qcrypto/tlssession/basicca
PASS 3 test-crypto-tlssession /qcrypto/tlssession/differentca
PASS 47 ahci-test /x86_64/ahci/io/dma/lba48/simple/zero
==8726==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 test-crypto-tlssession /qcrypto/tlssession/altname1
PASS 5 test-crypto-tlssession /qcrypto/tlssession/altname2
PASS 48 ahci-test /x86_64/ahci/io/dma/lba48/simple/low
==8732==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 49 ahci-test /x86_64/ahci/io/dma/lba48/simple/high
==8738==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 test-crypto-tlssession /qcrypto/tlssession/altname3
PASS 50 ahci-test /x86_64/ahci/io/dma/lba48/double/zero
PASS 7 test-crypto-tlssession /qcrypto/tlssession/altname4
==8744==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 51 ahci-test /x86_64/ahci/io/dma/lba48/double/low
==8750==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 test-crypto-tlssession /qcrypto/tlssession/altname5
PASS 9 test-crypto-tlssession /qcrypto/tlssession/altname6
PASS 52 ahci-test /x86_64/ahci/io/dma/lba48/double/high
PASS 10 test-crypto-tlssession /qcrypto/tlssession/wildcard1
==8756==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 53 ahci-test /x86_64/ahci/io/dma/lba48/long/zero
==8762==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 54 ahci-test /x86_64/ahci/io/dma/lba48/long/low
==8768==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 test-crypto-tlssession /qcrypto/tlssession/wildcard2
PASS 12 test-crypto-tlssession /qcrypto/tlssession/wildcard3
PASS 55 ahci-test /x86_64/ahci/io/dma/lba48/long/high
PASS 13 test-crypto-tlssession /qcrypto/tlssession/wildcard4
==8774==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 test-crypto-tlssession /qcrypto/tlssession/wildcard5
PASS 56 ahci-test /x86_64/ahci/io/dma/lba48/short/zero
PASS 15 test-crypto-tlssession /qcrypto/tlssession/wildcard6
==8780==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 57 ahci-test /x86_64/ahci/io/dma/lba48/short/low
PASS 16 test-crypto-tlssession /qcrypto/tlssession/cachain
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qga -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qga" 
==8786==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 58 ahci-test /x86_64/ahci/io/dma/lba48/short/high
PASS 1 test-qga /qga/sync-delimited
PASS 2 test-qga /qga/sync
---
PASS 15 test-qga /qga/invalid-cmd
PASS 16 test-qga /qga/invalid-args
PASS 17 test-qga /qga/fsfreeze-status
==8798==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 59 ahci-test /x86_64/ahci/io/ncq/simple
PASS 18 test-qga /qga/blacklist
PASS 19 test-qga /qga/config
PASS 20 test-qga /qga/guest-exec
PASS 21 test-qga /qga/guest-exec-invalid
==8805==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 60 ahci-test /x86_64/ahci/io/ncq/retry
PASS 22 test-qga /qga/guest-get-osinfo
PASS 23 test-qga /qga/guest-get-host-name
PASS 24 test-qga /qga/guest-get-timezone
PASS 25 test-qga /qga/guest-get-users
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-timed-average -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-timed-average" 
==8818==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-timed-average /timed-average/average
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-util-filemonitor -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-util-filemonitor" 
PASS 1 test-util-filemonitor /util/filemonitor
---
PASS 5 test-authz-list /auth/list/explicit/deny
PASS 6 test-authz-list /auth/list/explicit/allow
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-authz-listfile -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-authz-listfile" 
==8847==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-authz-listfile /auth/list/complex
PASS 2 test-authz-listfile /auth/list/default/deny
PASS 3 test-authz-listfile /auth/list/default/allow
---
PASS 4 test-io-channel-file /io/channel/pipe/sync
PASS 5 test-io-channel-file /io/channel/pipe/async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-tls -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-tls" 
==8912==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8930==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-io-channel-tls /qio/channel/tls/basic
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-command -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-command" 
PASS 1 test-io-channel-command /io/channel/command/fifo/sync
---
PASS 8 test-crypto-ivgen /crypto/ivgen/essiv/1f2e3d4c
PASS 9 test-crypto-ivgen /crypto/ivgen/essiv/1f2e3d4c5b6a7988
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-afsplit -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-afsplit" 
==8962==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-afsplit /crypto/afsplit/sha256/5
PASS 2 test-crypto-afsplit /crypto/afsplit/sha256/5000
PASS 3 test-crypto-afsplit /crypto/afsplit/sha256/big
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-block -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-block" 
PASS 1 test-crypto-block /crypto/block/qcow
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-logging -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-logging" 
==8986==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-logging /logging/parse_range
PASS 2 test-logging /logging/parse_path
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-replication -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-replication" 
==8998==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-replication /replication/primary/read
PASS 2 test-replication /replication/primary/write
PASS 3 test-replication /replication/primary/start
---
PASS 6 test-replication /replication/primary/get_error_all
PASS 64 ahci-test /x86_64/ahci/migrate/sanity
PASS 7 test-replication /replication/secondary/read
==9006==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 test-replication /replication/secondary/write
==9011==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8998==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff21409000; bottom 0x7f11fb5fc000; size: 0x00ed25e0d000 (1018542739456)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 65 ahci-test /x86_64/ahci/migrate/dma/simple
PASS 9 test-replication /replication/secondary/start
==9039==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==9044==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 test-replication /replication/secondary/stop
PASS 66 ahci-test /x86_64/ahci/migrate/dma/halted
==9053==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==9058==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 test-replication /replication/secondary/do_checkpoint
PASS 12 test-replication /replication/secondary/get_error_all
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bufferiszero -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bufferiszero" 
PASS 67 ahci-test /x86_64/ahci/migrate/ncq/simple
==9071==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==9076==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 68 ahci-test /x86_64/ahci/migrate/ncq/halted
==9086==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 69 ahci-test /x86_64/ahci/cdrom/eject
==9091==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 70 ahci-test /x86_64/ahci/cdrom/dma/single
==9097==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 71 ahci-test /x86_64/ahci/cdrom/dma/multi
==9103==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 72 ahci-test /x86_64/ahci/cdrom/pio/single
==9109==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==9109==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffdfc29e000; bottom 0x7f06f9dfe000; size: 0x00f7024a0000 (1060895326208)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 73 ahci-test /x86_64/ahci/cdrom/pio/multi
==9115==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 74 ahci-test /x86_64/ahci/cdrom/pio/bcl
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/hd-geo-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="hd-geo-test" 
PASS 1 hd-geo-test /x86_64/hd-geo/ide/none
==9129==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 hd-geo-test /x86_64/hd-geo/ide/drive/cd_0
==9135==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/blank
==9141==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/lba
==9147==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/chs
==9153==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 hd-geo-test /x86_64/hd-geo/ide/device/mbr/blank
==9159==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 hd-geo-test /x86_64/hd-geo/ide/device/mbr/lba
==9165==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 hd-geo-test /x86_64/hd-geo/ide/device/mbr/chs
==9171==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 hd-geo-test /x86_64/hd-geo/ide/device/user/chs
==9176==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 hd-geo-test /x86_64/hd-geo/ide/device/user/chst
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/boot-order-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="boot-order-test" 
PASS 1 test-bufferiszero /cutils/bufferiszero
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9261==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 bios-tables-test /x86_64/acpi/piix4
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9267==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 bios-tables-test /x86_64/acpi/q35
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9273==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 bios-tables-test /x86_64/acpi/piix4/bridge
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9279==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 bios-tables-test /x86_64/acpi/piix4/ipmi
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9285==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 bios-tables-test /x86_64/acpi/piix4/cpuhp
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9292==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 bios-tables-test /x86_64/acpi/piix4/memhp
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9298==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 bios-tables-test /x86_64/acpi/piix4/numamem
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9304==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 bios-tables-test /x86_64/acpi/piix4/dimmpxm
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9313==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 bios-tables-test /x86_64/acpi/q35/bridge
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9319==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 bios-tables-test /x86_64/acpi/q35/mmio64
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9325==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 bios-tables-test /x86_64/acpi/q35/ipmi
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9331==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 bios-tables-test /x86_64/acpi/q35/cpuhp
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9338==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 bios-tables-test /x86_64/acpi/q35/memhp
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9344==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 bios-tables-test /x86_64/acpi/q35/numamem
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9350==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 bios-tables-test /x86_64/acpi/q35/dimmpxm
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/boot-serial-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="boot-serial-test" 
PASS 1 boot-serial-test /x86_64/boot-serial/isapc
---
PASS 1 i440fx-test /x86_64/i440fx/defaults
PASS 2 i440fx-test /x86_64/i440fx/pam
PASS 3 i440fx-test /x86_64/i440fx/firmware/bios
==9434==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 i440fx-test /x86_64/i440fx/firmware/pflash
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/fw_cfg-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="fw_cfg-test" 
PASS 1 fw_cfg-test /x86_64/fw_cfg/signature
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/drive_del-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="drive_del-test" 
PASS 1 drive_del-test /x86_64/drive_del/without-dev
PASS 2 drive_del-test /x86_64/drive_del/after_failed_device_add
==9522==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 drive_del-test /x86_64/blockdev/drive_del_device_del
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/wdt_ib700-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="wdt_ib700-test" 
PASS 1 wdt_ib700-test /x86_64/wdt_ib700/pause
---
PASS 1 usb-hcd-uhci-test /x86_64/uhci/pci/init
PASS 2 usb-hcd-uhci-test /x86_64/uhci/pci/port1
PASS 3 usb-hcd-uhci-test /x86_64/uhci/pci/hotplug
==9717==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 usb-hcd-uhci-test /x86_64/uhci/pci/hotplug/usb-storage
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/usb-hcd-xhci-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="usb-hcd-xhci-test" 
PASS 1 usb-hcd-xhci-test /x86_64/xhci/pci/init
PASS 2 usb-hcd-xhci-test /x86_64/xhci/pci/hotplug
==9726==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 usb-hcd-xhci-test /x86_64/xhci/pci/hotplug/usb-uas
PASS 4 usb-hcd-xhci-test /x86_64/xhci/pci/hotplug/usb-ccid
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/cpu-plug-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="cpu-plug-test" 
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9832==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 vmgenid-test /x86_64/vmgenid/vmgenid/set-guid
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9838==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 vmgenid-test /x86_64/vmgenid/vmgenid/set-guid-auto
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9844==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 vmgenid-test /x86_64/vmgenid/vmgenid/query-monitor
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/tpm-crb-swtpm-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="tpm-crb-swtpm-test" 
SKIP 1 tpm-crb-swtpm-test /x86_64/tpm/crb-swtpm/test # SKIP swtpm not in PATH or missing --tpm2 support
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9949==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9954==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 migration-test /x86_64/migration/fd_proto
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9962==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9967==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 migration-test /x86_64/migration/postcopy/unix
PASS 5 migration-test /x86_64/migration/postcopy/recovery
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==9997==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==10002==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 migration-test /x86_64/migration/precopy/unix
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==10011==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==10016==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 migration-test /x86_64/migration/precopy/tcp
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==10025==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
==10030==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 migration-test /x86_64/migration/xbzrle/unix
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/test-x86-cpuid-compat -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-x86-cpuid-compat" 
PASS 1 test-x86-cpuid-compat /x86/cpuid/parsing-plus-minus
---
PASS 6 numa-test /x86_64/numa/pc/dynamic/cpu
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qmp-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="qmp-test" 
PASS 1 qmp-test /x86_64/qmp/protocol
==10359==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 qmp-test /x86_64/qmp/oob
PASS 3 qmp-test /x86_64/qmp/preconfig
PASS 4 qmp-test /x86_64/qmp/missing-any-arg
---
PASS 5 device-introspect-test /x86_64/device/introspect/abstract-interfaces

=================================================================
==10607==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x55d6fa6b3b6e in calloc (/tmp/qemu-test/build/x86_64-softmmu/qemu-system-x86_64+0x19f9b6e)
---

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 2 allocation(s).
/tmp/qemu-test/src/tests/libqtest.c:137: kill_qemu() tried to terminate QEMU process but encountered exit status 1
ERROR - too few tests run (expected 6, got 5)
make: *** [/tmp/qemu-test/src/tests/Makefile.include:896: check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):


The full log is available at
http://patchew.org/logs/20190703171005.26231-1-philmd@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Daniel P. Berrangé 4 years, 10 months ago
On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
> We can pass trace trace options with the -trace command line
> argument.
> 
> Tracing might be useful when running qtests. To avoid to have
> to modify the tests and recompile, add the possibility to pass
> trace options via the shell environment.
> 
> We add:
> - QEMU_TRACE_EVENTS:    List of events to enable (coma separated)
> - QEMU_TRACE_EVENTFILE: File with list of events to enable
> - QEMU_TRACE_LOGFILE:   File to log the trace events.
> 
> Example of use:
> 
>   $ QEMU_TRACE_EVENTS=pl011\* make check-qtest-arm
>     TEST    check-qtest-arm: tests/boot-serial-test
>   18650@1562168430.027490:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>   18650@1562168430.027535:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>   18650@1562168430.027544:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>   18650@1562168430.028037:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>   18650@1562168430.028049:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>   18650@1562168430.028057:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>   18653@1562168430.053250:pl011_write addr 0x00000000 value 0x00000054
>   18653@1562168430.053276:pl011_irq_state irq state 0
>   [...]
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> I'm not sure where to document that...
> ---
>  trace/control.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/trace/control.c b/trace/control.c
> index 43fb7868db..aea802623c 100644
> --- a/trace/control.c
> +++ b/trace/control.c
> @@ -288,6 +288,8 @@ void trace_fini_vcpu(CPUState *vcpu)
>  
>  bool trace_init_backends(void)
>  {
> +    char *trace_env;
> +
>  #ifdef CONFIG_TRACE_SIMPLE
>      if (!st_init()) {
>          fprintf(stderr, "failed to initialize simple tracing backend.\n");
> @@ -306,6 +308,13 @@ bool trace_init_backends(void)
>      openlog(NULL, LOG_PID, LOG_DAEMON);
>  #endif
>  
> +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
> +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
> +    trace_env = getenv("QEMU_TRACE_EVENTS");
> +    if (trace_env) {
> +        trace_enable_events(trace_env);
> +    }
> +

I don't think it is a nice idea to add this via environment variables
to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
to read the env vars and then pass a suitable -trace arg when spawning
QEMU ?

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
On 7/3/19 7:25 PM, Daniel P. Berrangé wrote:
> On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
>> We can pass trace trace options with the -trace command line
>> argument.
>>
>> Tracing might be useful when running qtests. To avoid to have
>> to modify the tests and recompile, add the possibility to pass
>> trace options via the shell environment.
>>
>> We add:
>> - QEMU_TRACE_EVENTS:    List of events to enable (coma separated)
>> - QEMU_TRACE_EVENTFILE: File with list of events to enable
>> - QEMU_TRACE_LOGFILE:   File to log the trace events.
>>
>> Example of use:
>>
>>   $ QEMU_TRACE_EVENTS=pl011\* make check-qtest-arm
>>     TEST    check-qtest-arm: tests/boot-serial-test
>>   18650@1562168430.027490:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>   18650@1562168430.027535:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>   18650@1562168430.027544:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>   18650@1562168430.028037:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>   18650@1562168430.028049:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>   18650@1562168430.028057:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>   18653@1562168430.053250:pl011_write addr 0x00000000 value 0x00000054
>>   18653@1562168430.053276:pl011_irq_state irq state 0
>>   [...]
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> I'm not sure where to document that...
>> ---
>>  trace/control.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/trace/control.c b/trace/control.c
>> index 43fb7868db..aea802623c 100644
>> --- a/trace/control.c
>> +++ b/trace/control.c
>> @@ -288,6 +288,8 @@ void trace_fini_vcpu(CPUState *vcpu)
>>  
>>  bool trace_init_backends(void)
>>  {
>> +    char *trace_env;
>> +
>>  #ifdef CONFIG_TRACE_SIMPLE
>>      if (!st_init()) {
>>          fprintf(stderr, "failed to initialize simple tracing backend.\n");
>> @@ -306,6 +308,13 @@ bool trace_init_backends(void)
>>      openlog(NULL, LOG_PID, LOG_DAEMON);
>>  #endif
>>  
>> +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
>> +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
>> +    trace_env = getenv("QEMU_TRACE_EVENTS");
>> +    if (trace_env) {
>> +        trace_enable_events(trace_env);
>> +    }
>> +
> 
> I don't think it is a nice idea to add this via environment variables
> to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
> to read the env vars and then pass a suitable -trace arg when spawning
> QEMU ?

Fine by me.

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Stefan Hajnoczi 4 years, 10 months ago
On Wed, Jul 03, 2019 at 06:25:01PM +0100, Daniel P. Berrangé wrote:
> On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
> > @@ -306,6 +308,13 @@ bool trace_init_backends(void)
> >      openlog(NULL, LOG_PID, LOG_DAEMON);
> >  #endif
> >  
> > +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
> > +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
> > +    trace_env = getenv("QEMU_TRACE_EVENTS");
> > +    if (trace_env) {
> > +        trace_enable_events(trace_env);
> > +    }
> > +
> 
> I don't think it is a nice idea to add this via environment variables
> to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
> to read the env vars and then pass a suitable -trace arg when spawning
> QEMU ?

What is the concern about adding these environment variables to QEMU?

It is convenient to be able to use tracing even if QEMU is invoked by
something you cannot modify/control.

The main issues I see with environment variables are:

1. Security.  Is there a scenario where an attacker can use environment
   variables to influence the behavior of a QEMU process running at a
   different trust level?

2. Name collision.  What is the chance that existing users already
   define environment variables with these names and that unexpected
   behavior could result?

Stefan
Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Daniel P. Berrangé 4 years, 10 months ago
On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
> On Wed, Jul 03, 2019 at 06:25:01PM +0100, Daniel P. Berrangé wrote:
> > On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
> > > @@ -306,6 +308,13 @@ bool trace_init_backends(void)
> > >      openlog(NULL, LOG_PID, LOG_DAEMON);
> > >  #endif
> > >  
> > > +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
> > > +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
> > > +    trace_env = getenv("QEMU_TRACE_EVENTS");
> > > +    if (trace_env) {
> > > +        trace_enable_events(trace_env);
> > > +    }
> > > +
> > 
> > I don't think it is a nice idea to add this via environment variables
> > to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
> > to read the env vars and then pass a suitable -trace arg when spawning
> > QEMU ?
> 
> What is the concern about adding these environment variables to QEMU?
> 
> It is convenient to be able to use tracing even if QEMU is invoked by
> something you cannot modify/control.
> 
> The main issues I see with environment variables are:
> 
> 1. Security.  Is there a scenario where an attacker can use environment
>    variables to influence the behavior of a QEMU process running at a
>    different trust level?
> 
> 2. Name collision.  What is the chance that existing users already
>    define environment variables with these names and that unexpected
>    behavior could result?

One of the biggest problems with QEMU in general has been poorly modelled
& defined interfaces for configuration. At runtime we've solved this with
QMP. At startup we're still fighting the horror of QemuOpts in general and
haven't got startup modelling to be on a par with that offered by QEMU.
It was even worse when Audio didn't even use QemuOpts and instead used
an arbitrary set of poorly defined env variables. To me adding yet another
way to configure QEMU via env vars is moving in the opposite direction to
what we want.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Stefan Hajnoczi 4 years, 10 months ago
On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
> > On Wed, Jul 03, 2019 at 06:25:01PM +0100, Daniel P. Berrangé wrote:
> > > On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
> > > > @@ -306,6 +308,13 @@ bool trace_init_backends(void)
> > > >      openlog(NULL, LOG_PID, LOG_DAEMON);
> > > >  #endif
> > > >  
> > > > +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
> > > > +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
> > > > +    trace_env = getenv("QEMU_TRACE_EVENTS");
> > > > +    if (trace_env) {
> > > > +        trace_enable_events(trace_env);
> > > > +    }
> > > > +
> > > 
> > > I don't think it is a nice idea to add this via environment variables
> > > to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
> > > to read the env vars and then pass a suitable -trace arg when spawning
> > > QEMU ?
> > 
> > What is the concern about adding these environment variables to QEMU?
> > 
> > It is convenient to be able to use tracing even if QEMU is invoked by
> > something you cannot modify/control.
> > 
> > The main issues I see with environment variables are:
> > 
> > 1. Security.  Is there a scenario where an attacker can use environment
> >    variables to influence the behavior of a QEMU process running at a
> >    different trust level?
> > 
> > 2. Name collision.  What is the chance that existing users already
> >    define environment variables with these names and that unexpected
> >    behavior could result?
> 
> One of the biggest problems with QEMU in general has been poorly modelled
> & defined interfaces for configuration. At runtime we've solved this with
> QMP. At startup we're still fighting the horror of QemuOpts in general and
> haven't got startup modelling to be on a par with that offered by QEMU.
> It was even worse when Audio didn't even use QemuOpts and instead used
> an arbitrary set of poorly defined env variables. To me adding yet another
> way to configure QEMU via env vars is moving in the opposite direction to
> what we want.

In this case the environment variables are optional and meant for cases
where the user cannot change the QEMU command-line.  I think they serve
a different purpose from the audio subsystem environment variables and
I'd be happy to merge them.

Philippe: Have you tried adding the environment variable to libqtest as
Dan suggested and did it work for your use case?

Stefan
Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
On 7/5/19 10:07 AM, Stefan Hajnoczi wrote:
> On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
>> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
>>> On Wed, Jul 03, 2019 at 06:25:01PM +0100, Daniel P. Berrangé wrote:
>>>> On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
>>>>> @@ -306,6 +308,13 @@ bool trace_init_backends(void)
>>>>>      openlog(NULL, LOG_PID, LOG_DAEMON);
>>>>>  #endif
>>>>>  
>>>>> +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
>>>>> +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
>>>>> +    trace_env = getenv("QEMU_TRACE_EVENTS");
>>>>> +    if (trace_env) {
>>>>> +        trace_enable_events(trace_env);
>>>>> +    }
>>>>> +
>>>>
>>>> I don't think it is a nice idea to add this via environment variables
>>>> to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
>>>> to read the env vars and then pass a suitable -trace arg when spawning
>>>> QEMU ?
>>>
>>> What is the concern about adding these environment variables to QEMU?
>>>
>>> It is convenient to be able to use tracing even if QEMU is invoked by
>>> something you cannot modify/control.
>>>
>>> The main issues I see with environment variables are:
>>>
>>> 1. Security.  Is there a scenario where an attacker can use environment
>>>    variables to influence the behavior of a QEMU process running at a
>>>    different trust level?
>>>
>>> 2. Name collision.  What is the chance that existing users already
>>>    define environment variables with these names and that unexpected
>>>    behavior could result?
>>
>> One of the biggest problems with QEMU in general has been poorly modelled
>> & defined interfaces for configuration. At runtime we've solved this with
>> QMP. At startup we're still fighting the horror of QemuOpts in general and
>> haven't got startup modelling to be on a par with that offered by QEMU.
>> It was even worse when Audio didn't even use QemuOpts and instead used
>> an arbitrary set of poorly defined env variables. To me adding yet another
>> way to configure QEMU via env vars is moving in the opposite direction to
>> what we want.
> 
> In this case the environment variables are optional and meant for cases
> where the user cannot change the QEMU command-line.  I think they serve
> a different purpose from the audio subsystem environment variables and
> I'd be happy to merge them.
> 
> Philippe: Have you tried adding the environment variable to libqtest as
> Dan suggested and did it work for your use case?

Yes, but we loose the ability to use this feature from linux-user and
other tools:

$ git grep trace_opt_parse
bsd-user/main.c:851:            trace_file = trace_opt_parse(optarg);
linux-user/main.c:387:    trace_file = trace_opt_parse(arg);
qemu-img.c:5063:            trace_file = trace_opt_parse(optarg);
qemu-io.c:579:            trace_file = trace_opt_parse(optarg);
qemu-nbd.c:862:            trace_file = trace_opt_parse(optarg);
scsi/qemu-pr-helper.c:969:            trace_file = trace_opt_parse(optarg);
vl.c:3730:                trace_file = trace_opt_parse(optarg);

So I'm now mixed about the trade off regarding Daniel worries.

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Markus Armbruster 4 years, 10 months ago
Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 7/5/19 10:07 AM, Stefan Hajnoczi wrote:
>> On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
>>> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
>>>> On Wed, Jul 03, 2019 at 06:25:01PM +0100, Daniel P. Berrangé wrote:
>>>>> On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>> We can pass trace trace options with the -trace command line
>>>>>> argument.
>>>>>> 
>>>>>> Tracing might be useful when running qtests. To avoid to have
>>>>>> to modify the tests and recompile, add the possibility to pass
>>>>>> trace options via the shell environment.

Unless I'm missing something, you don't have to recompile to pass
additional options.  The qtest binaries already read environment
variables QTEST_QEMU_BINARY and QTEST_QEMU_IMG.  Have them point to
suitable wrappers.

Perhaps there's still a need for a more convenient way.

>>>>>> 
>>>>>> We add:
>>>>>> - QEMU_TRACE_EVENTS:    List of events to enable (coma separated)
>>>>>> - QEMU_TRACE_EVENTFILE: File with list of events to enable
>>>>>> - QEMU_TRACE_LOGFILE:   File to log the trace events.
>>>>>> 
>>>>>> Example of use:
>>>>>> 
>>>>>>   $ QEMU_TRACE_EVENTS=pl011\* make check-qtest-arm
>>>>>>     TEST    check-qtest-arm: tests/boot-serial-test
>>>>>>   18650@1562168430.027490:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>   18650@1562168430.027535:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>   18650@1562168430.027544:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>   18650@1562168430.028037:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>   18650@1562168430.028049:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>   18650@1562168430.028057:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>   18653@1562168430.053250:pl011_write addr 0x00000000 value 0x00000054
>>>>>>   18653@1562168430.053276:pl011_irq_state irq state 0
>>>>>>   [...]
>>>>>> 
>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>>>> ---
>>>>>> I'm not sure where to document that...
>>>>>> ---
>>>>>>  trace/control.c | 9 +++++++++
>>>>>>  1 file changed, 9 insertions(+)
>>>>>> 
>>>>>> diff --git a/trace/control.c b/trace/control.c
>>>>>> index 43fb7868db..aea802623c 100644
>>>>>> --- a/trace/control.c
>>>>>> +++ b/trace/control.c
>>>>>> @@ -288,6 +288,8 @@ void trace_fini_vcpu(CPUState *vcpu)
>>>>>>  
>>>>>>  bool trace_init_backends(void)
>>>>>>  {
>>>>>> +    char *trace_env;
>>>>>> +
>>>>>>  #ifdef CONFIG_TRACE_SIMPLE
>>>>>>      if (!st_init()) {
>>>>>>          fprintf(stderr, "failed to initialize simple tracing backend.\n");
>>>>>> @@ -306,6 +308,13 @@ bool trace_init_backends(void)
>>>>>>      openlog(NULL, LOG_PID, LOG_DAEMON);
>>>>>>  #endif
>>>>>>  
>>>>>> +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
>>>>>> +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
>>>>>> +    trace_env = getenv("QEMU_TRACE_EVENTS");
>>>>>> +    if (trace_env) {
>>>>>> +        trace_enable_events(trace_env);
>>>>>> +    }
>>>>>> +
>>>>>
>>>>> I don't think it is a nice idea to add this via environment variables
>>>>> to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
>>>>> to read the env vars and then pass a suitable -trace arg when spawning
>>>>> QEMU ?
>>>>
>>>> What is the concern about adding these environment variables to QEMU?
>>>>
>>>> It is convenient to be able to use tracing even if QEMU is invoked by
>>>> something you cannot modify/control.
>>>>
>>>> The main issues I see with environment variables are:
>>>>
>>>> 1. Security.  Is there a scenario where an attacker can use environment
>>>>    variables to influence the behavior of a QEMU process running at a
>>>>    different trust level?

The common (and sad) solution for this is to require whatever runs $PROG
at a different trust level to scrub the environment.

>>>> 2. Name collision.  What is the chance that existing users already
>>>>    define environment variables with these names and that unexpected
>>>>    behavior could result?
>>>
>>> One of the biggest problems with QEMU in general has been poorly modelled
>>> & defined interfaces for configuration. At runtime we've solved this with
>>> QMP. At startup we're still fighting the horror of QemuOpts in general and
>>> haven't got startup modelling to be on a par with that offered by QEMU.
>>> It was even worse when Audio didn't even use QemuOpts and instead used
>>> an arbitrary set of poorly defined env variables. To me adding yet another
>>> way to configure QEMU via env vars is moving in the opposite direction to
>>> what we want.
>> 
>> In this case the environment variables are optional and meant for cases
>> where the user cannot change the QEMU command-line.  I think they serve
>> a different purpose from the audio subsystem environment variables and
>> I'd be happy to merge them.

You're right, there is a difference between "also" and "only".  Audio
could only be configured via environment, and that was without doubt
awful.  Does not imply permitting trace configuration via environment
also would be similarly awful.

However, adding special cases as needed is what got us into the startup
mess Dan highlighted.  Are we confident tracing will remain the only
thing we also want to configure via environment?

I sympathize with Dan's plea for more uniform configuration interfaces.

>> Philippe: Have you tried adding the environment variable to libqtest as
>> Dan suggested and did it work for your use case?

This would fit into our existing use of the environment with qtest.  Try
grep '"QTEST_'.

> Yes, but we loose the ability to use this feature from linux-user and
> other tools:
>
> $ git grep trace_opt_parse
> bsd-user/main.c:851:            trace_file = trace_opt_parse(optarg);
> linux-user/main.c:387:    trace_file = trace_opt_parse(arg);
> qemu-img.c:5063:            trace_file = trace_opt_parse(optarg);
> qemu-io.c:579:            trace_file = trace_opt_parse(optarg);
> qemu-nbd.c:862:            trace_file = trace_opt_parse(optarg);
> scsi/qemu-pr-helper.c:969:            trace_file = trace_opt_parse(optarg);
> vl.c:3730:                trace_file = trace_opt_parse(optarg);
>
> So I'm now mixed about the trade off regarding Daniel worries.

Philippe, your commit message mentions just qtest.  That use case would
be covered by Dan's suggestion, wouldn't it?  If not, please explain.
If you have additional use cases, please state them.

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
On 7/5/19 3:19 PM, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>> On 7/5/19 10:07 AM, Stefan Hajnoczi wrote:
>>> On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
>>>> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
>>>>> On Wed, Jul 03, 2019 at 06:25:01PM +0100, Daniel P. Berrangé wrote:
>>>>>> On Wed, Jul 03, 2019 at 07:10:05PM +0200, Philippe Mathieu-Daudé wrote:
>>>>>>> We can pass trace trace options with the -trace command line
>>>>>>> argument.
>>>>>>>
>>>>>>> Tracing might be useful when running qtests. To avoid to have
>>>>>>> to modify the tests and recompile, add the possibility to pass
>>>>>>> trace options via the shell environment.
> 
> Unless I'm missing something, you don't have to recompile to pass
> additional options.  The qtest binaries already read environment
> variables QTEST_QEMU_BINARY and QTEST_QEMU_IMG.  Have them point to
> suitable wrappers.
> 
> Perhaps there's still a need for a more convenient way.
> 
>>>>>>>
>>>>>>> We add:
>>>>>>> - QEMU_TRACE_EVENTS:    List of events to enable (coma separated)
>>>>>>> - QEMU_TRACE_EVENTFILE: File with list of events to enable
>>>>>>> - QEMU_TRACE_LOGFILE:   File to log the trace events.
>>>>>>>
>>>>>>> Example of use:
>>>>>>>
>>>>>>>   $ QEMU_TRACE_EVENTS=pl011\* make check-qtest-arm
>>>>>>>     TEST    check-qtest-arm: tests/boot-serial-test
>>>>>>>   18650@1562168430.027490:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>>   18650@1562168430.027535:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>>   18650@1562168430.027544:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>>   18650@1562168430.028037:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>>   18650@1562168430.028049:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>>   18650@1562168430.028057:pl011_can_receive LCR 0x00000000 read_count 0 returning 1
>>>>>>>   18653@1562168430.053250:pl011_write addr 0x00000000 value 0x00000054
>>>>>>>   18653@1562168430.053276:pl011_irq_state irq state 0
>>>>>>>   [...]
>>>>>>>
>>>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>>>>> ---
>>>>>>> I'm not sure where to document that...
>>>>>>> ---
>>>>>>>  trace/control.c | 9 +++++++++
>>>>>>>  1 file changed, 9 insertions(+)
>>>>>>>
>>>>>>> diff --git a/trace/control.c b/trace/control.c
>>>>>>> index 43fb7868db..aea802623c 100644
>>>>>>> --- a/trace/control.c
>>>>>>> +++ b/trace/control.c
>>>>>>> @@ -288,6 +288,8 @@ void trace_fini_vcpu(CPUState *vcpu)
>>>>>>>  
>>>>>>>  bool trace_init_backends(void)
>>>>>>>  {
>>>>>>> +    char *trace_env;
>>>>>>> +
>>>>>>>  #ifdef CONFIG_TRACE_SIMPLE
>>>>>>>      if (!st_init()) {
>>>>>>>          fprintf(stderr, "failed to initialize simple tracing backend.\n");
>>>>>>> @@ -306,6 +308,13 @@ bool trace_init_backends(void)
>>>>>>>      openlog(NULL, LOG_PID, LOG_DAEMON);
>>>>>>>  #endif
>>>>>>>  
>>>>>>> +    trace_init_file(getenv("QEMU_TRACE_LOGFILE"));
>>>>>>> +    trace_init_events(getenv("QEMU_TRACE_EVENTFILE"));
>>>>>>> +    trace_env = getenv("QEMU_TRACE_EVENTS");
>>>>>>> +    if (trace_env) {
>>>>>>> +        trace_enable_events(trace_env);
>>>>>>> +    }
>>>>>>> +
>>>>>>
>>>>>> I don't think it is a nice idea to add this via environment variables
>>>>>> to QEMU itself. Why not modify libqtest qtest_init_without_qmp_handshake
>>>>>> to read the env vars and then pass a suitable -trace arg when spawning
>>>>>> QEMU ?
>>>>>
>>>>> What is the concern about adding these environment variables to QEMU?
>>>>>
>>>>> It is convenient to be able to use tracing even if QEMU is invoked by
>>>>> something you cannot modify/control.
>>>>>
>>>>> The main issues I see with environment variables are:
>>>>>
>>>>> 1. Security.  Is there a scenario where an attacker can use environment
>>>>>    variables to influence the behavior of a QEMU process running at a
>>>>>    different trust level?
> 
> The common (and sad) solution for this is to require whatever runs $PROG
> at a different trust level to scrub the environment.

I hope people concerned by security build QEMU with the NOP trace backend.

>>>>> 2. Name collision.  What is the chance that existing users already
>>>>>    define environment variables with these names and that unexpected
>>>>>    behavior could result?
>>>>
>>>> One of the biggest problems with QEMU in general has been poorly modelled
>>>> & defined interfaces for configuration. At runtime we've solved this with
>>>> QMP. At startup we're still fighting the horror of QemuOpts in general and
>>>> haven't got startup modelling to be on a par with that offered by QEMU.
>>>> It was even worse when Audio didn't even use QemuOpts and instead used
>>>> an arbitrary set of poorly defined env variables. To me adding yet another
>>>> way to configure QEMU via env vars is moving in the opposite direction to
>>>> what we want.
>>>
>>> In this case the environment variables are optional and meant for cases
>>> where the user cannot change the QEMU command-line.  I think they serve
>>> a different purpose from the audio subsystem environment variables and
>>> I'd be happy to merge them.
> 
> You're right, there is a difference between "also" and "only".  Audio
> could only be configured via environment, and that was without doubt
> awful.  Does not imply permitting trace configuration via environment
> also would be similarly awful.
> 
> However, adding special cases as needed is what got us into the startup
> mess Dan highlighted.  Are we confident tracing will remain the only
> thing we also want to configure via environment?
> 
> I sympathize with Dan's plea for more uniform configuration interfaces.

I understand. It would be clearer to have this position documented in
HACKING.

>>> Philippe: Have you tried adding the environment variable to libqtest as
>>> Dan suggested and did it work for your use case?
> 
> This would fit into our existing use of the environment with qtest.  Try
> grep '"QTEST_'.
> 
>> Yes, but we loose the ability to use this feature from linux-user and
>> other tools:
>>
>> $ git grep trace_opt_parse
>> bsd-user/main.c:851:            trace_file = trace_opt_parse(optarg);
>> linux-user/main.c:387:    trace_file = trace_opt_parse(arg);
>> qemu-img.c:5063:            trace_file = trace_opt_parse(optarg);
>> qemu-io.c:579:            trace_file = trace_opt_parse(optarg);
>> qemu-nbd.c:862:            trace_file = trace_opt_parse(optarg);
>> scsi/qemu-pr-helper.c:969:            trace_file = trace_opt_parse(optarg);
>> vl.c:3730:                trace_file = trace_opt_parse(optarg);
>>
>> So I'm now mixed about the trade off regarding Daniel worries.
> 
> Philippe, your commit message mentions just qtest.  That use case would
> be covered by Dan's suggestion, wouldn't it?  If not, please explain.
> If you have additional use cases, please state them.

I'm fine with qtests. I was thinking on how sometimes I use ld.so's
LD_DEBUG env var, and thought it might be useful to use it a similar
way, but in a test environment (not restricted to qtests, but also
avocado tests and docker tests).
We can modify each type of test to use the '-trace' command line
argument. While it is a bit more of work, I understand the design
motivations to have a uniform interface.

Thanks,

Phil.

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Markus Armbruster 4 years, 10 months ago
Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 7/5/19 3:19 PM, Markus Armbruster wrote:
>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>> On 7/5/19 10:07 AM, Stefan Hajnoczi wrote:
>>>> On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
>>>>> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
[...]
>>>>>> What is the concern about adding these environment variables to QEMU?
>>>>>>
>>>>>> It is convenient to be able to use tracing even if QEMU is invoked by
>>>>>> something you cannot modify/control.
>>>>>>
>>>>>> The main issues I see with environment variables are:
>>>>>>
>>>>>> 1. Security.  Is there a scenario where an attacker can use environment
>>>>>>    variables to influence the behavior of a QEMU process running at a
>>>>>>    different trust level?
>> 
>> The common (and sad) solution for this is to require whatever runs $PROG
>> at a different trust level to scrub the environment.
>
> I hope people concerned by security build QEMU with the NOP trace backend.

I sure hope at least one of our tracing backends (other than nop) can be
used safely in production.

>>>>>> 2. Name collision.  What is the chance that existing users already
>>>>>>    define environment variables with these names and that unexpected
>>>>>>    behavior could result?
[...]

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Daniel P. Berrangé 4 years, 9 months ago
On Sat, Jul 06, 2019 at 06:02:18AM +0200, Markus Armbruster wrote:
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> 
> > On 7/5/19 3:19 PM, Markus Armbruster wrote:
> >> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> >>> On 7/5/19 10:07 AM, Stefan Hajnoczi wrote:
> >>>> On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
> >>>>> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
> [...]
> >>>>>> What is the concern about adding these environment variables to QEMU?
> >>>>>>
> >>>>>> It is convenient to be able to use tracing even if QEMU is invoked by
> >>>>>> something you cannot modify/control.
> >>>>>>
> >>>>>> The main issues I see with environment variables are:
> >>>>>>
> >>>>>> 1. Security.  Is there a scenario where an attacker can use environment
> >>>>>>    variables to influence the behavior of a QEMU process running at a
> >>>>>>    different trust level?
> >> 
> >> The common (and sad) solution for this is to require whatever runs $PROG
> >> at a different trust level to scrub the environment.
> >
> > I hope people concerned by security build QEMU with the NOP trace backend.
> 
> I sure hope at least one of our tracing backends (other than nop) can be
> used safely in production.

AFAIK, *all* of the trace backends are safe for use in production. The
only questions are around performance in production.  If anyone knows of
any security problems with specific backends we should either address them,
or document the backend is unsafe.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Philippe Mathieu-Daudé 4 years, 9 months ago
On 7/8/19 11:34 AM, Daniel P. Berrangé wrote:
> On Sat, Jul 06, 2019 at 06:02:18AM +0200, Markus Armbruster wrote:
>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>
>>> On 7/5/19 3:19 PM, Markus Armbruster wrote:
>>>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>>>> On 7/5/19 10:07 AM, Stefan Hajnoczi wrote:
>>>>>> On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
>>>>>>> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
>> [...]
>>>>>>>> What is the concern about adding these environment variables to QEMU?
>>>>>>>>
>>>>>>>> It is convenient to be able to use tracing even if QEMU is invoked by
>>>>>>>> something you cannot modify/control.
>>>>>>>>
>>>>>>>> The main issues I see with environment variables are:
>>>>>>>>
>>>>>>>> 1. Security.  Is there a scenario where an attacker can use environment
>>>>>>>>    variables to influence the behavior of a QEMU process running at a
>>>>>>>>    different trust level?
>>>>
>>>> The common (and sad) solution for this is to require whatever runs $PROG
>>>> at a different trust level to scrub the environment.
>>>
>>> I hope people concerned by security build QEMU with the NOP trace backend.
>>
>> I sure hope at least one of our tracing backends (other than nop) can be
>> used safely in production.

I'm not saying production and security are orthogonal, but recent trend
in security seems to reduce code exposure by disabling component, so I'd
not be surprise if people who primary concern is strong security to use
the NOP trace backend as default.

> AFAIK, *all* of the trace backends are safe for use in production. The
> only questions are around performance in production.  If anyone knows of
> any security problems with specific backends we should either address them,
> or document the backend is unsafe.

I hope the tracing backend/frontends are safe. Now the trace events log
a bunch of interesting information, so I'd not be surprise if some
security researcher open a "QEMU information leak" CVE because we log
various guest pointers i.e.

Anyway, to stop bikeshedding this thread, can you add few lines about
why not use getenv() in the HACKING?

Thanks,

Phil.

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Daniel P. Berrangé 4 years, 9 months ago
On Mon, Jul 08, 2019 at 12:27:12PM +0200, Philippe Mathieu-Daudé wrote:
> On 7/8/19 11:34 AM, Daniel P. Berrangé wrote:
> > On Sat, Jul 06, 2019 at 06:02:18AM +0200, Markus Armbruster wrote:
> >> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> >>
> >>> On 7/5/19 3:19 PM, Markus Armbruster wrote:
> >>>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> >>>>> On 7/5/19 10:07 AM, Stefan Hajnoczi wrote:
> >>>>>> On Thu, Jul 04, 2019 at 11:28:37AM +0100, Daniel P. Berrangé wrote:
> >>>>>>> On Thu, Jul 04, 2019 at 11:24:57AM +0100, Stefan Hajnoczi wrote:
> >> [...]
> >>>>>>>> What is the concern about adding these environment variables to QEMU?
> >>>>>>>>
> >>>>>>>> It is convenient to be able to use tracing even if QEMU is invoked by
> >>>>>>>> something you cannot modify/control.
> >>>>>>>>
> >>>>>>>> The main issues I see with environment variables are:
> >>>>>>>>
> >>>>>>>> 1. Security.  Is there a scenario where an attacker can use environment
> >>>>>>>>    variables to influence the behavior of a QEMU process running at a
> >>>>>>>>    different trust level?
> >>>>
> >>>> The common (and sad) solution for this is to require whatever runs $PROG
> >>>> at a different trust level to scrub the environment.
> >>>
> >>> I hope people concerned by security build QEMU with the NOP trace backend.
> >>
> >> I sure hope at least one of our tracing backends (other than nop) can be
> >> used safely in production.
> 
> I'm not saying production and security are orthogonal, but recent trend
> in security seems to reduce code exposure by disabling component, so I'd
> not be surprise if people who primary concern is strong security to use
> the NOP trace backend as default.
> 
> > AFAIK, *all* of the trace backends are safe for use in production. The
> > only questions are around performance in production.  If anyone knows of
> > any security problems with specific backends we should either address them,
> > or document the backend is unsafe.
> 
> I hope the tracing backend/frontends are safe. Now the trace events log
> a bunch of interesting information, so I'd not be surprise if some
> security researcher open a "QEMU information leak" CVE because we log
> various guest pointers i.e.

There would only be an information leak if the information was made
available to users/apps which are running at a lower privilege level
than QEMU. If you are root, or running as the QEMU user/group, then
all the information is already available by ptrace'ing QEMU or other
means. The tracing framework merely makes it available in an easier
to access way.

> Anyway, to stop bikeshedding this thread, can you add few lines about
> why not use getenv() in the HACKING?

I don't actually think the getenv thing is a security issue in any case.
If there was a security problem exploitable via getenv, then the bug would
lie in the application invoking QEMU for not ensuring the ENV contents
were safe before exec'ing QEMU. Libvirt is paranoid by default and scrubs
QEMU's env only keeping a specific sanitized whitelist for exactly these
reasons.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Markus Armbruster 4 years, 9 months ago
Daniel P. Berrangé <berrange@redhat.com> writes:

> On Mon, Jul 08, 2019 at 12:27:12PM +0200, Philippe Mathieu-Daudé wrote:
[...]
>> Anyway, to stop bikeshedding this thread, can you add few lines about
>> why not use getenv() in the HACKING?
>
> I don't actually think the getenv thing is a security issue in any case.
> If there was a security problem exploitable via getenv, then the bug would
> lie in the application invoking QEMU for not ensuring the ENV contents
> were safe before exec'ing QEMU.

Correct.

>                                 Libvirt is paranoid by default and scrubs
> QEMU's env only keeping a specific sanitized whitelist for exactly these
> reasons.

Must have for running programs with different privileges.

Corrollary: a program that does not use getenv() at all is slightly
harder to misuse with different privileges.  Irrelevant in practice,
because libraries use getenv(), starting with ld.so.

Re: [Qemu-devel] [RFC PATCH-for-4.2] tracing: Allow to tune tracing options via the environment
Posted by Stefan Hajnoczi 4 years, 9 months ago
On Tue, Jul 09, 2019 at 07:53:15AM +0200, Markus Armbruster wrote:
> Daniel P. Berrangé <berrange@redhat.com> writes:
> 
> > On Mon, Jul 08, 2019 at 12:27:12PM +0200, Philippe Mathieu-Daudé wrote:
> [...]
> >> Anyway, to stop bikeshedding this thread, can you add few lines about
> >> why not use getenv() in the HACKING?
> >
> > I don't actually think the getenv thing is a security issue in any case.
> > If there was a security problem exploitable via getenv, then the bug would
> > lie in the application invoking QEMU for not ensuring the ENV contents
> > were safe before exec'ing QEMU.
> 
> Correct.
> 
> >                                 Libvirt is paranoid by default and scrubs
> > QEMU's env only keeping a specific sanitized whitelist for exactly these
> > reasons.
> 
> Must have for running programs with different privileges.
> 
> Corrollary: a program that does not use getenv() at all is slightly
> harder to misuse with different privileges.  Irrelevant in practice,
> because libraries use getenv(), starting with ld.so.

I'll reiterate that I'm happy to merge this but would first like to know
if Philippe is satisfied with adding it just to qtest?

Let's just add it to qtest if that is enough.  Otherwise let's bring it
into QEMU proper.

Stefan