qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Julien Desfossez <ju@klipix.org>,
	Prerna Saxena <prerna@linux.vnet.ibm.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 08/14] trace: Support for dynamically enabling/disabling trace events.
Date: Fri, 13 Aug 2010 14:34:21 +0100	[thread overview]
Message-ID: <AANLkTim=zpvZ162d=p=J80KyBS38ZTYfWhbdWgSc7Mso@mail.gmail.com> (raw)
In-Reply-To: <AANLkTim5zZx6+BqhE6ZtJq=sy4DU_dJQcHFzKYJZOicU@mail.gmail.com>

On Thu, Aug 12, 2010 at 7:02 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Thu, Aug 12, 2010 at 10:36 AM, Stefan Hajnoczi
> <stefanha@linux.vnet.ibm.com> wrote:
>> From: Prerna Saxena <prerna@linux.vnet.ibm.com>
>> +#if defined(CONFIG_SIMPLE_TRACE)
>> +static void do_info_trace(Monitor *mon)
>> +{
>> +    st_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 = 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 @@
>>  #include <stdlib.h>
>>  #include <stdint.h>
>>  #include <stdio.h>
>> +#include <time.h>
>
> 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

  reply	other threads:[~2010-08-13 13:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12 10:36 [Qemu-devel] [PATCH 00/14] trace: Add static tracing to QEMU Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 01/14] trace: Add trace-events file for declaring trace events Stefan Hajnoczi
2010-08-12 16:07   ` malc
2010-08-12 19:15     ` Stefan Hajnoczi
2010-08-22 21:38   ` Anthony Liguori
2010-08-23 10:00     ` Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 02/14] trace: Trace qemu_malloc() and qemu_vmalloc() Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 03/14] trace: Trace virtio-blk, multiwrite, and paio_submit Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 04/14] trace: Trace virtqueue operations Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 05/14] trace: Trace port IO Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 06/14] trace: Trace entry point of balloon request handler Stefan Hajnoczi
2010-08-22 21:41   ` Anthony Liguori
2010-08-23 10:10     ` Stefan Hajnoczi
2010-08-23 13:15       ` Anthony Liguori
2010-08-12 10:36 ` [Qemu-devel] [PATCH 07/14] trace: Add simple built-in tracing backend Stefan Hajnoczi
2010-08-12 17:56   ` Blue Swirl
2010-08-12 19:31     ` Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 08/14] trace: Support for dynamically enabling/disabling trace events Stefan Hajnoczi
2010-08-12 18:02   ` Blue Swirl
2010-08-13 13:34     ` Stefan Hajnoczi [this message]
2010-08-12 10:36 ` [Qemu-devel] [PATCH 09/14] trace: Support disabled events in trace-events Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 10/14] trace: Specify trace file name Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 11/14] trace: Add trace-file command to open/close/flush trace file Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 12/14] trace: Add trace file name command-line option Stefan Hajnoczi
2010-08-22 21:45   ` Anthony Liguori
2010-08-12 10:36 ` [Qemu-devel] [PATCH 13/14] trace: Add LTTng Userspace Tracer backend Stefan Hajnoczi
2010-08-12 10:36 ` [Qemu-devel] [PATCH 14/14] trace: Add user documentation Stefan Hajnoczi
2010-08-22 21:47   ` Anthony Liguori
2010-08-23 10:11     ` Stefan Hajnoczi
2010-08-12 18:10 ` [Qemu-devel] [PATCH 00/14] trace: Add static tracing to QEMU Blue Swirl
2010-08-13 13:45   ` Stefan Hajnoczi
2010-08-13 19:07     ` Lluís
2010-08-22 21:47 ` Anthony Liguori
2010-09-05  7:30 ` [Qemu-devel] " Michael S. Tsirkin
2010-09-06 13:32   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTim=zpvZ162d=p=J80KyBS38ZTYfWhbdWgSc7Mso@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=ju@klipix.org \
    --cc=prerna@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).