tests: move yield debug to common test library
[urcu.git] / tests / benchmark / test_urcu_qsbr.c
index e8ba5f6937470006645648e7b1677739a3248e49..c6a6098816d19404518a2a57965ba84ae323ed05 100644 (file)
 #include <urcu/tls-compat.h>
 #include "cpuset.h"
 #include "thread-id.h"
+#include "../common/debug-yield.h"
 
 /* hardcoded number of CPUs */
 #define NR_CPUS 16384
 
 #ifndef DYNAMIC_LINK_TEST
 #define _LGPL_SOURCE
-#else
-#define rcu_debug_yield_read()
 #endif
 #include "urcu-qsbr.h"
 
@@ -253,9 +252,7 @@ void show_usage(int argc, char **argv)
        printf("Usage : %s nr_readers nr_writers duration (s) <OPTIONS>\n",
                argv[0]);
        printf("OPTIONS:\n");
-#ifdef DEBUG_YIELD
        printf("        [-r] [-w] (yield reader and/or writer)\n");
-#endif
        printf("        [-d delay] (writer period (us))\n");
        printf("        [-c duration] (reader C.S. duration (in loops))\n");
        printf("        [-e duration] (writer C.S. duration (in loops))\n");
@@ -300,14 +297,12 @@ int main(int argc, char **argv)
                if (argv[i][0] != '-')
                        continue;
                switch (argv[i][1]) {
-#ifdef DEBUG_YIELD
                case 'r':
-                       rcu_yield_active |= RCU_RCU_YIELD_READ;
+                       rcu_debug_yield_enable(RCU_YIELD_READ);
                        break;
                case 'w':
-                       rcu_yield_active |= RCU_RCU_YIELD_WRITE;
+                       rcu_debug_yield_enable(RCU_YIELD_WRITE);
                        break;
-#endif
                case 'a':
                        if (argc < i + 2) {
                                show_usage(argc, argv);
This page took 0.023 seconds and 4 git commands to generate.