projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mmap engine: remove unused variable mmap_map_mask
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index bc17b40213a5bacdcecae2ca89e937ef86d6c8b8..382fa1ff6de82edc9d74644edcace6a7f233839e 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-103,7
+103,7
@@
static struct option l_opts[FIO_NR_OPTIONS] = {
},
{
.name = (char *) "bandwidth-log",
},
{
.name = (char *) "bandwidth-log",
- .has_arg =
required
_argument,
+ .has_arg =
no
_argument,
.val = 'b' | FIO_CLIENT_FLAG,
},
{
.val = 'b' | FIO_CLIENT_FLAG,
},
{
@@
-298,7
+298,6
@@
void free_threads_shm(void)
static void free_shm(void)
{
if (threads) {
static void free_shm(void)
{
if (threads) {
- file_hash_exit();
flow_exit();
fio_debug_jobp = NULL;
free_threads_shm();
flow_exit();
fio_debug_jobp = NULL;
free_threads_shm();
@@
-311,6
+310,7
@@
static void free_shm(void)
options_free(fio_options, &def_thread.o);
fio_filelock_exit();
options_free(fio_options, &def_thread.o);
fio_filelock_exit();
+ file_hash_exit();
scleanup();
}
scleanup();
}
@@
-322,8
+322,6
@@
static void free_shm(void)
*/
static int setup_thread_area(void)
{
*/
static int setup_thread_area(void)
{
- void *hash;
-
if (threads)
return 0;
if (threads)
return 0;
@@
-334,7
+332,6
@@
static int setup_thread_area(void)
do {
size_t size = max_jobs * sizeof(struct thread_data);
do {
size_t size = max_jobs * sizeof(struct thread_data);
- size += file_hash_size;
size += sizeof(unsigned int);
#ifndef CONFIG_NO_SHM
size += sizeof(unsigned int);
#ifndef CONFIG_NO_SHM
@@
-366,10
+363,8
@@
static int setup_thread_area(void)
#endif
memset(threads, 0, max_jobs * sizeof(struct thread_data));
#endif
memset(threads, 0, max_jobs * sizeof(struct thread_data));
- hash = (void *) threads + max_jobs * sizeof(struct thread_data);
- fio_debug_jobp = (void *) hash + file_hash_size;
+ fio_debug_jobp = (void *) threads + max_jobs * sizeof(struct thread_data);
*fio_debug_jobp = -1;
*fio_debug_jobp = -1;
- file_hash_init(hash);
flow_init();
flow_init();
@@
-1394,7
+1389,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
if (setup_rate(td))
goto err;
if (setup_rate(td))
goto err;
- if (o->
lat_log_file
) {
+ if (o->
write_lat_log
) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
@@
-1405,6
+1400,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->lat_log_file ? o->lat_log_file : o->name;
const char *suf;
if (p.log_gz_store)
const char *suf;
if (p.log_gz_store)
@@
-1412,26
+1408,20
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
else
suf = "log";
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "lat",
o->lat_log_fil
e,
+ gen_log_name(logname, sizeof(logname), "lat",
pr
e,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->lat_log, &p, logname);
td->thread_number, suf, o->per_job_logs);
setup_log(&td->lat_log, &p, logname);
- gen_log_name(logname, sizeof(logname), "slat",
o->lat_log_fil
e,
+ gen_log_name(logname, sizeof(logname), "slat",
pr
e,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->slat_log, &p, logname);
td->thread_number, suf, o->per_job_logs);
setup_log(&td->slat_log, &p, logname);
- gen_log_name(logname, sizeof(logname), "clat",
o->lat_log_fil
e,
+ gen_log_name(logname, sizeof(logname), "clat",
pr
e,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->clat_log, &p, logname);
}
td->thread_number, suf, o->per_job_logs);
setup_log(&td->clat_log, &p, logname);
}
- if (o->hist_log_file) {
-#ifndef CONFIG_ZLIB
- if (td->client_type) {
- log_err("fio: --write_hist_log requires zlib in client/server mode\n");
- goto err;
- }
-#endif
+ if (o->write_hist_log) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
@@
-1442,19
+1432,27
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->hist_log_file ? o->hist_log_file : o->name;
const char *suf;
const char *suf;
+#ifndef CONFIG_ZLIB
+ if (td->client_type) {
+ log_err("fio: --write_hist_log requires zlib in client/server mode\n");
+ goto err;
+ }
+#endif
+
if (p.log_gz_store)
suf = "log.fz";
else
suf = "log";
if (p.log_gz_store)
suf = "log.fz";
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "clat_hist",
o->hist_log_fil
e,
+ gen_log_name(logname, sizeof(logname), "clat_hist",
pr
e,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->clat_hist_log, &p, logname);
}
td->thread_number, suf, o->per_job_logs);
setup_log(&td->clat_hist_log, &p, logname);
}
- if (o->
bw_log_file
) {
+ if (o->
write_bw_log
) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
@@
-1465,6
+1463,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->bw_log_file ? o->bw_log_file : o->name;
const char *suf;
if (fio_option_is_set(o, bw_avg_time))
const char *suf;
if (fio_option_is_set(o, bw_avg_time))
@@
-1480,11
+1479,11
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
else
suf = "log";
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "bw",
o->bw_log_fil
e,
+ gen_log_name(logname, sizeof(logname), "bw",
pr
e,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->bw_log, &p, logname);
}
td->thread_number, suf, o->per_job_logs);
setup_log(&td->bw_log, &p, logname);
}
- if (o->
iops_log_file
) {
+ if (o->
write_iops_log
) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
@@
-1495,6
+1494,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->iops_log_file ? o->iops_log_file : o->name;
const char *suf;
if (fio_option_is_set(o, iops_avg_time))
const char *suf;
if (fio_option_is_set(o, iops_avg_time))
@@
-1510,7
+1510,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
else
suf = "log";
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "iops",
o->iops_log_fil
e,
+ gen_log_name(logname, sizeof(logname), "iops",
pr
e,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->iops_log, &p, logname);
}
td->thread_number, suf, o->per_job_logs);
setup_log(&td->iops_log, &p, logname);
}
@@
-1679,7
+1679,7
@@
static int is_empty_or_comment(char *line)
/*
* This is our [ini] type file parser.
*/
/*
* This is our [ini] type file parser.
*/
-int __parse_jobs_ini(struct thread_data *td,
+
static
int __parse_jobs_ini(struct thread_data *td,
char *file, int is_buf, int stonewall_flag, int type,
int nested, char *name, char ***popts, int *aopts, int *nopts)
{
char *file, int is_buf, int stonewall_flag, int type,
int nested, char *name, char ***popts, int *aopts, int *nopts)
{
@@
-2005,7
+2005,7
@@
static void usage(const char *name)
printf(" --parse-only\t\tParse options only, don't start any IO\n");
printf(" --output\t\tWrite output to file\n");
printf(" --runtime\t\tRuntime in seconds\n");
printf(" --parse-only\t\tParse options only, don't start any IO\n");
printf(" --output\t\tWrite output to file\n");
printf(" --runtime\t\tRuntime in seconds\n");
- printf(" --bandwidth-log\tGenerate
per-job
bandwidth logs\n");
+ printf(" --bandwidth-log\tGenerate
aggregate
bandwidth logs\n");
printf(" --minimal\t\tMinimal (terse) output\n");
printf(" --output-format=x\tOutput format (terse,json,json+,normal)\n");
printf(" --terse-version=x\tSet terse version output format to 'x'\n");
printf(" --minimal\t\tMinimal (terse) output\n");
printf(" --output-format=x\tOutput format (terse,json,json+,normal)\n");
printf(" --terse-version=x\tSet terse version output format to 'x'\n");
@@
-2307,6
+2307,8
@@
int parse_cmd_line(int argc, char *argv[], int client_type)
switch (c) {
case 'a':
smalloc_pool_size = atoi(optarg);
switch (c) {
case 'a':
smalloc_pool_size = atoi(optarg);
+ smalloc_pool_size <<= 10;
+ sinit();
break;
case 't':
if (check_str_time(optarg, &def_timeout, 1)) {
break;
case 't':
if (check_str_time(optarg, &def_timeout, 1)) {