From patchwork Wed Dec 28 18:41:05 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: 9490621 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 10A49602A7 for ; Wed, 28 Dec 2016 18:45:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D34622015F for ; Wed, 28 Dec 2016 18:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3FCB2094D; Wed, 28 Dec 2016 18:45:44 +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 4366F2015F for ; Wed, 28 Dec 2016 18:45:44 +0000 (UTC) Received: from localhost ([::1]:60509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMJEN-00084u-GO for patchwork-qemu-devel@patchwork.kernel.org; Wed, 28 Dec 2016 13:45:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMJ9v-0004QJ-Mw for qemu-devel@nongnu.org; Wed, 28 Dec 2016 13:41:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMJ9u-0001GU-Sp for qemu-devel@nongnu.org; Wed, 28 Dec 2016 13:41:07 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:48437 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMJ9u-0001GM-GH for qemu-devel@nongnu.org; Wed, 28 Dec 2016 13:41:06 -0500 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 uBSIf6HY014056; Wed, 28 Dec 2016 19:41:06 +0100 Received: from localhost (unknown [84.88.51.85]) by gw-2.ac.upc.es (Postfix) with ESMTPSA id 86034A6; Wed, 28 Dec 2016 19:41:05 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Wed, 28 Dec 2016 19:41:05 +0100 Message-Id: <148295046527.19871.6610919709371885230.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 2.11.0 In-Reply-To: <148295045448.19871.9819696634619157347.stgit@fimbulvetr.bsc.es> References: <148295045448.19871.9819696634619157347.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 uBSIf6HY014056 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH v6 2/7] trace: Make trace_get_vcpu_event_count() inlinable 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: 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 Later patches will make use of it. Signed-off-by: LluĂ­s Vilanova --- trace/control-internal.h | 5 +++++ trace/control.c | 9 ++------- trace/control.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index a9d395a587..beb98a0d2c 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -16,6 +16,7 @@ extern int trace_events_enabled_count; +extern uint32_t trace_next_vcpu_id; static inline bool trace_event_is_pattern(const char *str) @@ -82,6 +83,10 @@ static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id); } +static inline uint32_t trace_get_vcpu_event_count(void) +{ + return trace_next_vcpu_id; +} void trace_event_register_group(TraceEvent **events); diff --git a/trace/control.c b/trace/control.c index 1a7bee6ddc..52d0e343fa 100644 --- a/trace/control.c +++ b/trace/control.c @@ -36,7 +36,7 @@ typedef struct TraceEventGroup { static TraceEventGroup *event_groups; static size_t nevent_groups; static uint32_t next_id; -static uint32_t next_vcpu_id; +uint32_t trace_next_vcpu_id; QemuOptsList qemu_trace_opts = { .name = "trace", @@ -65,7 +65,7 @@ void trace_event_register_group(TraceEvent **events) for (i = 0; events[i] != NULL; i++) { events[i]->id = next_id++; if (events[i]->vcpu_id != TRACE_VCPU_EVENT_NONE) { - events[i]->vcpu_id = next_vcpu_id++; + events[i]->vcpu_id = trace_next_vcpu_id++; } } event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1); @@ -299,8 +299,3 @@ char *trace_opt_parse(const char *optarg) return trace_file; } - -uint32_t trace_get_vcpu_event_count(void) -{ - return next_vcpu_id; -} diff --git a/trace/control.h b/trace/control.h index ccaeac8552..80d326c4d1 100644 --- a/trace/control.h +++ b/trace/control.h @@ -237,7 +237,7 @@ char *trace_opt_parse(const char *optarg); * * Return the number of known vcpu-specific events */ -uint32_t trace_get_vcpu_event_count(void); +static uint32_t trace_get_vcpu_event_count(void); #include "trace/control-internal.h"