From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX9pn-0003B6-8c for qemu-devel@nongnu.org; Tue, 09 Aug 2016 12:24:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX9pj-0001aa-0q for qemu-devel@nongnu.org; Tue, 09 Aug 2016 12:24:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX9pi-0001aO-RD for qemu-devel@nongnu.org; Tue, 09 Aug 2016 12:24:50 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B6F561E5E for ; Tue, 9 Aug 2016 16:24:50 +0000 (UTC) Date: Tue, 9 Aug 2016 17:24:47 +0100 From: "Daniel P. Berrange" Message-ID: <20160809162447.GM1530@redhat.com> Reply-To: "Daniel P. Berrange" References: <1470756748-18933-1-git-send-email-berrange@redhat.com> <1470756748-18933-12-git-send-email-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On Tue, Aug 09, 2016 at 06:18:51PM +0200, Paolo Bonzini wrote: > > > On 09/08/2016 17:31, Daniel P. Berrange wrote: > > Since there will shortly be multiple event groups allowed, > > we can no longer use the TraceEventID and TraceEventVCPUID > > enums in the trace control APIs. There will in fact be > > multiple distinct enums, and the enum values will only be > > required to be unique per group. > > > > Signed-off-by: Daniel P. Berrange > > --- > > trace/control-internal.h | 14 +++++++------- > > trace/control-target.c | 6 +++--- > > trace/control.h | 25 ++++++------------------- > > trace/event-internal.h | 4 ++-- > > trace/simple.c | 6 +++--- > > trace/simple.h | 2 +- > > 6 files changed, 22 insertions(+), 35 deletions(-) > > > > diff --git a/trace/control-internal.h b/trace/control-internal.h > > index 634effe..b7048d4 100644 > > --- a/trace/control-internal.h > > +++ b/trace/control-internal.h > > @@ -24,13 +24,13 @@ static inline bool trace_event_is_pattern(const char *str) > > return strchr(str, '*') != NULL; > > } > > > > -static inline TraceEventID trace_event_get_id(TraceEvent *ev) > > +static inline size_t trace_event_get_id(TraceEvent *ev) > > { > > assert(ev != NULL); > > return ev->id; > > Perhaps "unsigned" is a better match than size_t? I don't mind either way - I just happen to personally always use size_t for anything that ends up being used primarily as an array index. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|