qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] trace-events: print 0x before hex numbers


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH] trace-events: print 0x before hex numbers
Date: Fri, 28 Jul 2017 10:06:37 +0100
User-agent: Mutt/1.8.3 (2017-05-23)

On Fri, Jul 28, 2017 at 11:55:47AM +0300, Vladimir Sementsov-Ogievskiy wrote:
> To make logs more readable prefix all hex values with '0x' mark.
> This is needed for consistency too, as a lot of hex values are already
> prefixed with '0x'. Also, bring all hex outputs to the common form -
> use '%#', not '0x%'.
> 
> This patch is done by two commands:
> find . -name trace-events | \
>  xargs sed -i 's/%\([-+ 
> *.0-9]*\([hljztL]\|ll\|hh\)\?\(x\|X\|"\s*PRIx\)\)/%#\1/g'
> find . -name trace-events | xargs sed -i 's/0x%#/%#/g'

I fear that despite your cleanup, these mistakes will be frequently
re-introduced.  IOW, I think you should add to scripts/checkpatch.pl
to re-validate any patch which touches a trace-events file, to
prevent further regressions.

> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> 
> 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. Hope I'm
> not alone who is not comfortable with it, so, what about a patch like this?
> May be regexp's should be improved but, I think, the common idea is clear.

Yeah, I agree - mixing decimal & hex values with no 0x prefix is horribly
misleading at best.



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 :|



reply via email to

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