From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCNnZ-0007wk-Vn for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:04:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCNnT-0002Jt-SC for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:04:44 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCNnT-0002Jp-Lp for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:04:39 -0400 Received: by mail-wm0-x229.google.com with SMTP id k204so69691875wmk.0 for ; Mon, 13 Jun 2016 02:04:39 -0700 (PDT) Sender: Paolo Bonzini References: <145641255678.30097.2919142707547689749.stgit@localhost> <145641258053.30097.3350702281012819654.stgit@localhost> From: Paolo Bonzini Message-ID: Date: Mon, 13 Jun 2016 11:04:35 +0200 MIME-Version: 1.0 In-Reply-To: <145641258053.30097.3350702281012819654.stgit@localhost> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 3/6] [trivial] trace: Cosmetic changes on fast-path tracing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Llu=c3=ads_Vilanova?= , qemu-devel@nongnu.org Cc: Eduardo Habkost , Stefan Hajnoczi On 25/02/2016 16:03, LluĂ­s Vilanova wrote: > static inline bool trace_event_get_state_dynamic(TraceEvent *ev) > { > - int id = trace_event_get_id(ev); > + TraceEventID id; > + assert(ev != NULL); Please don't add "!= NULL" asserts. The reason of a crash would be pretty obvious from the backtrace. In fact a NULL event is especially unlikely given that all events are held in an array... Paolo > + assert(trace_event_get_state_static(ev)); > + id = trace_event_get_id(ev); > return trace_event_get_state_dynamic_by_id(id); > } >