From: Pierre-Marc Fournier Date: Fri, 18 Dec 2009 20:05:23 +0000 (-0500) Subject: add is_marker_enabled function from lttng kt X-Git-Tag: v0.1~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a53110051c34d7f46c584e3bccd927b213930d05;p=ust.git add is_marker_enabled function from lttng kt --- diff --git a/libust/marker.c b/libust/marker.c index d9cb88f..01a515d 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