From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afUKj-0005io-Ft for qemu-devel@nongnu.org; Mon, 14 Mar 2016 11:23:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afUKf-0005S3-OS for qemu-devel@nongnu.org; Mon, 14 Mar 2016 11:23:01 -0400 Received: from mail-db3on0110.outbound.protection.outlook.com ([157.55.234.110]:43328 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afUKf-0005RV-F9 for qemu-devel@nongnu.org; Mon, 14 Mar 2016 11:22:57 -0400 References: <1457954501-26528-1-git-send-email-den@openvz.org> <1457954501-26528-6-git-send-email-den@openvz.org> <56E6CB13.3020406@redhat.com> From: "Denis V. Lunev" Message-ID: <56E6D39A.1020801@openvz.org> Date: Mon, 14 Mar 2016 18:07:06 +0300 MIME-Version: 1.0 In-Reply-To: <56E6CB13.3020406@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/9] log: improve performance of qemu_log and qemu_log_mask if disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On 03/14/2016 05:30 PM, Paolo Bonzini wrote: > > On 14/03/2016 12:21, Denis V. Lunev wrote: >> The patch is intended to avoid to perform any operation including >> calculation of log function arguments when the log is not enabled due to >> various reasons. >> >> Functions qemu_log and qemu_log_mask are replaced with variadic macros. >> >> Format checking performed by compiler will not suffer by this patch. It >> will be done inside in fprintf arguments checking. > Have you encountered a place that was calling them so hard that it > caused performance problem? If so, the logging should probably be > replaced by a tracepoint. > > Paolo > inline functions can have side-effects, i.e. the arguments of them can be evaluated depending on the compiler. with this approach we are sure that this will not happen, ever. Den