summaryrefslogtreecommitdiff
path: root/examples/performance-thread
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2017-11-02 23:06:38 +0100
committerThomas Monjalon <thomas@monjalon.net>2017-11-06 21:56:07 +0100
commit17715a53395c7bf27124e625d6598b28d8a1cc00 (patch)
treead3789ccd83caa84bc74b352a0e233cd2fb0d131 /examples/performance-thread
parent6c986e1bdb10131975acaee7e94a757be8117e02 (diff)
downloaddpdk-next-eventdev-17715a53395c7bf27124e625d6598b28d8a1cc00.zip
dpdk-next-eventdev-17715a53395c7bf27124e625d6598b28d8a1cc00.tar.gz
dpdk-next-eventdev-17715a53395c7bf27124e625d6598b28d8a1cc00.tar.xz
use macro to declare constructor functions
It is easier to find all constructor functions when they use the same macros RTE_INIT or RTE_INIT_PRIO. The macro definitions are moved from rte_eal.h to rte_common.h. Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Diffstat (limited to 'examples/performance-thread')
-rw-r--r--examples/performance-thread/common/lthread_diag.c3
-rw-r--r--examples/performance-thread/common/lthread_sched.c3
-rw-r--r--examples/performance-thread/common/lthread_tls.c4
-rw-r--r--examples/performance-thread/pthread_shim/pthread_shim.c5
4 files changed, 4 insertions, 11 deletions
diff --git a/examples/performance-thread/common/lthread_diag.c b/examples/performance-thread/common/lthread_diag.c
index bce1a0c..b5007d7 100644
--- a/examples/performance-thread/common/lthread_diag.c
+++ b/examples/performance-thread/common/lthread_diag.c
@@ -296,8 +296,7 @@ _lthread_diag_default_cb(uint64_t time, struct lthread *lt, int diag_event,
/*
* plug in default diag callback with mask off
*/
-void _lthread_diag_ctor(void)__attribute__((constructor));
-void _lthread_diag_ctor(void)
+RTE_INIT(_lthread_diag_ctor)
{
diag_cb = _lthread_diag_default_cb;
diag_mask = 0;
diff --git a/examples/performance-thread/common/lthread_sched.c b/examples/performance-thread/common/lthread_sched.c
index e100c41..779aeb1 100644
--- a/examples/performance-thread/common/lthread_sched.c
+++ b/examples/performance-thread/common/lthread_sched.c
@@ -117,8 +117,7 @@ uint64_t diag_mask;
/* constructor */
-void lthread_sched_ctor(void) __attribute__ ((constructor));
-void lthread_sched_ctor(void)
+RTE_INIT(lthread_sched_ctor)
{
memset(schedcore, 0, sizeof(schedcore));
rte_atomic16_init(&num_schedulers);
diff --git a/examples/performance-thread/common/lthread_tls.c b/examples/performance-thread/common/lthread_tls.c
index 56f0c2f..2259fad 100644
--- a/examples/performance-thread/common/lthread_tls.c
+++ b/examples/performance-thread/common/lthread_tls.c
@@ -62,9 +62,7 @@ RTE_DEFINE_PER_LTHREAD(void *, dummy);
static struct lthread_key key_table[LTHREAD_MAX_KEYS];
-void lthread_tls_ctor(void) __attribute__((constructor));
-
-void lthread_tls_ctor(void)
+RTE_INIT(thread_tls_ctor)
{
key_pool = NULL;
key_pool_init = 0;
diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c
index 113bafa..bc7cf2b 100644
--- a/examples/performance-thread/pthread_shim/pthread_shim.c
+++ b/examples/performance-thread/pthread_shim/pthread_shim.c
@@ -202,10 +202,7 @@ static void *__libc_dl_handle = RTLD_NEXT;
* The constructor function initialises the
* function pointers for pthread library functions
*/
-void
-pthread_intercept_ctor(void)__attribute__((constructor));
-void
-pthread_intercept_ctor(void)
+RTE_INIT(pthread_intercept_ctor)
{
override = 0;
/*