iolog: allocate 'cur_log's out of shared pool
[fio.git] / iolog.c
diff --git a/iolog.c b/iolog.c
index 3723e0a86025afe460c11a7585e14a365f37022b..4ecf39abe914f4afdfda4b181452a9ba775edf5a 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -591,7 +591,7 @@ void setup_log(struct io_log **log, struct log_params *p,
                struct io_logs *p;
 
                p = calloc(1, sizeof(*l->pending));
-               p->max_samples = l->td->o.iodepth;
+               p->max_samples = DEF_LOG_ENTRIES;
                p->log = calloc(p->max_samples, log_entry_sz(l));
                l->pending = p;
        }
@@ -604,7 +604,7 @@ void setup_log(struct io_log **log, struct log_params *p,
        if (l->log_gz && !p->td)
                l->log_gz = 0;
        else if (l->log_gz || l->log_gz_store) {
-               pthread_mutex_init(&l->chunk_lock, NULL);
+               mutex_init_pshared(&l->chunk_lock);
                p->td->flags |= TD_F_COMPRESS_LOG;
        }
 
@@ -988,6 +988,7 @@ void flush_log(struct io_log *log, int do_append)
                cur_log = flist_first_entry(&log->io_logs, struct io_logs, list);
                flist_del_init(&cur_log->list);
                flush_samples(f, cur_log->log, cur_log->nr_samples * log_entry_sz(log));
+               sfree(cur_log);
        }
 
        fclose(f);