simulate a machine with less memory available. x can
include k/m/g suffix.
nice=x Run job at given nice value.
+ exec_prerun=x Run 'x' before job io is begun.
+ exec_postrun=x Run 'x' after job io has finished.
Examples using a job file
-------------------------
return 0;
}
+static int str_prerun_cb(struct thread_data *td, char *file)
+{
+ td->exec_prerun = strdup(file);
+ return 0;
+}
+
+static int str_postrun_cb(struct thread_data *td, char *file)
+{
+ td->exec_postrun = strdup(file);
+ return 0;
+}
+
int parse_jobs_ini(char *file)
{
unsigned int prioclass, prio, cpu, global, il;
fgetpos(f, &off);
continue;
}
+ if (!check_str(p, "exec_prerun", str_prerun_cb, td)) {
+ fgetpos(f, &off);
+ continue;
+ }
+ if (!check_str(p, "exec_postrun", str_postrun_cb, td)) {
+ fgetpos(f, &off);
+ continue;
+ }
printf("Client%d: bad option %s\n",td->thread_number,p);
return 1;
gettimeofday(&td->epoch, NULL);
+ if (td->exec_prerun)
+ system(td->exec_prerun);
+
while (td->loops--) {
getrusage(RUSAGE_SELF, &td->ru_start);
gettimeofday(&td->start, NULL);
finish_log(td, td->clat_log, "clat");
if (td->write_iolog)
write_iolog_close(td);
+ if (td->exec_postrun)
+ system(td->exec_postrun);
if (exitall_on_terminate)
terminate_threads(td->groupid);
free(td->directory);
if (td->iolog_file)
free(td->iolog_file);
+ if (td->exec_prerun)
+ free(td->exec_prerun);
+ if (td->exec_postrun)
+ free(td->exec_postrun);
cleanup_io(td);
cleanup_io_u(td);
td_set_runstate(td, TD_EXITED);
struct timeval rwmix_switch;
int rwmix_ddir;
+ /*
+ * Pre-run and post-run shell
+ */
+ char *exec_prerun;
+ char *exec_postrun;
+
struct list_head io_hist_list;
struct list_head io_log_list;
};