All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 43/43] qobject: move dump_qobject() from block/ to qobject/
Date: Fri, 09 Jun 2017 14:40:57 +0200	[thread overview]
Message-ID: <87a85hl4fa.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1764775958.32020420.1497003321879.JavaMail.zimbra@redhat.com> ("Marc-André Lureau"'s message of "Fri, 9 Jun 2017 06:15:21 -0400 (EDT)")

Marc-André Lureau <marcandre.lureau@redhat.com> writes:

> Hi
>
> ----- Original Message -----
>> > 
>> > The title claims "move dump_qobject() from block/ to qobject/", but
>> > that's not what the patch does.  It *replaces* dump_qobject() by
>> > qobject_to_string().  The former dumps to a callback, the latter to a
>> > dynamic string buffer.
>> > 
>> > Providing dump functionality in one way doesn't preclude the other way:
>> > given callback, one could define a callback that builds up a string
>> > buffer, and given buffer, one could (and you actually do) pass the
>> > buffer to a callback.  That's less efficient, though.
>> > 
>> > Trading efficiency for ease-of-use should be okay here, but I'm cc'ing
>> > Max and Kevin to double-check.
>> 
>> I believe convenience is more important than efficiency here. It's easy to
>> call qobject_to_string(foo) from gdb for example, with a callback, it's less
>> easy.
>> 
>> (fprintf or monitor_fprintf will both build an internal buffer anyway,
>> efficiency is probably similar)

monitor_vprintf() formats to a dynamic buffer, which it passes to
monitor_puts().  monitor_puts() uses a line buffer.

fprintf() can be unbuffered, line-buffered, or fully buffered.

Converting everything to a string first is different: the string buffer
holds *everything* rather than just a line or some fixed size.

> Hmm, there are more allocations in qobject_to_string() though

  reply	other threads:[~2017-06-09 12:41 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 16:35 [Qemu-devel] [PATCH v3 00/43] qobject/qapi: add uint type Marc-André Lureau
2017-06-07 16:35 ` [Qemu-devel] [PATCH v3 01/43] qdev: remove PropertyInfo.qtype field Marc-André Lureau
2017-06-07 16:35 ` [Qemu-devel] [PATCH v3 02/43] object: fix potential leak in getters Marc-André Lureau
2017-06-07 16:35 ` [Qemu-devel] [PATCH v3 03/43] tests: Remove test cases for alternates of 'number' and 'int' Marc-André Lureau
2017-06-07 16:35 ` [Qemu-devel] [PATCH v3 04/43] tests: add more int/number ranges checks Marc-André Lureau
2017-06-08 14:55   ` Markus Armbruster
2017-06-07 16:35 ` [Qemu-devel] [PATCH v3 05/43] qapi: minor refactoring Marc-André Lureau
2017-06-08 14:57   ` Markus Armbruster
2017-06-07 16:35 ` [Qemu-devel] [PATCH v3 06/43] qapi: merge QInt and QFloat in QNum Marc-André Lureau
2017-06-08 15:54   ` Markus Armbruster
2017-06-07 16:35 ` [Qemu-devel] [PATCH v3 07/43] qapi: Remove visit_start_alternate() parameter promote_int Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 08/43] tests: remove /{qnum, qlist, dict}/destroy test Marc-André Lureau
2017-06-08 15:00   ` Markus Armbruster
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 09/43] qnum: add uint type Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 10/43] json: learn to parse uint64 numbers Marc-André Lureau
2017-06-08 16:27   ` Markus Armbruster
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 11/43] qapi: update the qobject visitor to use QNUM_U64 Marc-André Lureau
2017-06-08 16:36   ` Markus Armbruster
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 12/43] object: add uint property setter/getter Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 13/43] q35: fix get_mmcfg_size to use uint64 visitor Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 14/43] object: use more specific property type names Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 15/43] qdev: rename DEFINE_PROP_DEFAULT() to DEFINE_PROP_SIGNED() Marc-André Lureau
2017-06-08 16:42   ` Markus Armbruster
2017-06-08 17:01     ` Markus Armbruster
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 16/43] qdev: wrap default property value in an union Marc-André Lureau
2017-06-08 17:01   ` Markus Armbruster
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 17/43] qdev: avoid type casts between signed and unsigned Marc-André Lureau
2017-06-08 17:08   ` Markus Armbruster
2017-06-09 10:04     ` Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 18/43] apic-common: make "id" property a uint32 Marc-André Lureau
2017-06-08 16:39   ` Markus Armbruster
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 19/43] qdev: use appropriate getter/setters type Marc-André Lureau
2017-06-08 17:23   ` Markus Armbruster
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 20/43] isa: use get_uint() for "io-base" Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 21/43] pc-dimm: use get_uint() for dimm properties Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 22/43] pc-dimm: make "size" property uint64 Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 23/43] pcihp: use get_uint() for "bsel" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 24/43] aspeed: use {set, get}_uint() for "ram-size" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 25/43] bcm2835_fb: use {get, set}_uint() for "vcram-size" and "vcram-base" Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 26/43] platform-bus: use get_uint() for "addr" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 27/43] acpi: use get_uint() for "acpi-pcihp-io*" properties Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 28/43] acpi: use get_uint() for various acpi properties Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 29/43] acpi: use get_uint() for "pci-hole*" properties Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 30/43] pc: use get_uint() for "iobase" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 31/43] pc: use get_uint() for "apic-id" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 32/43] pc: use get_uint() for "hpet-intcap" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 33/43] xen: use get_uint() for "max-ram-below-4g" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 34/43] arm: use get_uint() for "mp-affinity" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 35/43] auxbus: use get_uint() for "addr" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 36/43] pvpanic: use get_uint() for "ioport" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 37/43] pnv-core: use get_uint() for "core-pir" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 38/43] numa: use get_uint() for "size" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 39/43] i386/cpu: use get_uint() for "min-level"/"min-xlevel" properties Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 40/43] console: use get_uint() for "head" property Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 41/43] tests/qdict: check more get_try_int() cases Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 42/43] RFC: qdict: add uint Marc-André Lureau
2017-06-08 17:25   ` Markus Armbruster
2017-06-09 10:05     ` Marc-André Lureau
2017-06-07 16:36 ` [Qemu-devel] [PATCH v3 43/43] qobject: move dump_qobject() from block/ to qobject/ Marc-André Lureau
2017-06-08 17:43   ` Markus Armbruster
2017-06-09 10:11     ` Marc-André Lureau
2017-06-09 10:15       ` Marc-André Lureau
2017-06-09 12:40         ` Markus Armbruster [this message]
2017-06-09 12:46           ` Eric Blake
2017-06-09 14:34     ` Max Reitz
2017-06-07 20:41 ` [Qemu-devel] [PATCH v3 00/43] qobject/qapi: add uint type no-reply
2017-06-08  1:47 ` no-reply
2017-06-09 12:32 ` Markus Armbruster
2017-06-09 13:06   ` Marc-André Lureau

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=87a85hl4fa.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.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.