From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNnV4-0006yI-39 for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:08:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNnV2-0006ur-Ef for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:08:33 -0500 Received: from [199.232.76.173] (port=35066 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNnV2-0006ue-9K for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:08:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:49424) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNnV1-0006eV-Ng for qemu-devel@nongnu.org; Fri, 16 Jan 2009 07:08:32 -0500 Message-ID: <49707A15.5030803@suse.de> Date: Fri, 16 Jan 2009 13:14:13 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH -v2 1/2] Log reset events References: <49705BCF.8020506@siemens.com> <761ea48b0901160220o371db87m94c4ad83a2f65a09@mail.gmail.com> <49707035.2000606@siemens.com> <49707600.3070509@siemens.com> In-Reply-To: <49707600.3070509@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org Jan Kiszka schrieb: > [ Updated to use new log API. ] > > Original idea&code by Kevin Wolf, now split-up in two patches and added > more archs. > > This patch introduces a flag to log CPU resets. Useful for tracing > unexpected resets (such as those triggered by x86 triple faults). > > Signed-off-by: Jan Kiszka > Acked-by: Kevin Wolf > --- > > cpu-all.h | 1 + > exec.c | 2 ++ > target-arm/helper.c | 6 ++++++ > target-cris/translate.c | 5 +++++ > target-i386/helper.c | 5 +++++ > target-m68k/helper.c | 5 +++++ > target-mips/translate.c | 5 +++++ > target-ppc/helper.c | 8 ++++++-- > target-sh4/translate.c | 5 +++++ > target-sparc/helper.c | 5 +++++ > 10 files changed, 45 insertions(+), 2 deletions(-) > > diff --git a/cpu-all.h b/cpu-all.h > index ee0a6e3..59c686a 100644 > --- a/cpu-all.h > +++ b/cpu-all.h > @@ -816,6 +816,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr); > #define CPU_LOG_PCALL (1 << 6) > #define CPU_LOG_IOPORT (1 << 7) > #define CPU_LOG_TB_CPU (1 << 8) > +#define CPU_LOG_RESET (1 << 9) > > /* define log items */ > typedef struct CPULogItem { > diff --git a/exec.c b/exec.c > index faa6333..fa2ebbd 100644 > --- a/exec.c > +++ b/exec.c > @@ -1569,6 +1569,8 @@ const CPULogItem cpu_log_items[] = { > #ifdef TARGET_I386 > { CPU_LOG_PCALL, "pcall", > "show protected mode far calls/returns/exceptions" }, > + { CPU_LOG_RESET, "cpu_reset", > + "show CPU state before CPU resets" }, > #endif > #ifdef DEBUG_IOPORT > { CPU_LOG_IOPORT, "ioport", > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 81663c8..a243d9b 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -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? Kevin