From: Ryan Harper <ryanh@us.ibm.com>
To: Mark Wu <wudxw@linux.vnet.ibm.com>
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/6] trace: Add trace events group implementation in the backend "simple"
Date: Wed, 12 Oct 2011 15:46:30 -0500 [thread overview]
Message-ID: <20111012204630.GX19367@us.ibm.com> (raw)
In-Reply-To: <1318439659-7525-4-git-send-email-wudxw@linux.vnet.ibm.com>
* Mark Wu <wudxw@linux.vnet.ibm.com> [2011-10-12 12:26]:
>
> Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
> ---
> trace/simple.c | 30 ++++++++++++++++++++++++++++++
> trace/simple.h | 7 +++++++
> 2 files changed, 37 insertions(+), 0 deletions(-)
>
> diff --git a/trace/simple.c b/trace/simple.c
> index b639dda..7aa4c0b 100644
> --- a/trace/simple.c
> +++ b/trace/simple.c
> @@ -321,6 +321,16 @@ void trace_print_events(FILE *stream, fprintf_function stream_printf)
> }
> }
>
> +void trace_print_groups(FILE *stream, fprintf_function stream_printf)
> +{
> + unsigned int i;
> +
> + for (i = 0; i < NR_TRACE_EVENT_GROUPS; i++) {
> + stream_printf(stream, "%s [GROUP ID %u] : state %u\n",
> + trace_group_list[i].gp_name, i,
> + trace_group_list[i].state);
You've got a mix of space and tabs in this file. Remove the tabs and
adjust the spacing to CODING_STYLE rules.
> + }
> +}
> bool trace_event_set_state(const char *name, bool state)
> {
> unsigned int i;
> @@ -334,6 +344,26 @@ bool trace_event_set_state(const char *name, bool state)
> return false;
> }
>
> +bool trace_event_group_set_state(const char *gp_name, bool state)
> +{
> + unsigned int i;
> + unsigned int j;
> + TraceEventGroup *group;
> +
> + for (i = 0; i < NR_TRACE_EVENT_GROUPS; i++) {
> + group = &trace_group_list[i];
here
> + if (!strcmp(group->gp_name, gp_name)) {
> + group->state = state;
> +
> + for (j = group->start; j <= group->end; j++) {
here
> + trace_list[j].state = state;
> + }
> + return true;
> + }
> + }
> + return false;
> +}
> +
> /* Helper function to create a thread with signals blocked. Use glib's
> * portable threads since QEMU abstractions cannot be used due to reentrancy in
> * the tracer. Also note the signal masking on POSIX hosts so that the thread
> diff --git a/trace/simple.h b/trace/simple.h
> index 466e75b..cf119f3 100644
> --- a/trace/simple.h
> +++ b/trace/simple.h
> @@ -22,6 +22,13 @@ typedef struct {
> bool state;
> } TraceEvent;
>
> +typedef struct {
> + const char *gp_name;
> + bool state;
> + int start;
> + int end;
> +} TraceEventGroup;
> +
> void trace0(TraceEventID event);
> void trace1(TraceEventID event, uint64_t x1);
> void trace2(TraceEventID event, uint64_t x1, uint64_t x2);
> --
> 1.7.1
>
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com
next prev parent reply other threads:[~2011-10-12 20:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-12 17:14 [Qemu-devel] [PATCH 0/6] trace: Add support for trace events grouping Mark Wu
2011-10-12 17:14 ` [Qemu-devel] [PATCH 1/6] trace: Make "tracetool" generate a group list Mark Wu
2011-10-14 1:48 ` Sheldon
2011-10-12 17:14 ` [Qemu-devel] [PATCH 2/6] trace: Add HMP monitor commands for trace events group Mark Wu
2011-10-12 17:14 ` [Qemu-devel] [PATCH 3/6] trace: Add trace events group implementation in the backend "simple" Mark Wu
2011-10-12 20:46 ` Ryan Harper [this message]
2011-10-12 17:14 ` [Qemu-devel] [PATCH 4/6] trace: Add trace events group implementation in the backend "stderr" Mark Wu
2011-10-12 17:14 ` [Qemu-devel] [PATCH 5/6] trace: Enable "-trace events" argument to control initial state of groups Mark Wu
2011-10-12 17:14 ` [Qemu-devel] [PATCH 6/6] trace: Update doc for trace events group Mark Wu
2011-10-13 8:10 ` [Qemu-devel] [PATCH 0/6] trace: Add support for trace events grouping Mark Wu
2011-10-14 12:16 ` 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=20111012204630.GX19367@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
--cc=wudxw@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.