-#ifdef CIPHER_THREAD_STATS
-/*
- * Struct to collect thread stats
- */
-struct thread_stats {
- u_int fills;
- u_int skips;
- u_int waits;
- u_int drains;
-};
-
-/*
- * Debug print the thread stats
- * Use with pthread_cleanup_push for displaying at thread cancellation
- */
-static void
-thread_loop_stats(void *x)
-{
- struct thread_stats *s = x;
-
- debug("tid %lu - %u fills, %u skips, %u waits", pthread_self(),
- s->fills, s->skips, s->waits);
-}
-
- #define STATS_STRUCT(s) struct thread_stats s
- #define STATS_INIT(s) { memset(&s, 0, sizeof(s)); }
- #define STATS_FILL(s) { s.fills++; }
- #define STATS_SKIP(s) { s.skips++; }
- #define STATS_WAIT(s) { s.waits++; }
- #define STATS_DRAIN(s) { s.drains++; }
-#else
- #define STATS_STRUCT(s)
- #define STATS_INIT(s)
- #define STATS_FILL(s)
- #define STATS_SKIP(s)
- #define STATS_WAIT(s)
- #define STATS_DRAIN(s)
-#endif
-