From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNnn3-0007il-Rp for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:27:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNnn3-0007iP-8J for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:27:09 -0500 Received: from [199.232.76.173] (port=42526 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNnn3-0007iM-5H for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:27:09 -0500 Received: from gecko.sbs.de ([194.138.37.40]:24603) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNnn2-0000tG-KO for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:27:08 -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 n0GCR6hK021853 for ; Fri, 16 Jan 2009 13:27:06 +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 n0GCR6Yg001635 for ; Fri, 16 Jan 2009 13:27:06 +0100 Message-ID: <49707D1C.1080907@siemens.com> Date: Fri, 16 Jan 2009 13:27:08 +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> In-Reply-To: <49707CD2.8090003@suse.de> 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 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. Jan -- Siemens AG, Corporate Technology, CT SE 26 Corporate Competence Center Embedded Linux