X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=libfio.c;h=1fd77e40770065f6c6dfcc0b8c7e80600f188b2e;hp=867d86e3dc4e3aea30523a22bf4c9faead07307a;hb=ea1f1da3959dac74093013f4bb20320f97000219;hpb=62232d0618e3f5aa4805b4be34e872895ba1beb2 diff --git a/libfio.c b/libfio.c index 867d86e3..1fd77e40 100644 --- a/libfio.c +++ b/libfio.c @@ -31,6 +31,7 @@ #include "fio.h" #include "smalloc.h" #include "os/os.h" +#include "filelock.h" /* * Just expose an empty list, if the OS does not support disk util stats @@ -41,8 +42,8 @@ FLIST_HEAD(disk_list); unsigned long arch_flags = 0; -uintptr_t page_mask; -uintptr_t page_size; +uintptr_t page_mask = 0; +uintptr_t page_size = 0; static const char *fio_os_strings[os_nr] = { "Invalid", @@ -52,8 +53,10 @@ static const char *fio_os_strings[os_nr] = { "HP-UX", "OSX", "NetBSD", + "OpenBSD", "Solaris", - "Windows" + "Windows", + "Android", }; static const char *fio_arch_strings[arch_nr] = { @@ -83,7 +86,6 @@ static void reset_io_counters(struct thread_data *td) td->this_io_blocks[ddir] = 0; td->rate_bytes[ddir] = 0; td->rate_blocks[ddir] = 0; - td->io_issues[ddir] = 0; } td->zone_bytes = 0; @@ -133,6 +135,8 @@ void reset_all_stats(struct thread_data *td) fio_gettime(&tv, NULL); memcpy(&td->epoch, &tv, sizeof(tv)); memcpy(&td->start, &tv, sizeof(tv)); + + lat_target_reset(td); } void reset_fio_state(void) @@ -169,6 +173,19 @@ void td_set_runstate(struct thread_data *td, int runstate) td->runstate = runstate; } +int td_bump_runstate(struct thread_data *td, int new_state) +{ + int old_state = td->runstate; + + td_set_runstate(td, new_state); + return old_state; +} + +void td_restore_runstate(struct thread_data *td, int old_state) +{ + td_set_runstate(td, old_state); +} + void fio_terminate_threads(int group_id) { struct thread_data *td; @@ -241,10 +258,19 @@ int initialize_fio(char *envp[]) return 1; } +#if !defined(CONFIG_GETTIMEOFDAY) && !defined(CONFIG_CLOCK_GETTIME) +#error "No available clock source!" +#endif + arch_init(envp); sinit(); + if (fio_filelock_init()) { + log_err("fio: failed initializing filelock subsys\n"); + return 1; + } + /* * We need locale for number printing, if it isn't set then just * go with the US format.