qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 00/15] Debug output revamp


From: Andreas Färber
Subject: [Qemu-devel] [PATCH v2 00/15] Debug output revamp
Date: Thu, 21 Feb 2013 05:24:56 +0100

Hello,

Based on suggestions from Igor Mitsyanko, Anthony and Alex this series aims to
expose debug output to compile-testing, so that it doesn't constantly break.
The basic requirement is to move format strings and arguments out of
#ifdef sections or no-op macros, so that the C compiler sees and checks them
and doesn't need even more #ifdefs for variable definitions.

For one thing this is to catch format string breakages caused by type changes,
so that debug output still can be enabled when needed.

For another it is to assist in catching refactored, e.g., CPU_COMMON fields,
to not break things further in new patches.

v2 replaces macros with static functions, adopting Scott's scheme of const
variables set through #ifdefs (keeping their defined() semantics) and adopting
Anthony's proposal of using va_list for argument passing.
v1 had changed some #ifdefs into ifs due to the #ifdef -> #if change; while not
strictly necessary anymore, I have not reverted this (mostly sparc).

In sparc and unicore32 macros remain as unconditional wrappers, due to
hardcoded prefix strings and __func__ prefix respectively.

dprintf() is available in glibc since 2.10, so we cannot use that function name.
After this series for target-*, some more dprintf occurrences remain in:
* hw/s390-virtio{,-bus}.c
* hw/spapr_{llan,vio,vscsi}.c
* spice-qemu-char.c
whereas linux-user is actually using the glibc function.

Patches 1-2 are more bug fixes found by enabling today's debug output.
Alex, please apply to ppc-next.

Patch 3 introduces a missing qemu-log varargs function variant.
Patches 4-5 are preparatory Coding Style cleanups.
Patches 6-15 do the actual macro refactoring per target.

Available from:
git://github.com/afaerber/qemu-cpu.git dprintf.v2
https://github.com/afaerber/qemu-cpu/commits/dprintf.v2

Regards,
Andreas

v1 -> v2:
* Fixed some more broken ppc debug output.
* Prepended patch to add qemu_log_mask_vprintf().
* Replaced macros with functions, dropping all G_STMT_{START,END} and
  do {...} while(0) silliness and marking with GCC_FMT_ATTR().
* Renamed dprintf() in target-ppc/kvm.c and target-s390x/kvm.c to
  kvm_dprintf() to avoid conflicts with glibc's dprintf().
* Inlined PPC_DUMP_SPR_ACCESSES checks to avoid further regressions.

>From qemu-log patch v1:
* Added gtk-doc documentation.

Cc: Anthony Liguori <address@hidden>
Cc: Blue Swirl <address@hidden>
Cc: Igor Mitsyanko <address@hidden>
Cc: Fréderic Konrad <address@hidden>
Cc: Alexander Graf <address@hidden>
Cc: Scott Wood <address@hidden>
Cc: Markus Armbruster <address@hidden>
Cc: Peter Maydell <address@hidden>

Cc: Edgar E. Iglesias <address@hidden> (cris, mblaze)
Cc: address@hidden
Cc: Richard Henderson <address@hidden> (i386, s390x)
Cc: Michael Walle <address@hidden> (lm32)
Cc: Peter Crosthwaite <address@hidden> (mblaze)
Cc: Jia Liu <address@hidden> (or32)
Cc: Guan Xuetao <address@hidden> (uc32)

Cc: Gerd Hoffmann <address@hidden> (spice)
Cc: David Gibson <address@hidden> (sPAPR)
Cc: Paolo Bonzini <address@hidden> (sPAPR vSCSI)
Cc: Christian Borntraeger <address@hidden> (s390x)

Andreas Färber (15):
  target-ppc: Fix PPC_DUMP_SPR_ACCESS build
  target-ppc: Move PPC_DUMP_CPU to translate.c
  qemu-log: Introduce qemu_log_mask_vprintf()
  target-cris/helper.c: Update Coding Style
  target-cris/mmu.c: Update Coding Style of cris_mmu_translate_page()
  target-alpha: Refactor debug output macros
  target-cris: Refactor debug output macros
  target-i386: Refactor debug output macros
  target-lm32: Refactor debug output macros
  target-microblaze: Refactor debug output macros
  target-openrisc: Refactor debug output macros
  target-ppc: Refactor debug output macros
  target-s390x: Refactor debug output macros
  target-sparc: Refactor debug output macros
  target-unicore32: Refactor debug output macros

 include/qemu/log.h            |   16 ++
 target-alpha/translate.c      |   14 +-
 target-cris/helper.c          |  421 +++++++++++++++++++++--------------------
 target-cris/mmu.c             |  342 +++++++++++++++++----------------
 target-cris/op_helper.c       |   16 +-
 target-cris/translate.c       |   23 +--
 target-i386/helper.c          |   42 ++--
 target-i386/kvm.c             |   16 +-
 target-i386/seg_helper.c      |   24 ++-
 target-lm32/translate.c       |   14 +-
 target-microblaze/helper.c    |   48 ++++-
 target-microblaze/mmu.c       |   38 ++--
 target-microblaze/op_helper.c |    2 -
 target-microblaze/translate.c |   14 +-
 target-openrisc/translate.c   |   14 +-
 target-ppc/excp_helper.c      |   30 ++-
 target-ppc/kvm.c              |   28 ++-
 target-ppc/mem_helper.c       |    2 -
 target-ppc/mmu_helper.c       |   71 +++++--
 target-ppc/translate.c        |   16 +-
 target-ppc/translate_init.c   |   41 ++--
 target-s390x/cc_helper.c      |   14 +-
 target-s390x/fpu_helper.c     |    7 -
 target-s390x/helper.c         |   53 ++++--
 target-s390x/int_helper.c     |   14 +-
 target-s390x/kvm.c            |   33 ++--
 target-s390x/mem_helper.c     |   14 +-
 target-s390x/misc_helper.c    |   14 +-
 target-s390x/translate.c      |   23 +--
 target-sparc/cpu.c            |   38 ++--
 target-sparc/ldst_helper.c    |  221 ++++++++++++---------
 target-unicore32/helper.c     |   18 +-
 target-unicore32/softmmu.c    |   17 +-
 33 Dateien geändert, 1063 Zeilen hinzugefügt(+), 635 Zeilen entfernt(-)

-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]