From patchwork Tue Jun 14 13:11:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 9175811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9BD9260573 for ; Tue, 14 Jun 2016 13:27:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7900B265F9 for ; Tue, 14 Jun 2016 13:27:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A576280E0; Tue, 14 Jun 2016 13:27:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9857B265F9 for ; Tue, 14 Jun 2016 13:27:20 +0000 (UTC) Received: from localhost ([::1]:35254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCoN8-0007Z6-It for patchwork-qemu-devel@patchwork.kernel.org; Tue, 14 Jun 2016 09:27:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCo7b-0001Va-9h for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCo7Y-0007uc-2u for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:11:11 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:42406 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCo7X-0007uU-MI for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:11:08 -0400 Received: from gw-2.ac.upc.es (gw-2.ac.upc.es [147.83.30.8]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id u5EDB6dZ008045; Tue, 14 Jun 2016 15:11:06 +0200 Received: from localhost (unknown [84.88.51.85]) by gw-2.ac.upc.es (Postfix) with ESMTPSA id D2235B11; Tue, 14 Jun 2016 15:11:06 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Tue, 14 Jun 2016 15:11:06 +0200 Message-Id: <146590986658.16561.9960724911865940337.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 2.8.1 In-Reply-To: <146590985033.16561.16324808287190305042.stgit@fimbulvetr.bsc.es> References: <146590985033.16561.16324808287190305042.stgit@fimbulvetr.bsc.es> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id u5EDB6dZ008045 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH v4 3/6] [trivial] trace: Cosmetic changes on fast-path tracing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Eduardo Habkost , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: LluĂ­s Vilanova Reviewed-by: Stefan Hajnoczi --- trace/control-internal.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 0ba10fe..3f368fd 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -62,14 +62,17 @@ static inline bool trace_event_get_state_static(TraceEvent *ev) return ev->sstate; } -static inline bool trace_event_get_state_dynamic_by_id(int id) +static inline bool trace_event_get_state_dynamic_by_id(TraceEventID id) { + /* it's on fast path, avoid consistency checks (asserts) */ return unlikely(trace_events_enabled_count) && trace_events_dstate[id]; } static inline bool trace_event_get_state_dynamic(TraceEvent *ev) { - int id = trace_event_get_id(ev); + TraceEventID id; + assert(trace_event_get_state_static(ev)); + id = trace_event_get_id(ev); return trace_event_get_state_dynamic_by_id(id); }