chiark / gitweb /
bus: disable debug output in test-bus-kernel-benchmark
[elogind.git] / src / libsystemd-bus / test-bus-kernel-benchmark.c
index 2ece2a0029df8d92654105eb4b4aea2f8b1b14ea..666c74cea384604d787f6dea76ac555eb9926768 100644 (file)
@@ -31,8 +31,9 @@
 #include "bus-error.h"
 #include "bus-kernel.h"
 #include "bus-internal.h"
+#include "bus-util.h"
 
-#define MAX_SIZE (8*1024*1024)
+#define MAX_SIZE (4*1024*1024)
 
 static usec_t arg_loop_usec = 100 * USEC_PER_MSEC;
 
@@ -118,7 +119,7 @@ static void client_bisect(const char *address) {
                 if (csize <= 0)
                         break;
 
-                fprintf(stderr, "%zu\t", csize);
+                printf("%zu\t", csize);
 
                 b->use_memfd = 0;
 
@@ -138,7 +139,7 @@ static void client_bisect(const char *address) {
                         if (now(CLOCK_MONOTONIC) >= t + arg_loop_usec)
                                 break;
                 }
-                printf("%u\n", (unsigned) ((n_copying * USEC_PER_SEC) / arg_loop_usec));
+                printf("%u\n", (unsigned) ((n_memfd * USEC_PER_SEC) / arg_loop_usec));
 
                 if (n_copying == n_memfd)
                         break;
@@ -176,11 +177,11 @@ static void client_chart(const char *address) {
 
         printf("SIZE\tCOPY\tMEMFD\n");
 
-        for (csize = 1; csize < MAX_SIZE; csize *= 2) {
+        for (csize = 1; csize <= MAX_SIZE; csize *= 2) {
                 usec_t t;
                 unsigned n_copying, n_memfd;
 
-                fprintf(stderr, "%zu\t", csize);
+                printf("%zu\t", csize);
 
                 b->use_memfd = 0;
 
@@ -227,8 +228,6 @@ int main(int argc, char *argv[]) {
         pid_t pid;
         int r;
 
-        log_set_max_level(LOG_DEBUG);
-
         for (i = 1; i < argc; i++) {
                 if (streq(argv[i], "chart")) {
                         mode = MODE_CHART;