From patchwork Fri Jan 13 20:48:22 2017 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: 715252 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v0ZbD4MdJz9vDk for ; Sat, 14 Jan 2017 07:53:12 +1100 (AEDT) Received: from localhost ([::1]:45179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS8qU-0002MT-32 for incoming@patchwork.ozlabs.org; Fri, 13 Jan 2017 15:53:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS8lw-0007Ix-Lp for qemu-devel@nongnu.org; Fri, 13 Jan 2017 15:48:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cS8lt-0005tS-Jo for qemu-devel@nongnu.org; Fri, 13 Jan 2017 15:48:28 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:49709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS8lt-0005t5-7h for qemu-devel@nongnu.org; Fri, 13 Jan 2017 15:48:25 -0500 Received: from gw-3.ac.upc.es (gw-3.ac.upc.es [147.83.30.9]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v0DKmNQg027513; Fri, 13 Jan 2017 21:48:24 +0100 Received: from localhost (72.red-2-138-226.dynamicip.rima-tde.net [2.138.226.72]) by gw-3.ac.upc.es (Postfix) with ESMTPSA id 2E9C53D2; Fri, 13 Jan 2017 21:48:23 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Fri, 13 Jan 2017 21:48:22 +0100 Message-Id: <148434050231.31446.10929552655201551997.stgit@frigg.lan> X-Mailer: git-send-email 2.11.0 In-Reply-To: <148434048970.31446.17153056211582691244.stgit@frigg.lan> References: <148434048970.31446.17153056211582691244.stgit@frigg.lan> 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 v0DKmNQg027513 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 v7 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 , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Later patches will make use of it. Signed-off-by: Lluís Vilanova --- trace/control-internal.h | 7 ++++++- trace/control.c | 11 +++-------- trace/control.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index a9d395a587..a8beb44847 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -1,7 +1,7 @@ /* * Interface for configuring and controlling the state of tracing events. * - * Copyright (C) 2011-2016 Lluís Vilanova + * Copyright (C) 2011-2017 Lluís Vilanova * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. @@ -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..8a52c7fc39 100644 --- a/trace/control.c +++ b/trace/control.c @@ -1,7 +1,7 @@ /* * Interface for configuring and controlling the state of tracing events. * - * Copyright (C) 2011-2016 Lluís Vilanova + * Copyright (C) 2011-2017 Lluís Vilanova * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. @@ -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..6dfbc53c8d 100644 --- a/trace/control.h +++ b/trace/control.h @@ -1,7 +1,7 @@ /* * Interface for configuring and controlling the state of tracing events. * - * Copyright (C) 2011-2016 Lluís Vilanova + * Copyright (C) 2011-2017 Lluís Vilanova * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. @@ -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"