From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
"Lluís Vilanova" <vilanova@ac.upc.edu>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>
Subject: [Qemu-devel] [PATCH v2 3/6] trace: remove some now unused functions
Date: Wed, 14 Sep 2016 18:08:39 +0100 [thread overview]
Message-ID: <1473872922-23449-4-git-send-email-berrange@redhat.com> (raw)
In-Reply-To: <1473872922-23449-1-git-send-email-berrange@redhat.com>
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 <berrange@redhat.com>
---
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 8fa7ed6..e9a64d0 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -102,28 +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, 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 c71b405..e80c220 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -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:
@@ -79,31 +64,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:
@@ -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:
--
2.7.4
next prev parent reply other threads:[~2016-09-14 17:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-14 17:08 [Qemu-devel] [PATCH v2 0/6] Prep changes for modular trace-events build Daniel P. Berrange
2016-09-14 17:08 ` [Qemu-devel] [PATCH v2 1/6] trace: add trace event iterator APIs Daniel P. Berrange
2016-09-14 21:53 ` Lluís Vilanova
2016-09-15 9:07 ` Daniel P. Berrange
2016-09-14 17:08 ` [Qemu-devel] [PATCH v2 2/6] trace: convert code to use event iterators Daniel P. Berrange
2016-09-14 22:16 ` Lluís Vilanova
2016-09-15 9:09 ` Daniel P. Berrange
2016-09-14 17:08 ` Daniel P. Berrange [this message]
2016-09-14 22:21 ` [Qemu-devel] [PATCH v2 3/6] trace: remove some now unused functions Lluís Vilanova
2016-09-14 17:08 ` [Qemu-devel] [PATCH v2 4/6] trace: remove global 'uint16 dstate[]' array Daniel P. Berrange
2016-09-14 22:56 ` Lluís Vilanova
2016-09-15 9:11 ` Daniel P. Berrange
2016-09-14 17:08 ` [Qemu-devel] [PATCH v2 5/6] trace: remove use of event ID enums from APIs Daniel P. Berrange
2016-09-14 23:26 ` Lluís Vilanova
2016-09-15 9:26 ` Daniel P. Berrange
2016-09-15 12:20 ` Lluís Vilanova
2016-09-15 12:29 ` Daniel P. Berrange
2016-09-14 17:08 ` [Qemu-devel] [PATCH v2 6/6] trace: use -1 instead of TRACE_VCPU_EVENT_COUNT as magic value Daniel P. Berrange
2016-09-14 23:12 ` Lluís Vilanova
2016-09-14 19:41 ` [Qemu-devel] [PATCH v2 0/6] Prep changes for modular trace-events build no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473872922-23449-4-git-send-email-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vilanova@ac.upc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.