mbox

[PULL,00/13] Tracing patches

Message ID 1454514465-11856-1-git-send-email-stefanha@redhat.com
State New
Headers show

Pull-request

git://github.com/stefanha/qemu.git tags/tracing-pull-request

Message

Stefan Hajnoczi Feb. 3, 2016, 3:47 p.m. UTC
The following changes since commit c65db7705b7926f4a084b93778e4bd5dd3990aad:

  Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-for-peter-2016-02-02' into staging (2016-02-02 18:04:04 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to c84ea00dc29b2084a62bd31f498ed0f245d3848e:

  log: add "-d trace:PATTERN" (2016-02-03 10:37:50 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Denis V. Lunev (2):
  trace: no need to call trace_backend_init in different branches now
  log: move qemu-log.c into util/ directory

Paolo Bonzini (11):
  trace: count number of enabled events
  trace: track enabled events in a separate array
  trace: fix documentation
  trace: split trace_init_events out of trace_init_backends
  trace: split trace_init_file out of trace_init_backends
  trace: add "-trace enable=..."
  trace: add "-trace help"
  log: do not unnecessarily include qom/cpu.h
  trace: convert stderr backend to log
  trace: switch default backend to "log"
  log: add "-d trace:PATTERN"

 .travis.yml                          |   2 +-
 Makefile.objs                        |   1 -
 bsd-user/main.c                      |   1 +
 configure                            |   6 +-
 cpu-exec.c                           |   1 +
 exec.c                               |   1 +
 hw/acpi/cpu_hotplug.c                |   1 +
 hw/timer/a9gtimer.c                  |   1 +
 include/exec/log.h                   |  60 +++++++++++
 include/qemu/log.h                   |  60 +----------
 linux-user/main.c                    |   1 +
 qemu-io.c                            |   2 +-
 qemu-log.c                           | 179 --------------------------------
 qemu-options.hx                      |  22 ++--
 qom/cpu.c                            |   1 +
 scripts/tracetool/backend/log.py     |  48 +++++++++
 scripts/tracetool/backend/stderr.py  |  47 ---------
 scripts/tracetool/format/events_c.py |   2 +-
 target-alpha/translate.c             |   1 +
 target-arm/translate-a64.c           |   1 +
 target-arm/translate.c               |   1 +
 target-cris/translate.c              |   1 +
 target-i386/seg_helper.c             |   1 +
 target-i386/smm_helper.c             |   1 +
 target-i386/translate.c              |   1 +
 target-lm32/helper.c                 |   1 +
 target-lm32/translate.c              |   1 +
 target-m68k/translate.c              |   1 +
 target-microblaze/helper.c           |   1 +
 target-microblaze/translate.c        |   1 +
 target-mips/helper.c                 |   1 +
 target-mips/translate.c              |   1 +
 target-moxie/translate.c             |   1 +
 target-openrisc/translate.c          |   1 +
 target-ppc/mmu-hash32.c              |   1 +
 target-ppc/mmu-hash64.c              |   1 +
 target-ppc/mmu_helper.c              |   1 +
 target-ppc/translate.c               |   1 +
 target-s390x/translate.c             |   1 +
 target-sh4/helper.c                  |   1 +
 target-sh4/translate.c               |   1 +
 target-sparc/int32_helper.c          |   1 +
 target-sparc/int64_helper.c          |   1 +
 target-sparc/translate.c             |   1 +
 target-tilegx/translate.c            |   1 +
 target-tricore/translate.c           |   1 +
 target-unicore32/translate.c         |   1 +
 target-xtensa/translate.c            |   1 +
 tcg/tcg.c                            |   1 +
 trace/control-internal.h             |  15 ++-
 trace/control.c                      |  98 +++++++++++++-----
 trace/control.h                      |  44 +++++++-
 trace/event-internal.h               |   2 -
 trace/simple.c                       |   6 +-
 trace/simple.h                       |   4 +-
 translate-all.c                      |   1 +
 util/Makefile.objs                   |   1 +
 util/log.c                           | 192 +++++++++++++++++++++++++++++++++++
 vl.c                                 |  38 ++++---
 59 files changed, 512 insertions(+), 356 deletions(-)
 create mode 100644 include/exec/log.h
 delete mode 100644 qemu-log.c
 create mode 100644 scripts/tracetool/backend/log.py
 delete mode 100644 scripts/tracetool/backend/stderr.py
 create mode 100644 util/log.c

Comments

Peter Maydell Feb. 3, 2016, 5:55 p.m. UTC | #1
On 3 February 2016 at 15:47, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit c65db7705b7926f4a084b93778e4bd5dd3990aad:
>
>   Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-for-peter-2016-02-02' into staging (2016-02-02 18:04:04 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/tracing-pull-request
>
> for you to fetch changes up to c84ea00dc29b2084a62bd31f498ed0f245d3848e:
>
>   log: add "-d trace:PATTERN" (2016-02-03 10:37:50 +0000)
>
> ----------------------------------------------------------------

Hi. I'm afraid this fails to compile on Windows:

In file included from /home/petmay01/linaro/qemu-for-merges/include/trace.h:4,
                 from
/home/petmay01/linaro/qemu-for-merges/util/oslib-win32.c:38:
./trace/generated-tracers.h: In function ‘trace_virtio_console_flush_buf’:
./trace/generated-tracers.h:240: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 8 has type ‘ssize_t’
  CC    util/hbitmap.o
./trace/generated-tracers.h: In function ‘trace_usb_ohci_iso_td_so’:
./trace/generated-tracers.h:2784: warning: format ‘%zu’ expects type
‘size_t’, but argument 11 has type ‘ssize_t’
./trace/generated-tracers.h: In function ‘trace_usb_ohci_iso_td_data_overrun’:
./trace/generated-tracers.h:2796: warning: format ‘%zu’ expects type
‘size_t’, but argument 7 has type ‘ssize_t’
  CC    util/fifo8.o
  CC    util/acl.o
./trace/generated-tracers.h: In function ‘trace_spice_vmc_write’:
./trace/generated-tracers.h:6516: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 6 has type ‘ssize_t’
  CC    util/error.o
  CC    util/qemu-error.o
cc1: warnings being treated as errors
In file included from /home/petmay01/linaro/qemu-for-merges/include/trace.h:4,
                 from /home/petmay01/linaro/qemu-for-merges/util/hbitmap.c:18:
./trace/generated-tracers.h: In function ‘trace_virtio_console_flush_buf’:
./trace/generated-tracers.h:240: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 8 has type ‘ssize_t’
  CC    util/id.o
  CC    util/iov.o
./trace/generated-tracers.h: In function
‘trace_usb_ohci_iso_td_so’:./trace/generated-tracers.h: In function
‘trace_v9fs_read_return’:
./trace/generated-tracers.h:2784: warning: format ‘%zu’ expects type
‘size_t’, but argument 11 has type ‘ssize_t’
./trace/generated-tracers.h: In function ‘trace_usb_ohci_iso_td_data_overrun’:
./trace/generated-tracers.h:2796: warning: format ‘%zu’ expects type
‘size_t’, but argument 7 has type ‘ssize_t’

./trace/generated-tracers.h:10368: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 9 has type ‘ssize_t’
./trace/generated-tracers.h: In function ‘trace_v9fs_readdir_return’:
./trace/generated-tracers.h:10392: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 9 has type ‘ssize_t’
./trace/generated-tracers.h: In function ‘trace_v9fs_write_return’:
./trace/generated-tracers.h:10416: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 9 has type ‘ssize_t’
  CC    util/qemu-config.o
./trace/generated-tracers.h: In function ‘trace_spice_vmc_write’:
./trace/generated-tracers.h:6516: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 6 has type ‘ssize_t’
  CC    util/qemu-sockets.o
./trace/generated-tracers.h: In function ‘trace_v9fs_read_return’:
./trace/generated-tracers.h:10368: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 9 has type ‘ssize_t’
./trace/generated-tracers.h: In function ‘trace_v9fs_readdir_return’:
./trace/generated-tracers.h:10392: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 9 has type ‘ssize_t’
./trace/generated-tracers.h: In function ‘trace_v9fs_write_return’:
./trace/generated-tracers.h:10416: warning: format ‘%zd’ expects type
‘signed size_t’, but argument 9 has type ‘ssize_t’
  CC    util/notify.o

I think this is a quirk of this elderly mingw setup that's come up
before, but I forget what the resolution of it was.
(I now have a more up to date mingw build in the mix too, so I'm
not completely averse to the suggestion of "drop this thing".)

thanks
-- PMM
Paolo Bonzini Feb. 3, 2016, 6:49 p.m. UTC | #2
On 03/02/2016 18:55, Peter Maydell wrote:
> On 3 February 2016 at 15:47, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>> The following changes since commit c65db7705b7926f4a084b93778e4bd5dd3990aad:
>>
>>   Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-for-peter-2016-02-02' into staging (2016-02-02 18:04:04 +0000)
>>
>> are available in the git repository at:
>>
>>   git://github.com/stefanha/qemu.git tags/tracing-pull-request
>>
>> for you to fetch changes up to c84ea00dc29b2084a62bd31f498ed0f245d3848e:
>>
>>   log: add "-d trace:PATTERN" (2016-02-03 10:37:50 +0000)
>>
>> ----------------------------------------------------------------
> 
> Hi. I'm afraid this fails to compile on Windows:
> 
> In file included from /home/petmay01/linaro/qemu-for-merges/include/trace.h:4,
>                  from
> /home/petmay01/linaro/qemu-for-merges/util/oslib-win32.c:38:
> ./trace/generated-tracers.h: In function ‘trace_virtio_console_flush_buf’:
> ./trace/generated-tracers.h:240: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 8 has type ‘ssize_t’
>   CC    util/hbitmap.o
> ./trace/generated-tracers.h: In function ‘trace_usb_ohci_iso_td_so’:
> ./trace/generated-tracers.h:2784: warning: format ‘%zu’ expects type
> ‘size_t’, but argument 11 has type ‘ssize_t’
> ./trace/generated-tracers.h: In function ‘trace_usb_ohci_iso_td_data_overrun’:
> ./trace/generated-tracers.h:2796: warning: format ‘%zu’ expects type
> ‘size_t’, but argument 7 has type ‘ssize_t’
>   CC    util/fifo8.o
>   CC    util/acl.o
> ./trace/generated-tracers.h: In function ‘trace_spice_vmc_write’:
> ./trace/generated-tracers.h:6516: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 6 has type ‘ssize_t’
>   CC    util/error.o
>   CC    util/qemu-error.o
> cc1: warnings being treated as errors
> In file included from /home/petmay01/linaro/qemu-for-merges/include/trace.h:4,
>                  from /home/petmay01/linaro/qemu-for-merges/util/hbitmap.c:18:
> ./trace/generated-tracers.h: In function ‘trace_virtio_console_flush_buf’:
> ./trace/generated-tracers.h:240: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 8 has type ‘ssize_t’
>   CC    util/id.o
>   CC    util/iov.o
> ./trace/generated-tracers.h: In function
> ‘trace_usb_ohci_iso_td_so’:./trace/generated-tracers.h: In function
> ‘trace_v9fs_read_return’:
> ./trace/generated-tracers.h:2784: warning: format ‘%zu’ expects type
> ‘size_t’, but argument 11 has type ‘ssize_t’
> ./trace/generated-tracers.h: In function ‘trace_usb_ohci_iso_td_data_overrun’:
> ./trace/generated-tracers.h:2796: warning: format ‘%zu’ expects type
> ‘size_t’, but argument 7 has type ‘ssize_t’
> 
> ./trace/generated-tracers.h:10368: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 9 has type ‘ssize_t’
> ./trace/generated-tracers.h: In function ‘trace_v9fs_readdir_return’:
> ./trace/generated-tracers.h:10392: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 9 has type ‘ssize_t’
> ./trace/generated-tracers.h: In function ‘trace_v9fs_write_return’:
> ./trace/generated-tracers.h:10416: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 9 has type ‘ssize_t’
>   CC    util/qemu-config.o
> ./trace/generated-tracers.h: In function ‘trace_spice_vmc_write’:
> ./trace/generated-tracers.h:6516: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 6 has type ‘ssize_t’
>   CC    util/qemu-sockets.o
> ./trace/generated-tracers.h: In function ‘trace_v9fs_read_return’:
> ./trace/generated-tracers.h:10368: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 9 has type ‘ssize_t’
> ./trace/generated-tracers.h: In function ‘trace_v9fs_readdir_return’:
> ./trace/generated-tracers.h:10392: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 9 has type ‘ssize_t’
> ./trace/generated-tracers.h: In function ‘trace_v9fs_write_return’:
> ./trace/generated-tracers.h:10416: warning: format ‘%zd’ expects type
> ‘signed size_t’, but argument 9 has type ‘ssize_t’
>   CC    util/notify.o
> 
> I think this is a quirk of this elderly mingw setup that's come up
> before, but I forget what the resolution of it was.
> (I now have a more up to date mingw build in the mix too, so I'm
> not completely averse to the suggestion of "drop this thing".)

Looks like this was always broken, it just required some extra configure
argument.

I would "drop this thing" or, better, you could compile with
"--enable-trace-backend=nop" on the old mingw setup and without it on
the new one.  This has the additional advantage of better coverage.

We should also add -Werror=format to the Makefile.

Paolo
Peter Maydell Feb. 4, 2016, 11:05 a.m. UTC | #3
On 3 February 2016 at 18:49, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 03/02/2016 18:55, Peter Maydell wrote:
>> On 3 February 2016 at 15:47, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>> I think this is a quirk of this elderly mingw setup that's come up
>> before, but I forget what the resolution of it was.
>> (I now have a more up to date mingw build in the mix too, so I'm
>> not completely averse to the suggestion of "drop this thing".)
>
> Looks like this was always broken, it just required some extra configure
> argument.
>
> I would "drop this thing" or, better, you could compile with
> "--enable-trace-backend=nop" on the old mingw setup and without it on
> the new one.  This has the additional advantage of better coverage.

I added this configure argument and the build does pass, so I've
pushed it to master. I probably will drop the build config
entirely at some point though, IIRC it doesn't actually build
working executables. It's kind of handy to have one elderly
gcc in the mix, though, as long as the mingw foibles don't
cause too much hassle.

thanks
-- PMM