From patchwork Tue Aug 9 15:31:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 657340 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 3s7zKN41gyz9t1F for ; Wed, 10 Aug 2016 01:51:20 +1000 (AEST) Received: from localhost ([::1]:36291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX9JF-0000V6-VT for incoming@patchwork.ozlabs.org; Tue, 09 Aug 2016 11:51:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX91K-0006IZ-FO for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:32:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX91H-0005dT-T6 for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:32:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX91H-0005dL-Kr for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:32:43 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 45D2E4E328 for ; Tue, 9 Aug 2016 15:32:43 +0000 (UTC) Received: from t530wlan.home.berrange.com.com (vpn1-7-178.ams2.redhat.com [10.36.7.178]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u79FWX2R014984; Tue, 9 Aug 2016 11:32:42 -0400 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Tue, 9 Aug 2016 16:31:35 +0100 Message-Id: <1470756748-18933-8-git-send-email-berrange@redhat.com> In-Reply-To: <1470756748-18933-1-git-send-email-berrange@redhat.com> References: <1470756748-18933-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 09 Aug 2016 15:32:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.8 v1 07/60] trace: remove some now unused functions 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: Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The trace_event_count, trace_event_id and trace_event_pattern methods are no longer required now that everything is using the iterator APIs The trace_event_set_state and trace_event_set_vcpu_state macros were also unused. Signed-off-by: Daniel P. Berrange --- trace/control-internal.h | 11 --------- trace/control.c | 22 ------------------ trace/control.h | 59 ------------------------------------------------ 3 files changed, 92 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index a4e5f4a..7f31e39 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -20,17 +20,6 @@ extern uint16_t trace_events_dstate[]; extern int trace_events_enabled_count; -static inline TraceEventID trace_event_count(void) -{ - return TRACE_EVENT_COUNT; -} - -static inline TraceEvent *trace_event_id(TraceEventID id) -{ - assert(id < trace_event_count()); - return &trace_events[id]; -} - static inline bool trace_event_is_pattern(const char *str) { assert(str != NULL); diff --git a/trace/control.c b/trace/control.c index dbf47fc..7ba171b 100644 --- a/trace/control.c +++ b/trace/control.c @@ -101,28 +101,6 @@ static bool pattern_glob(const char *pat, const char *ev) } } -TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev) -{ - assert(pat != NULL); - - bool matched = ev ? false : true; - TraceEventIter iter; - TraceEvent *thisev; - trace_event_iter_init(&iter, NULL); - while ((thisev = trace_event_iter_next(&iter)) != NULL) { - if (matched) { - if (pattern_glob(pat, trace_event_get_name(thisev))) { - return thisev; - } - } else { - if (ev == thisev) { - matched = true; - } - } - } - - return NULL; -} void trace_event_iter_init(TraceEventIter *iter, const char *pattern) { diff --git a/trace/control.h b/trace/control.h index a3a8a78..3f00adc 100644 --- a/trace/control.h +++ b/trace/control.h @@ -34,21 +34,6 @@ void trace_event_iter_init(TraceEventIter *iter, const char *pattern); TraceEvent *trace_event_iter_next(TraceEventIter *iter); -/** - * trace_event_id: - * @id: Event identifier. - * - * Get an event by its identifier. - * - * This routine has a constant cost, as opposed to trace_event_name and - * trace_event_pattern. - * - * Pre-conditions: The identifier is valid. - * - * Returns: pointer to #TraceEvent. - * - */ -static TraceEvent *trace_event_id(TraceEventID id); /** * trace_event_name: @@ -61,31 +46,12 @@ static TraceEvent *trace_event_id(TraceEventID id); TraceEvent *trace_event_name(const char *name); /** - * trace_event_pattern: - * @pat: Event name pattern. - * @ev: Event to start searching from (not included). - * - * Get all events with a given name pattern. - * - * Returns: pointer to #TraceEvent or NULL if not found. - */ -TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev); - -/** * trace_event_is_pattern: * * Whether the given string is an event name pattern. */ static bool trace_event_is_pattern(const char *str); -/** - * trace_event_count: - * - * Return the number of events. - */ -static TraceEventID trace_event_count(void); - - /** * trace_event_get_id: @@ -176,31 +142,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *ev); */ static bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, TraceEvent *ev); -/** - * trace_event_set_state: - * - * Set the tracing state of an event (only if possible). - */ -#define trace_event_set_state(id, state) \ - do { \ - if ((id ##_ENABLED)) { \ - TraceEvent *_e = trace_event_id(id); \ - trace_event_set_state_dynamic(_e, state); \ - } \ - } while (0) - -/** - * trace_event_set_vcpu_state: - * - * Set the tracing state of an event for the given vCPU (only if not disabled). - */ -#define trace_event_set_vcpu_state(vcpu, id, state) \ - do { \ - if ((id ##_ENABLED)) { \ - TraceEvent *_e = trace_event_id(id); \ - trace_event_set_vcpu_state_dynamic(vcpu, _e, state); \ - } \ - } while (0) /** * trace_event_set_state_dynamic: