X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=iolog.c;h=e2f9776e3b5c2306e9001d3755666df5cb77c697;hp=3723e0a86025afe460c11a7585e14a365f37022b;hb=f9e5b5ee74e8282199eda9318865ffdc7645a384;hpb=ecfd2bb08cc87bc9a1b3d612258f1fdfb4d09698 diff --git a/iolog.c b/iolog.c index 3723e0a8..e2f9776e 100644 --- a/iolog.c +++ b/iolog.c @@ -576,6 +576,7 @@ void setup_log(struct io_log **log, struct log_params *p, const char *filename) { struct io_log *l; + pthread_mutexattr_t mattr; l = scalloc(1, sizeof(*l)); INIT_FLIST_HEAD(&l->io_logs); @@ -591,7 +592,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 +605,11 @@ 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); + pthread_mutexattr_init(&mattr); +#ifdef FIO_HAVE_PSHARED_MUTEX + pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED); +#endif + pthread_mutex_init(&l->chunk_lock, &mattr); p->td->flags |= TD_F_COMPRESS_LOG; }