From 6d37f67ffe590b2cbd9ea9f5b3105abaff2e5305 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 5 May 2016 10:54:03 -0600 Subject: [PATCH 1/1] iolog: add define for default number of log entries We use two different ones, depending on gz or not... Signed-off-by: Jens Axboe --- iolog.c | 4 ++-- iolog.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iolog.c b/iolog.c index 7d19fbfa..94d3f3c1 100644 --- 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->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; @@ -1165,7 +1165,7 @@ int iolog_flush(struct io_log *log, int wait) 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) diff --git a/iolog.h b/iolog.h index 297daf58..74f21706 100644 --- a/iolog.h +++ b/iolog.h @@ -41,6 +41,8 @@ enum { IO_LOG_TYPE_IOPS, }; +#define DEF_LOG_ENTRIES 1024 + /* * Dynamically growing data sample log */ -- 2.25.1