]> pd.if.org Git - nbds/blobdiff - runtime/lwt.c
add perf test driver
[nbds] / runtime / lwt.c
index 0c3147fe5f18489b9ccef75e6a6c10994d15fea7..a986567bcb05023f8e6bafb541035fe5266f9900 100644 (file)
@@ -10,8 +10,8 @@
 #include "lwt.h"
 #include "mem.h"
 
-#define LWT_BUFFER_SCALE 16
-#define LWT_BUFFER_SIZE (1 << LWT_BUFFER_SCALE)
+#define LWT_BUFFER_SCALE 20
+#define LWT_BUFFER_SIZE (1ULL << LWT_BUFFER_SCALE)
 #define LWT_BUFFER_MASK (LWT_BUFFER_SIZE - 1)
 
 volatile int halt_ = 0;
@@ -19,8 +19,8 @@ volatile int halt_ = 0;
 typedef struct lwt_record {
     uint64_t timestamp;
     uint64_t format;
-    uint64_t value1;
-    uint64_t value2;
+    size_t value1;
+    size_t value2;
 } lwt_record_t;
 
 typedef struct lwt_buffer {
@@ -51,7 +51,7 @@ void lwt_set_trace_level (const char *flags)
     }
 }
 
-static inline void dump_record (FILE *file, int thread_id, lwt_record_t *r, uint64_t offset)
+static void dump_record (FILE *file, int thread_id, lwt_record_t *r, uint64_t offset)
 {
     // print the record if its trace category is enabled at a high enough level
     int flag  =  r->format >> 56;