#include <ust/marker.h>
#include <ust/tracepoint.h>
+#include <ust/tracepoint-internal.h>
#include <ust/tracectl.h>
#include <ust/clock.h>
#include "tracer.h"
{
struct ust_marker_iter iter;
- lock_ust_marker();
ust_marker_iter_reset(&iter);
ust_marker_iter_start(&iter);
*/
ust_marker_iter_next(&iter);
}
- unlock_ust_marker();
+ ust_marker_iter_stop(&iter);
}
static void print_trace_events(FILE *fp)
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;
- 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");
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.");
- /* 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
*/
auto_probe_connect(*iter.ust_marker);
ust_marker_iter_next(&iter);
}
+ ust_marker_iter_stop(&iter);
}
if (getenv("UST_OVERWRITE")) {
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.
*/