Fix: Java agent: close session daemon socket on error
[lttng-ust.git] / libringbuffer / smp.h
index dd326d83f5a443b98e202269c7e8da90e361749a..479a9dc60a01c9810d166ed1944e8fc7dfb4ecb0 100644 (file)
@@ -4,12 +4,24 @@
 /*
  * libringbuffer/smp.h
  *
- * Copyright 2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * Dual LGPL v2.1/GPL v2 license.
+ * 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; only
+ * version 2.1 of the License.
+ *
+ * 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
  */
 
-#include <ust/core.h>
+#include "getcpu.h"
 
 /*
  * 4kB of per-cpu data available. Enough to hold the control structures,
@@ -28,45 +40,6 @@ int num_possible_cpus(void)
        return __num_possible_cpus;
 }
 
-/*
- * get_cpu() returns the current CPU number. It may change due to
- * migration, so it is only statistically accurate.
- */
-#ifndef UST_VALGRIND
-static inline
-int get_cpu(void)
-{
-       int cpu;
-
-       cpu = sched_getcpu();
-       if (caa_likely(cpu >= 0))
-               return cpu;
-       /*
-        * If getcpu(2) is not implemented in the Kernel use CPU 0 as fallback.
-        */
-       return 0;
-}
-
-#else  /* #else #ifndef UST_VALGRIND */
-static inline
-int get_cpu(void)
-{
-       /*
-        * Valgrind does not support the sched_getcpu() vsyscall.
-        * It causes it to detect a segfault in the program and stop it.
-        * So if we want to check libust with valgrind, we have to refrain
-        * from using this call. TODO: it would probably be better to return
-        * other values too, to better test it.
-        */
-       return 0;
-}
-#endif /* #else #ifndef UST_VALGRIND */
-
-static inline
-void put_cpu(void)
-{
-}
-
 #define for_each_possible_cpu(cpu)             \
        for ((cpu) = 0; (cpu) < num_possible_cpus(); (cpu)++)
 
This page took 0.024472 seconds and 4 git commands to generate.