add is_marker_enabled function from lttng kt
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Fri, 18 Dec 2009 20:05:23 +0000 (15:05 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Thu, 7 Jan 2010 02:45:35 +0000 (21:45 -0500)
libust/marker.c

index d9cb88fca96b7c0f8521e32b1c270ed1ae549df7..01a515d173c6c22be521cedafd8945c293c55498 100644 (file)
@@ -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
This page took 0.025861 seconds and 4 git commands to generate.