From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZldTh-0007kw-KD for qemu-devel@nongnu.org; Mon, 12 Oct 2015 09:49:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZldTa-0006W2-35 for qemu-devel@nongnu.org; Mon, 12 Oct 2015 09:49:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZldTZ-0006Vx-TQ for qemu-devel@nongnu.org; Mon, 12 Oct 2015 09:49:18 -0400 References: <1444639295-6588-1-git-send-email-den@openvz.org> From: Eric Blake Message-ID: <561BBA5C.6050505@redhat.com> Date: Mon, 12 Oct 2015 07:49:16 -0600 MIME-Version: 1.0 In-Reply-To: <1444639295-6588-1-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MaGqflK0Em84homlfwAuXmvQHptUM2nHa" Subject: Re: [Qemu-devel] [PATCH 1/1] log hmp/qmp command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Markus Armbruster , Luiz Capitulino , qemu-devel@nongnu.org, Pavel Butsykin This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MaGqflK0Em84homlfwAuXmvQHptUM2nHa Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/12/2015 02:41 AM, Denis V. Lunev wrote: > From: Pavel Butsykin >=20 > 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). >=20 > Signed-off-by: Pavel Butsykin > Signed-off-by: Denis V. Lunev > CC: Markus Armbruster > CC: Luiz Capitulino > CC: Eric Blake > --- > @@ -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); > =20 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? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MaGqflK0Em84homlfwAuXmvQHptUM2nHa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWG7pcAAoJEKeha0olJ0Nq2ecH/0gSGuv9QqP80r09Jm3f5k5J ojHWxSS9HXENEm4xN6dBBWyU2vG6NouFlpia0ANpFzsK/CClVVPpqukPnUffOrUr 2GnBELGrbBlCO9lBOzFbK9Tl4feVQKDkcVi0kaHC6hyhS55Vi69EboahJqvN0OA/ XZHj+20h16wmfeRa9sdAmWSihux0P44u8czPBKHJrKl4RW9IGwaXu6dExCLHIZLk eEA9MbbymA9kfYctf1JXNXenuC2VnmeeatGKMk0kUDvC0nkYNvq4ulA+qu3+K0LX WIeW8U55SL2eFGBsvvLkGTUSoIJyEoDEu0+pv8cocoBTLa7uQq4BhnaBUheAUYY= =dsEF -----END PGP SIGNATURE----- --MaGqflK0Em84homlfwAuXmvQHptUM2nHa--