+/* Copyright (C) 2009 Pierre-Marc Fournier
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#define _GNU_SOURCE
#include <stdio.h>
#include <stdint.h>
#include <fcntl.h>
#include <poll.h>
+#include <urcu.h>
+
#include "marker.h"
#include "tracer.h"
#include "localerr.h"
{
}
-void receive_commands()
+/* This needs to be called whenever a new thread is created. It notifies
+ * liburcu of the new thread.
+ */
+
+void ust_register_thread(void)
{
+ rcu_register_thread();
}
int fd_notif = -1;
idx++;
}
- result = poll(fds, n_fds, 0);
+ while((result = poll(fds, n_fds, 0)) == -1 && errno == EINTR)
+ /* nothing */;
if(result == -1) {
PERROR("poll");
return;
{
int result;
+ ust_register_thread();
+
DBG("LISTENER");
for(;;) {
static void __attribute__((constructor(101))) init0()
{
+ /* Initialize RCU in case the constructor order is not good. */
+ urcu_init();
+
+ /* It is important to do this before events start to be generated. */
+ ust_register_thread();
+
DBG("UST_AUTOPROBE constructor");
if(getenv("UST_AUTOPROBE")) {
marker_set_new_marker_cb(auto_probe_connect);