projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TRACEPOINT_EVENT: standardize locking wrt tracepoints and markers
[lttng-ust.git]
/
libust
/
tracectl.c
diff --git
a/libust/tracectl.c
b/libust/tracectl.c
index bc0a07c046d26333f36ef1b19145f79c8ba53fa8..771e4e1f6c86540cd1a478b2b0abde8c98d90b96 100644
(file)
--- a/
libust/tracectl.c
+++ b/
libust/tracectl.c
@@
-39,6
+39,7
@@
#include <ust/marker.h>
#include <ust/tracepoint.h>
#include <ust/marker.h>
#include <ust/tracepoint.h>
+#include <ust/tracepoint-internal.h>
#include <ust/tracectl.h>
#include <ust/clock.h>
#include "tracer.h"
#include <ust/tracectl.h>
#include <ust/clock.h>
#include "tracer.h"
@@
-103,7
+104,6
@@
static void print_ust_marker(FILE *fp)
{
struct ust_marker_iter iter;
{
struct ust_marker_iter iter;
- lock_ust_marker();
ust_marker_iter_reset(&iter);
ust_marker_iter_start(&iter);
ust_marker_iter_reset(&iter);
ust_marker_iter_start(&iter);
@@
-119,14
+119,13
@@
static void print_ust_marker(FILE *fp)
*/
ust_marker_iter_next(&iter);
}
*/
ust_marker_iter_next(&iter);
}
- u
nlock_ust_marker(
);
+ u
st_marker_iter_stop(&iter
);
}
static void print_trace_events(FILE *fp)
{
struct trace_event_iter iter;
}
static void print_trace_events(FILE *fp)
{
struct trace_event_iter iter;
- lock_trace_events();
trace_event_iter_reset(&iter);
trace_event_iter_start(&iter);
trace_event_iter_reset(&iter);
trace_event_iter_start(&iter);
@@
-134,7
+133,7
@@
static void print_trace_events(FILE *fp)
fprintf(fp, "trace_event: %s\n", (*iter.trace_event)->name);
trace_event_iter_next(&iter);
}
fprintf(fp, "trace_event: %s\n", (*iter.trace_event)->name);
trace_event_iter_next(&iter);
}
-
unlock_trace_events(
);
+
trace_event_iter_stop(&iter
);
}
static int connect_ustconsumer(void)
}
static int connect_ustconsumer(void)
@@
-1228,12
+1227,19
@@
static struct ustcomm_sock * init_app_socket(int epoll_fd)
char *dir_name, *sock_name;
int result;
struct ustcomm_sock *sock = NULL;
char *dir_name, *sock_name;
int result;
struct ustcomm_sock *sock = NULL;
+ time_t mtime;
dir_name = ustcomm_user_sock_dir();
if (!dir_name)
return NULL;
dir_name = ustcomm_user_sock_dir();
if (!dir_name)
return NULL;
- result = asprintf(&sock_name, "%s/%d", dir_name, (int)getpid());
+ mtime = ustcomm_pid_st_mtime(getpid());
+ if (!mtime) {
+ goto free_dir_name;
+ }
+
+ result = asprintf(&sock_name, "%s/%d.%ld", dir_name,
+ (int) getpid(), (long) mtime);
if (result < 0) {
ERR("string overflow allocating socket name, "
"UST thread bailing");
if (result < 0) {
ERR("string overflow allocating socket name, "
"UST thread bailing");
@@
-1307,18
+1313,17
@@
static void __attribute__((constructor)) init()
DBG("UST traces will not be synchronized with LTTng traces");
}
DBG("UST traces will not be synchronized with LTTng traces");
}
+ if (getenv("UST_TRACE") || getenv("UST_AUTOPROBE")) {
+ /* Ensure ust_marker control is initialized */
+ init_ust_marker_control();
+ }
+
autoprobe_val = getenv("UST_AUTOPROBE");
if (autoprobe_val) {
struct ust_marker_iter iter;
DBG("Autoprobe enabled.");
autoprobe_val = getenv("UST_AUTOPROBE");
if (autoprobe_val) {
struct ust_marker_iter iter;
DBG("Autoprobe enabled.");
- /* Ensure ust_marker are initialized */
- //init_ust_marker();
-
- /* Ensure ust_marker control is initialized, for the probe */
- init_ust_marker_control();
-
/* first, set the callback that will connect the
* probe on new ust_marker
*/
/* first, set the callback that will connect the
* probe on new ust_marker
*/
@@
-1350,6
+1355,7
@@
static void __attribute__((constructor)) init()
auto_probe_connect(*iter.ust_marker);
ust_marker_iter_next(&iter);
}
auto_probe_connect(*iter.ust_marker);
ust_marker_iter_next(&iter);
}
+ ust_marker_iter_stop(&iter);
}
if (getenv("UST_OVERWRITE")) {
}
if (getenv("UST_OVERWRITE")) {
@@
-1393,12
+1399,6
@@
static void __attribute__((constructor)) init()
DBG("starting early tracing");
DBG("starting early tracing");
- /* Ensure ust_marker control is initialized */
- init_ust_marker_control();
-
- /* Ensure ust_marker are initialized */
- init_ust_marker();
-
/* Ensure buffers are initialized, for the transport to be available.
* We are about to set a trace type and it will fail without this.
*/
/* Ensure buffers are initialized, for the transport to be available.
* We are about to set a trace type and it will fail without this.
*/
This page took
0.025327 seconds
and
4
git commands to generate.