tracectl cleanup v3
[ust.git] / libust / marker-control.c
index 9ee5b7cd58e54771c05121b44b005b9c5bdb73e9..db7311a347030d485b24920776bd91d3074c554e 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  *
- * LTT marker control module over /proc
+ */
+
+/* This file contains a high-level API for activating and deactivating markers,
+ * and making sure markers in a given library can be released when the library
+ * is unloaded.
  */
 
 #include <ctype.h>
@@ -103,7 +107,7 @@ int ltt_probe_register(struct ltt_available_probe *pdata)
        int comparison;
        struct ltt_available_probe *iter;
 
-       mutex_lock(&probes_mutex);
+       pthread_mutex_lock(&probes_mutex);
        list_for_each_entry_reverse(iter, &probes_registered_list, node) {
                comparison = strcmp(pdata->name, iter->name);
                if (!comparison) {
@@ -118,7 +122,7 @@ int ltt_probe_register(struct ltt_available_probe *pdata)
        /* Should be added at the head of the list */
        list_add(&pdata->node, &probes_registered_list);
 end:
-       mutex_unlock(&probes_mutex);
+       pthread_mutex_unlock(&probes_mutex);
        return ret;
 }
 
@@ -130,7 +134,7 @@ int ltt_probe_unregister(struct ltt_available_probe *pdata)
        int ret = 0;
        struct ltt_active_marker *amark, *tmp;
 
-       mutex_lock(&probes_mutex);
+       pthread_mutex_lock(&probes_mutex);
        list_for_each_entry_safe(amark, tmp, &markers_loaded_list, node) {
                if (amark->probe == pdata) {
                        ret = marker_probe_unregister_private_data(
@@ -143,7 +147,7 @@ int ltt_probe_unregister(struct ltt_available_probe *pdata)
        }
        list_del(&pdata->node);
 end:
-       mutex_unlock(&probes_mutex);
+       pthread_mutex_unlock(&probes_mutex);
        return ret;
 }
 
@@ -160,7 +164,7 @@ int ltt_marker_connect(const char *channel, const char *mname,
        struct ltt_available_probe *probe;
 
        ltt_lock_traces();
-       mutex_lock(&probes_mutex);
+       pthread_mutex_lock(&probes_mutex);
        probe = get_probe_from_name(pname);
        if (!probe) {
                ret = -ENOENT;
@@ -187,7 +191,7 @@ int ltt_marker_connect(const char *channel, const char *mname,
        else
                list_add(&pdata->node, &markers_loaded_list);
 end:
-       mutex_unlock(&probes_mutex);
+       pthread_mutex_unlock(&probes_mutex);
        ltt_unlock_traces();
        return ret;
 }
@@ -202,7 +206,7 @@ int ltt_marker_disconnect(const char *channel, const char *mname,
        struct ltt_available_probe *probe;
        int ret = 0;
 
-       mutex_lock(&probes_mutex);
+       pthread_mutex_lock(&probes_mutex);
        probe = get_probe_from_name(pname);
        if (!probe) {
                ret = -ENOENT;
@@ -227,7 +231,7 @@ int ltt_marker_disconnect(const char *channel, const char *mname,
                free(pdata);
        }
 end:
-       mutex_unlock(&probes_mutex);
+       pthread_mutex_unlock(&probes_mutex);
        return ret;
 }
 
This page took 0.02986 seconds and 4 git commands to generate.