volatile unsigned long threads_to_dump = 0;
unsigned int debug_commands_issued = 0;
+/* Xorshift RNGs from http://www.jstatsoft.org/v08/i14/paper */
+static THREAD_LOCAL unsigned int y = 2463534242;
+static unsigned int debug_prng()
+{
+
+ y ^= y << 13;
+ y ^= y >> 17;
+ y ^= y << 5;
+ return y;
+}
+
/* Dumps to the buffer some known information for the desired thread, and
* optionally extra info for the current thread. The dump will be appended to
* the buffer, so the caller is responsible for preliminary initializing it.
t->expire = tick_add(now_ms, inter);
/* half of the calls will wake up another entry */
- rnd = ha_random64();
+ rnd = debug_prng();
if (rnd & 1) {
rnd >>= 1;
rnd %= tctx[0];
/* wake up two random entries */
for (i = 0; i < 2; i++) {
- rnd = ha_random64() % tctx[0];
+ rnd = debug_prng() % tctx[0];
rnd = tctx[rnd + 2];
if (rnd & 1)