From: Eric Blake <eblake@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Markus Armbruster <armbru@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
qemu-devel@nongnu.org, Pavel Butsykin <pbutsykin@virtuozzo.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] log hmp/qmp command
Date: Mon, 12 Oct 2015 07:49:16 -0600 [thread overview]
Message-ID: <561BBA5C.6050505@redhat.com> (raw)
In-Reply-To: <1444639295-6588-1-git-send-email-den@openvz.org>
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
On 10/12/2015 02:41 AM, Denis V. Lunev wrote:
> From: Pavel Butsykin <pbutsykin@virtuozzo.com>
>
> This log would be very welcome for long-term diagnostics of the system
> in the production. This log is at least necessary to understand what
> has been happened on the system and to identify issues at higher-level
> subsystems (libvirt, etc).
>
> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Luiz Capitulino <lcapitulino@redhat.com>
> CC: Eric Blake <eblake@redhat.com>
> ---
> @@ -3822,6 +3824,8 @@ static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
> error_setg(&local_err, QERR_JSON_PARSING);
> goto err_out;
> }
> + qemu_log_mask(LOG_CMD, "qmp \"%s\" requested\n",
> + qobject_to_json(obj)->string);
>
In addition to the leak already pointed out, qobject_to_json() can be
expensive, and it looks like we are doing that work unconditionally even
if the logging is not turned on. Is there a way to optimize so that the
conversion is only done when logging is enabled?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-10-12 13:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 8:41 [Qemu-devel] [PATCH 1/1] log hmp/qmp command Denis V. Lunev
2015-10-12 9:54 ` Denis V. Lunev
2015-10-12 13:49 ` Eric Blake [this message]
2015-10-12 13:58 ` Denis V. Lunev
2015-10-13 13:05 ` Luiz Capitulino
2015-10-13 13:18 ` Denis V. Lunev
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=561BBA5C.6050505@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=lcapitulino@redhat.com \
--cc=pbutsykin@virtuozzo.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 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).