From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpFZ7-0006mn-NJ for qemu-devel@nongnu.org; Thu, 22 Oct 2015 09:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpFZ2-0002Bs-8v for qemu-devel@nongnu.org; Thu, 22 Oct 2015 09:05:57 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:36275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpFZ1-0002Bj-V5 for qemu-devel@nongnu.org; Thu, 22 Oct 2015 09:05:52 -0400 Received: by wicfx6 with SMTP id fx6so134760238wic.1 for ; Thu, 22 Oct 2015 06:05:51 -0700 (PDT) Sender: Paolo Bonzini References: <1444894224-9542-1-git-send-email-den@openvz.org> <1444894224-9542-3-git-send-email-den@openvz.org> <87oafzdmck.fsf_-_@blackfin.pond.sub.org> <20151021104144.GC13408@stefanha-thinkpad.redhat.com> <20151022122610.GA25820@stefanha-x1.localdomain> From: Paolo Bonzini Message-ID: <5628DF2C.5020005@redhat.com> Date: Thu, 22 Oct 2015 15:05:48 +0200 MIME-Version: 1.0 In-Reply-To: <20151022122610.GA25820@stefanha-x1.localdomain> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] What's the intended use of log.h logging? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , Peter Maydell Cc: QEMU Developers , "Denis V. Lunev" , Luiz Capitulino , Markus Armbruster , Pavel Butsykin On 22/10/2015 14:26, Stefan Hajnoczi wrote: > printk() - plain old printf > printk_once() - uses a static bool for once-only semantics, > modulo races between CPUs > printk_ratelimited() - time-based rate-limiting > > (And if you need to configure the ratelimit threshold, you can use the > underlying __ratelimit() function.) > > The same could work for QEMU. Existing "qemu log" stuff is mostly > printk(). Any messages that are not errors or warnings don't need > rate-limiting because they shouldn't be enabled by default (and when you > do want them for troubleshooting, then rate-limiting gets in the way). Actually, most of the "qemu log" stuff is TCG tracing. UNIMP and GUEST_ERROR are not tracing, and could indeed go to stderr with a rate-limiter (with a "-msg ratelimit=no" option). I agree with you about DPRINTF being sometimes tracing and sometimes logging. I'm planning to integrate the stderr tracing backend with qemu log. I think this is the most pressing need, and I think I can have some patches ready for comments on Monday. It depends on whether I'll decide to play with QEMU or LEGO Digital Designer on the way to Seoul. Second, we can integrate qemu log with "-msg timestamp=yes" and add the above rate-limiting functionality. Paolo