Make sure that all non-static functions have a declaration.
Change-Id: Ie1596ad4ba876183862e51508c8bd7fc0451fc5e
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Return the minimum order for which x <= (1UL << order).
* Return -1 if x is 0.
*/
+static
int cds_lfht_get_count_order_u32(uint32_t x)
{
if (!x)
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *data)
{
unsigned long tidx = (unsigned long)data;
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
}
}
+static
void *thr_reader(void *data)
{
unsigned long tidx = (unsigned long)data;
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
+static
void *thr_reader(void *arg)
{
caa_cycles_t time1, time2;
}
+static
void *thr_writer(void *arg)
{
caa_cycles_t time1, time2;
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
}
+static
void *thr_writer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
+static
void *thr_reader(void *arg)
{
unsigned int i, j;
}
+static
void *thr_writer(void *arg)
{
unsigned int i, j;
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
}
+static
void *thr_writer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
+static
void rcu_copy_mutex_lock(void)
{
int ret;
}
}
+static
void rcu_copy_mutex_unlock(void)
{
int ret;
ptr->a = ARRAY_POISON;
}
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
}
+static
void *thr_writer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
}
+static
void *thr_writer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
{
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
rcu_gc_clear_queue(wtidx);
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
static enum test_hash test_choice = TEST_HASH_RW;
+static
void (*get_sigusr1_cb(void))(int)
{
return test_hash_cb[test_choice].sigusr1;
}
+static
void (*get_sigusr2_cb(void))(int)
{
return test_hash_cb[test_choice].sigusr2;
}
+static
void *(*get_thr_reader_cb(void))(void *)
{
return test_hash_cb[test_choice].thr_reader;
}
+static
void *(*get_thr_writer_cb(void))(void *)
{
return test_hash_cb[test_choice].thr_writer;
}
+static
int (*get_populate_hash_cb(void))(void)
{
return test_hash_cb[test_choice].populate_hash;
return 1;
}
+static
void *thr_count(void *arg)
{
printf_verbose("thread_begin %s, tid %lu\n",
printf("deleted %lu nodes.\n", count);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
static struct cds_lfq_queue_rcu q;
+static
void *thr_enqueuer(void *_count)
{
unsigned long long *count = _count;
free(node);
}
+static
void *thr_dequeuer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void test_end(struct cds_lfq_queue_rcu *q, unsigned long long *nr_dequeues)
{
struct cds_lfq_node_rcu *snode;
} while (snode);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) <OPTIONS>\n",
static struct cds_lfs_stack_rcu s;
+static
void *thr_enqueuer(void *_count)
{
unsigned long long *count = _count;
free(node);
}
+static
void *thr_dequeuer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void test_end(struct cds_lfs_stack_rcu *s, unsigned long long *nr_dequeues)
{
struct cds_lfs_node_rcu *snode;
} while (snode);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) <OPTIONS>\n",
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
}
+static
void *thr_writer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
static
unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
-
-void rcu_copy_mutex_lock(void)
-{
- int ret;
- ret = pthread_mutex_lock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex lock");
- exit(-1);
- }
-}
-
-void rcu_copy_mutex_unlock(void)
-{
- int ret;
-
- ret = pthread_mutex_unlock(&rcu_copy_mutex);
- if (ret) {
- perror("Error in pthread mutex unlock");
- exit(-1);
- }
-}
-
+static
void *thr_reader(void *_count)
{
unsigned long long *count = _count;
rcu_gc_clear_queue(wtidx);
}
+static
void *thr_writer(void *data)
{
unsigned long wtidx = (unsigned long)data;
return ((void*)2);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
+static
void rcu_copy_mutex_lock(void)
{
int ret;
}
}
+static
void rcu_copy_mutex_unlock(void)
{
int ret;
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
+static
void *thr_reader(void *arg)
{
unsigned int i, j;
}
+static
void *thr_writer(void *arg)
{
unsigned int i, j;
pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
+static
void rcu_copy_mutex_lock(void)
{
int ret;
}
}
+static
void rcu_copy_mutex_unlock(void)
{
int ret;
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
static caa_cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
+static
void *thr_reader(void *arg)
{
unsigned int i, j;
}
+static
void *thr_writer(void *arg)
{
unsigned int i, j;
static struct cds_wfq_queue q;
+static
void *thr_enqueuer(void *_count)
{
unsigned long long *count = _count;
}
+static
void *thr_dequeuer(void *_count)
{
unsigned long long *count = _count;
return ((void*)2);
}
+static
void test_end(struct cds_wfq_queue *q, unsigned long long *nr_dequeues)
{
struct cds_wfq_node *node;
} while (node);
}
+static
void show_usage(int argc, char **argv)
{
printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) <OPTIONS>\n",
* timekeeping -- very crude -- should use MONOTONIC...
*/
+static inline
long long get_microseconds(void)
{
struct timeval tv;
* Performance test.
*/
+static
void *rcu_read_perf_test(void *arg)
{
int i;
return (NULL);
}
+static
void *rcu_update_perf_test(void *arg)
{
long long n_updates_local = 0;
return NULL;
}
+static
void perftestinit(void)
{
init_per_thread(n_reads_pt, 0LL);
uatomic_set(&nthreadsrunning, 0);
}
+static
int perftestrun(int nthreads, int nreaders, int nupdaters)
{
int t;
return 0;
}
+static
int perftest(int nreaders, int cpustride)
{
int i;
return perftestrun(i + 1, nreaders, 1);
}
+static
int rperftest(int nreaders, int cpustride)
{
int i;
return perftestrun(i, nreaders, 0);
}
+static
int uperftest(int nupdaters, int cpustride)
{
int i;
int garbage = 0;
+static
void *rcu_read_stress_test(void *arg)
{
int i;
static pthread_mutex_t call_rcu_test_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t call_rcu_test_cond = PTHREAD_COND_INITIALIZER;
+static
void rcu_update_stress_test_rcu(struct rcu_head *head)
{
int ret;
}
}
+static
void *rcu_update_stress_test(void *arg)
{
int i;
return NULL;
}
+static
void *rcu_fake_update_stress_test(void *arg)
{
if (callrcu_type == CALLRCU_PERTHREAD) {
return NULL;
}
+static
int stresstest(int nreaders)
{
int i;
* Mainprogram.
*/
+static
void usage(int argc, char *argv[])
{
diag("Usage: %s nreaders [ perf | rperf | uperf | stress ] [ stride ] [ callrcu_global | callrcu_percpu | callrcu_perthread ]\n", argv[0]);