From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNor9-0006Al-5U for qemu-devel@nongnu.org; Fri, 16 Jan 2009 08:35:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNor7-00068N-1P for qemu-devel@nongnu.org; Fri, 16 Jan 2009 08:35:26 -0500 Received: from [199.232.76.173] (port=51042 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNor6-000680-DO for qemu-devel@nongnu.org; Fri, 16 Jan 2009 08:35:24 -0500 Received: from gecko.sbs.de ([194.138.37.40]:21373) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNor5-0001jv-RX for qemu-devel@nongnu.org; Fri, 16 Jan 2009 08:35:24 -0500 Received: from mail1.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n0GDZKRR031615 for ; Fri, 16 Jan 2009 14:35:20 +0100 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n0GDZKU3002228 for ; Fri, 16 Jan 2009 14:35:20 +0100 Message-ID: <49708D1A.7050207@siemens.com> Date: Fri, 16 Jan 2009 14:35:22 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <49705BCF.8020506@siemens.com> <761ea48b0901160220o371db87m94c4ad83a2f65a09@mail.gmail.com> <49707035.2000606@siemens.com> <49707600.3070509@siemens.com> <49707A15.5030803@suse.de> <761ea48b0901160412i67bb876flcb0070ccdf4ac120@mail.gmail.com> <49707CD2.8090003@suse.de> <49707D1C.1080907@siemens.com> In-Reply-To: <49707D1C.1080907@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH -v2 1/2] Log reset events Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jan Kiszka wrote: > Kevin Wolf wrote: >> Laurent Desnogues schrieb: >>> On Fri, Jan 16, 2009 at 1:14 PM, Kevin Wolf wrote: >>> [..] >>>>> @@ -159,6 +159,12 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) >>>>> void cpu_reset(CPUARMState *env) >>>>> { >>>>> uint32_t id; >>>>> + >>>>> + if (qemu_loglevel_mask(CPU_LOG_RESET)) { >>>>> + fprintf(logfile, "CPU Reset (CPU %d)\n", env->cpu_index); >>>>> + cpu_dump_state(env, logfile, fprintf, 0); >>>> Shouldn't that be qemu_log() and log_cpu_state() now? >>> Yes. Sorry Jan :) > > Well, the patch description misled me a bit ("global s/loglevel & > X/qemu_loglevel_mask(X)/"), but I also could have checked more carefully > what actually changed. > >>> A trick to check things are done properly is to make sure you >>> don't ever use logfile or loglevel variables. >> Maybe qemu_log() should be a function rather than a macro? Then loglevel >> and logfile could be static and the build would break if you try to use >> them outside the logging code. > > Sounds good (function-like macros are for corner cases only). > > I will try to make logfile/loglevel static and fix my patch accordingly. Making logfile and loglevel static means enforcing a function call just to check if we perform logging. Would the additional overhead be acceptable for all qemu_log* spots? Unless maintainers tell me "yes", I will not touch this part for now. Jan -- Siemens AG, Corporate Technology, CT SE 26 Corporate Competence Center Embedded Linux