qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, eblake@redhat.com, mreitz@redhat.com,
	jsnow@redhat.com, vsementsov@virtuozzo.com, den@openvz.org,
	stefanha@gmail.com, peter.maydell@linaro.org,
	berrange@redhat.com
Subject: [Qemu-devel] [PATCH v2 0/4] trace-events: print 0x before hex numbers
Date: Sat, 29 Jul 2017 16:11:55 +0300	[thread overview]
Message-ID: <20170729131159.24949-1-vsementsov@virtuozzo.com> (raw)

Hi all!

It is hard to read logs, when there are hex and dec numbers in one line, when
hex number doesn't contain any letters and don't have '0x' prefix.

So, here is a complete solution for the problem:

- add information into CODING_STYLE
- add a check into checkpatch.pl
- fix current state

The new rule for the style is:

Hex numbers should be prefixed by '0x', except groups of numbers,
separated by symbols ' ', '.', ':', '/', however '0x' can be used for
numbers in such groups too. Flag '#' in number format is not allowed.

Note: checkpatch fails on checkpatch change (03) due to long lines.
It is because checkpatch.pl is indented by tabs and when it checks
for long lines it consider tabs as 8 spaces. Looks like nobody cares,
so do I. I see two ways here:
 -  s/\t/    /g
 -  make exclusion in checkpatch.pl for checkpatch.pl to consider tabs
    as 4 spaces, not 8.  However I don't want to fix it in the context
    of these series.

v2: almost everything (style, checkpatch, excluding number groups)
v1: was a draft of the idea using two sed commands.

Vladimir Sementsov-Ogievskiy (4):
  coding_style: add point about 0x in trace-events
  trace-events: fix code style: %# -> 0x%
  checkpatch: check trace-events code style
  trace-events: fix code style: print 0x before hex numbers

 CODING_STYLE              |  23 ++++++
 accel/tcg/trace-events    |   2 +-
 audio/trace-events        |   4 +-
 block/trace-events        |  28 ++++----
 hw/audio/trace-events     |   4 +-
 hw/char/trace-events      |  12 ++--
 hw/display/trace-events   |  14 ++--
 hw/dma/trace-events       |  20 +++---
 hw/i386/xen/trace-events  |  26 +++----
 hw/input/trace-events     |   6 +-
 hw/intc/trace-events      | 176 +++++++++++++++++++++++-----------------------
 hw/isa/trace-events       |   4 +-
 hw/misc/trace-events      |  78 ++++++++++----------
 hw/net/trace-events       |  52 +++++++-------
 hw/nvram/trace-events     |   2 +-
 hw/pci/trace-events       |   4 +-
 hw/ppc/trace-events       |  64 ++++++++---------
 hw/s390x/trace-events     |  20 +++---
 hw/scsi/trace-events      | 118 +++++++++++++++----------------
 hw/sd/trace-events        |   4 +-
 hw/timer/trace-events     |  20 +++---
 hw/usb/trace-events       |  56 +++++++--------
 hw/vfio/trace-events      |  44 ++++++------
 hw/virtio/trace-events    |   6 +-
 hw/xen/trace-events       |   8 +--
 linux-user/trace-events   |  10 +--
 migration/trace-events    |  36 +++++-----
 nbd/trace-events          |  18 ++---
 net/trace-events          |   4 +-
 scripts/checkpatch.pl     |  19 +++++
 target/arm/trace-events   |  10 +--
 target/s390x/trace-events |   2 +-
 target/sparc/trace-events |  30 ++++----
 trace-events              |  20 +++---
 34 files changed, 493 insertions(+), 451 deletions(-)

-- 
2.11.1

             reply	other threads:[~2017-07-29 13:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-29 13:11 Vladimir Sementsov-Ogievskiy [this message]
2017-07-29 13:11 ` [Qemu-devel] [PATCH v2 1/4] coding_style: add point about 0x in trace-events Vladimir Sementsov-Ogievskiy
2017-07-31  9:19   ` Stefan Hajnoczi
2017-07-31 12:45     ` Eric Blake
2017-07-29 13:11 ` [Qemu-devel] [PATCH v2 2/4] trace-events: fix code style: %# -> 0x% Vladimir Sementsov-Ogievskiy
2017-07-31  9:24   ` Stefan Hajnoczi
2017-07-31 12:48   ` Eric Blake
2017-07-29 13:11 ` [Qemu-devel] [PATCH v2 3/4] checkpatch: check trace-events code style Vladimir Sementsov-Ogievskiy
2017-07-31  9:26   ` Stefan Hajnoczi
2017-07-31 12:48     ` Eric Blake
2017-07-29 13:11 ` [Qemu-devel] [PATCH v2 4/4] trace-events: fix code style: print 0x before hex numbers Vladimir Sementsov-Ogievskiy
2017-07-31  9:36   ` Stefan Hajnoczi
2017-07-31  9:49   ` Cornelia Huck
2017-07-31 15:05     ` Vladimir Sementsov-Ogievskiy
2017-07-31 15:38       ` Cornelia Huck
2017-07-29 13:32 ` [Qemu-devel] [PATCH v2 0/4] trace-events: " no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170729131159.24949-1-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=berrange@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).