From a53110051c34d7f46c584e3bccd927b213930d05 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Fri, 18 Dec 2009 15:05:23 -0500 Subject: [PATCH] add is_marker_enabled function from lttng kt --- libust/marker.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libust/marker.c b/libust/marker.c index d9cb88fc..01a515d1 100644 --- a/libust/marker.c +++ b/libust/marker.c @@ -672,6 +672,24 @@ static void disable_marker(struct marker *elem) */ } +/* + * is_marker_enabled - Check if a marker is enabled + * @channel: channel name + * @name: marker name + * + * Returns 1 if the marker is enabled, 0 if disabled. + */ +int is_marker_enabled(const char *channel, const char *name) +{ + struct marker_entry *entry; + + mutex_lock(&markers_mutex); + entry = get_marker(channel, name); + mutex_unlock(&markers_mutex); + + return entry && !!entry->refcount; +} + /** * marker_update_probe_range - Update a probe range * @begin: beginning of the range -- 2.34.1