All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Tafelmeier <matthias.tafelmeier@gmx.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, hagen@jauu.net, shemminger@osdl.org,
	fw@strlen.de, edumazet@google.com, daniel@iogearbox.net
Subject: Re: [PATCH v7 02/10] ss: created formatters for json and hr
Date: Thu, 24 Sep 2015 19:43:46 +0200	[thread overview]
Message-ID: <56043652.4050603@gmx.net> (raw)
In-Reply-To: <20150923162650.148fe95b@urahara>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA384

On 09/24/2015 01:26 AM, Stephen Hemminger wrote:
> Having JSON output is going to be a real plus for programatic
> parsing. My understanding of best practice with JSON is that it is
> best to output values in best machine readable form, the format is
> not really meant for humans to directly read.
> 
> Therefore I don't like the code that reformats numbers as hex. If
> the values are better displayed in hex, then it is up to the
> program parsing and presenting that to the user to do that. The
> JSON should just put out numeric values as numeric.
> 
>> +/* hex conversion helper */ +static void
>> jsonw_hex_as_str_outp(json_writer_t *self, uint64_t num) +{ +
>> char tmp[17]; + +	sprintf(tmp, "%"PRIx64, num); +
>> jsonw_string(self, tmp); +} + +static void
>> jsonw_hex_field_outp(json_writer_t *self, const char *prop,
>> uint64_t num) +{ +	jsonw_name(self, prop); +
>> jsonw_hex_as_str_outp(self, num); +} +

I acknowledge that.

> Other than that, my only other discomfort is that this patch set 
> makes the code grow so much larger and it becomes more complex for
> future developers.

Really? Somehow I disagree: I mean most of the code has been copied
over to semantically related modules. So not too much new code has
been added. Modularization in essence should help to get up with
complexity as I see things.

> Maybe it is time to rewrite it in a better language ;-)

I did not get that. Do you mean iproute2?



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBCQAGBQJWBDZSAAoJEOAWT1uK3zQ7lz4H/33aiWxf+Xzk9jjuEToyMMUL
qjhzMKkADOvSABHa0bsYUxuQrT1ZHYiv7yYWbn5N/3yUwnoFpivfQEO+YStfVtQy
kCW0CNkyhIC8Hd379vVtZf2eLgGhlHDNudfJvZ/F29Rdsb1NjRoWb3qjXmUX0Ns3
T9Ee7UHbN1oQuL4C1+XtFTl0mG7/UtIC5vk6/LTRY7G0oqmcfIzG26STiP5Q4++m
72JQP9jv9pAZzVoYMcnuj4vkVJ3rKfUoQS6Ejz4Y1tXlBeU3iXvL0Pb6h5EDWf7L
iNbk60NT9Y/KSWwIaf8iTFeH5K+NcgT+JQOe0iFH930Nme7lCXf38vuzBIsSfX0=
=fcNC
-----END PGP SIGNATURE-----

  reply	other threads:[~2015-09-24 17:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 19:34 iproute2 v7: full ss json support and general output simplification Matthias Tafelmeier
2015-09-10 19:34 ` [PATCH v7 01/10] ss: rooted out ss type declarations for output formatters Matthias Tafelmeier
2015-09-10 19:35 ` [PATCH v7 02/10] ss: created formatters for json and hr Matthias Tafelmeier
2015-09-23 23:26   ` Stephen Hemminger
2015-09-24 17:43     ` Matthias Tafelmeier [this message]
     [not found]     ` <bc9cacb94de24857a7d9e13960bfae56@HQ1WP-EXMB11.corp.brocade.com>
2015-09-24 22:16       ` Stephen Hemminger
2015-09-25  6:01         ` Matthias Tafelmeier
2015-10-28  8:07           ` Matthias Tafelmeier
2015-10-28  8:28             ` Phil Sutter
2015-10-28 11:57               ` Matthias Tafelmeier
2015-10-28 15:05                 ` Phil Sutter
2015-10-28 15:50                   ` Matthias Tafelmeier
     [not found]           ` <b114412a541d4273a9a7a1c0ae4777df@HQ1WP-EXMB11.corp.brocade.com>
2015-11-02 23:06             ` Stephen Hemminger
2015-11-03  6:54               ` Matthias Tafelmeier
2015-10-27 12:21   ` Phil Sutter
2015-10-27 13:47     ` David Miller
2015-10-27 13:35       ` Phil Sutter
2015-09-10 19:35 ` [PATCH v7 03/10] ss: removed obsolet fmt functions Matthias Tafelmeier
2015-09-10 19:35 ` [PATCH v7 04/10] ss: prepare timer for output handler usage Matthias Tafelmeier
2015-09-10 19:35 ` [PATCH v7 05/10] ss: replaced old output with new generic output mechanisms Matthias Tafelmeier
2015-10-27 13:04   ` Phil Sutter
2015-09-10 19:35 ` [PATCH v7 06/10] ss: renaming and export of current_filter Matthias Tafelmeier
2015-10-27 13:10   ` Phil Sutter
2015-09-10 19:35 ` [PATCH v7 07/10] ss: symmetrical subhandler output extension example Matthias Tafelmeier
2015-10-27 13:13   ` Phil Sutter
2015-09-10 19:35 ` [PATCH v7 08/10] ss: symmetrical formatter " Matthias Tafelmeier
2015-10-27 13:17   ` Phil Sutter
2015-09-10 19:35 ` [PATCH v7 09/10] ss: fixed free on local array for valid json output Matthias Tafelmeier
2015-10-27 13:19   ` Phil Sutter
2015-09-10 19:35 ` [PATCH v7 10/10] ss: activate json_writer excluded logic Matthias Tafelmeier
2015-10-27 13:21   ` Phil Sutter
2015-10-28  2:39     ` Stephen Hemminger
2015-10-28  8:17       ` Phil Sutter

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=56043652.4050603@gmx.net \
    --to=matthias.tafelmeier@gmx.net \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=hagen@jauu.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    --cc=stephen@networkplumber.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.