From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE5qG-0000Wd-A6 for qemu-devel@nongnu.org; Wed, 12 Oct 2011 16:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RE5qF-00027K-BP for qemu-devel@nongnu.org; Wed, 12 Oct 2011 16:55:56 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:56781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RE5qF-00024q-8w for qemu-devel@nongnu.org; Wed, 12 Oct 2011 16:55:55 -0400 Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Oct 2011 16:47:26 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9CKkj9j246524 for ; Wed, 12 Oct 2011 16:46:45 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9CKkZJ9001764 for ; Wed, 12 Oct 2011 17:46:36 -0300 Date: Wed, 12 Oct 2011 15:46:30 -0500 From: Ryan Harper Message-ID: <20111012204630.GX19367@us.ibm.com> References: <1318439659-7525-1-git-send-email-wudxw@linux.vnet.ibm.com> <1318439659-7525-4-git-send-email-wudxw@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1318439659-7525-4-git-send-email-wudxw@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 3/6] trace: Add trace events group implementation in the backend "simple" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Wu Cc: Stefan Hajnoczi , qemu-devel@nongnu.org * Mark Wu [2011-10-12 12:26]: > > Signed-off-by: Mark Wu > --- > 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