eal: relocate per thread symbols to common
[dpdk.git] / lib / librte_eal / freebsd / eal_thread.c
index f21eddd..40676d9 100644 (file)
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
+#include <rte_eal_trace.h>
 
 #include "eal_private.h"
 #include "eal_thread.h"
 
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;
-RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY;
-RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset);
-
 /*
  * Send a message to a slave lcore identified by slave_id to call a
  * function f with argument arg. Once the execution is done, the
@@ -40,9 +37,10 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
        char c = 0;
        int m2s = lcore_config[slave_id].pipe_master2slave[1];
        int s2m = lcore_config[slave_id].pipe_slave2master[0];
+       int rc = -EBUSY;
 
        if (lcore_config[slave_id].state != WAIT)
-               return -EBUSY;
+               goto finish;
 
        lcore_config[slave_id].f = f;
        lcore_config[slave_id].arg = arg;
@@ -62,7 +60,10 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
        if (n <= 0)
                rte_panic("cannot read on configuration pipe\n");
 
-       return 0;
+       rc = 0;
+finish:
+       rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc);
+       return rc;
 }
 
 /* set affinity for current thread */
@@ -124,6 +125,9 @@ eal_thread_loop(__rte_unused void *arg)
        RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
                lcore_id, thread_id, cpuset, ret == 0 ? "" : "...");
 
+       __rte_trace_mem_per_thread_alloc();
+       rte_eal_trace_thread_lcore_ready(lcore_id, cpuset);
+
        /* read on our pipe to get commands */
        while (1) {
                void *fct_arg;
@@ -175,3 +179,12 @@ int rte_thread_setname(pthread_t id, const char *name)
        pthread_set_name_np(id, name);
        return 0;
 }
+
+int rte_thread_getname(pthread_t id, char *name, size_t len)
+{
+       RTE_SET_USED(id);
+       RTE_SET_USED(name);
+       RTE_SET_USED(len);
+
+       return -ENOTSUP;
+}