]> git.proxmox.com Git - mirror_qemu.git/commitdiff
trace: remove some now unused functions
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 4 Oct 2016 13:35:44 +0000 (14:35 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 12 Oct 2016 07:35:54 +0000 (09:35 +0200)
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.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: LluĂ­s Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1475588159-30598-6-git-send-email-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
trace/control-internal.h
trace/control.c
trace/control.h

index a4e5f4aa06b8ae2b6e29b321a2d2873395c7d1ad..7f31e39059a1ab32a683493e7478aa8b9d119df5 100644 (file)
@@ -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);
index a107cc370f4e44cf0a3c8ff4ea4145d6846b38ae..a423f32eb09f1d599b11697e2e61eca394a8adf2 100644 (file)
@@ -102,26 +102,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, pat);
-    while ((thisev = trace_event_iter_next(&iter)) != NULL) {
-        if (matched) {
-            return thisev;
-        } else {
-            if (ev == thisev) {
-                matched = true;
-            }
-        }
-    }
-
-    return NULL;
-}
 
 void trace_event_iter_init(TraceEventIter *iter, const char *pattern)
 {
index 36d7cd23edd67d5ab27086370b9e314d5a50e85f..10d4aba78cd2ae55ba37f332d24322be29a9759e 100644 (file)
@@ -52,21 +52,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:
@@ -78,17 +63,6 @@ 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:
  *
@@ -96,14 +70,6 @@ TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev);
  */
 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:
@@ -194,31 +160,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: