iolog: add define for default number of log entries
authorJens Axboe <axboe@fb.com>
Thu, 5 May 2016 16:54:03 +0000 (10:54 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 5 May 2016 16:54:03 +0000 (10:54 -0600)
We use two different ones, depending on gz or not...

Signed-off-by: Jens Axboe <axboe@fb.com>
iolog.c
iolog.h

diff --git a/iolog.c b/iolog.c
index 7d19fbfa8c04b43ab2a18ba8f05ce1ef770d0096..94d3f3c1bcc0a5659f971740ae387c1bac46d339 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -576,7 +576,7 @@ void setup_log(struct io_log **log, struct log_params *p,
 
        l = calloc(1, sizeof(*l));
        l->nr_samples = 0;
 
        l = calloc(1, sizeof(*l));
        l->nr_samples = 0;
-       l->max_samples = 1024;
+       l->max_samples = DEF_LOG_ENTRIES;
        l->log_type = p->log_type;
        l->log_offset = p->log_offset;
        l->log_gz = p->log_gz;
        l->log_type = p->log_type;
        l->log_offset = p->log_offset;
        l->log_gz = p->log_gz;
@@ -1165,7 +1165,7 @@ int iolog_flush(struct io_log *log, int wait)
        data->nr_samples = log->nr_samples;
 
        log->nr_samples = 0;
        data->nr_samples = log->nr_samples;
 
        log->nr_samples = 0;
-       log->max_samples = 128;
+       log->max_samples = DEF_LOG_ENTRIES;
        log->log = malloc(log->max_samples * log_entry_sz(log));
 
        if (!wait)
        log->log = malloc(log->max_samples * log_entry_sz(log));
 
        if (!wait)
diff --git a/iolog.h b/iolog.h
index 297daf588c281ab34e2e67c674411b29f32d791c..74f2170602fe91b340f66e115f4fb949732cc98d 100644 (file)
--- a/iolog.h
+++ b/iolog.h
@@ -41,6 +41,8 @@ enum {
        IO_LOG_TYPE_IOPS,
 };
 
        IO_LOG_TYPE_IOPS,
 };
 
+#define DEF_LOG_ENTRIES                1024
+
 /*
  * Dynamically growing data sample log
  */
 /*
  * Dynamically growing data sample log
  */