X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=libust%2Fmarker-control.c;h=b4b7ce1a72d7d017cc34c6b05050efc2f0fb3773;hb=f7b16408b00ecce757bdde940853a48534b25edd;hp=f064316186055fac620d5ee6a2dc61a892b2ddb8;hpb=772030fed323e388da467735cf4b5e8781acb710;p=ust.git diff --git a/libust/marker-control.c b/libust/marker-control.c index f064316..b4b7ce1 100644 --- a/libust/marker-control.c +++ b/libust/marker-control.c @@ -18,25 +18,11 @@ * LTT marker control module over /proc */ -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include -//ust// #include #include +#include -#include "kernelcompat.h" -//#include "list.h" #include "tracer.h" -#include "localerr.h" +#include "usterr.h" #define DEFAULT_CHANNEL "cpu" #define DEFAULT_PROBE "default" @@ -117,7 +103,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) { @@ -132,7 +118,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; } @@ -144,7 +130,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( @@ -157,7 +143,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; } @@ -174,7 +160,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; @@ -201,7 +187,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; } @@ -216,7 +202,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; @@ -241,7 +227,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; }