From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=32789 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OjuOt-0004Sb-RL for qemu-devel@nongnu.org; Fri, 13 Aug 2010 09:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OjuOs-0001j5-LT for qemu-devel@nongnu.org; Fri, 13 Aug 2010 09:34:23 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:51317) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OjuOs-0001iz-H7 for qemu-devel@nongnu.org; Fri, 13 Aug 2010 09:34:22 -0400 Received: by qwh5 with SMTP id 5so2991198qwh.4 for ; Fri, 13 Aug 2010 06:34:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1281609395-17621-1-git-send-email-stefanha@linux.vnet.ibm.com> <1281609395-17621-9-git-send-email-stefanha@linux.vnet.ibm.com> Date: Fri, 13 Aug 2010 14:34:21 +0100 Message-ID: Subject: Re: [Qemu-devel] [PATCH 08/14] trace: Support for dynamically enabling/disabling trace events. From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Julien Desfossez , Prerna Saxena , Stefan Hajnoczi , qemu-devel@nongnu.org On Thu, Aug 12, 2010 at 7:02 PM, Blue Swirl wrote: > On Thu, Aug 12, 2010 at 10:36 AM, Stefan Hajnoczi > wrote: >> From: Prerna Saxena >> +#if defined(CONFIG_SIMPLE_TRACE) >> +static void do_info_trace(Monitor *mon) >> +{ >> + =A0 =A0st_print_trace((FILE *)mon, &monitor_fprintf); > > The cast is ugly. Is there no other way than passing falsified types? Yes. This approach is the solution that monitor.c currently uses for decoupling subsystem code from monitor code: static void do_info_registers(Monitor *mon) { CPUState *env; env =3D mon_get_cpu(); #ifdef TARGET_I386 cpu_dump_state(env, (FILE *)mon, monitor_fprintf, X86_DUMP_FPU); #else cpu_dump_state(env, (FILE *)mon, monitor_fprintf, 0); #endif } ...and others do it in order to avoid telling subsystems about Monitor. There are 4 other places in monitor.c before this patch that use this technique. I suggest leaving it and if someone implements a better approach, a search-replace will update monitor.c in one patch. >> diff --git a/simpletrace.c b/simpletrace.c >> index a6afc51..311fa44 100644 >> --- a/simpletrace.c >> +++ b/simpletrace.c >> @@ -11,6 +11,7 @@ >> =A0#include >> =A0#include >> =A0#include >> +#include > > The changes below don't seem to require this addition. You are right, this is a rebase/squash issue. Sorry, will fix in v2. Stefan