The following changes since commit 6a5c4d92ce70a05d2fee981b6f133373c0ef62f8: Merge branch 'master' into gfio (2013-02-20 11:52:28 +0100) are available in the git repository at: git://git.kernel.dk/fio.git gfio Bruce Cran (4): Update all Windows files except dobuild.cmd to use LF line endings Add recommendation that fio be run in a native console on Windows. Declare 'prev' and 'this' outside the loop to avoid clang warning about 'prev' being uninitialized Add FreeBSD cpu affinity support. Huadong Liu (2): check output_format before calling show_idle_prof_stats() check output_format before calling show_idle_prof_stats() Jens Axboe (8): t/axmap: add pre/post bit set checks t/axmap: add pre/post bit set checks README: kill reference to non-functional SUSE package page Fix x86 32-bit wrong variable type for rdtsc Fixup ia64 32-bit register clock cycle read Fix problem with terminating on unaligned sizes Fio 2.0.14 Merge branch 'master' into gfio FIO-VERSION-GEN | 2 +- README | 12 ++-- arch/arch-ia64.h | 4 +- arch/arch-x86.h | 2 +- filesetup.c | 4 +- gettime.c | 3 +- lib/axmap.c | 16 +++- os/os-freebsd.h | 31 +++++++ os/windows/examples.wxs | 150 +++++++++++++++--------------- os/windows/install.wxs | 142 +++++++++++++++--------------- os/windows/posix/include/arpa/inet.h | 26 +++--- os/windows/posix/include/asm/types.h | 16 ++-- os/windows/posix/include/dirent.h | 48 +++++----- os/windows/posix/include/dlfcn.h | 22 +++--- os/windows/posix/include/libgen.h | 12 ++-- os/windows/posix/include/netdb.h | 8 +- os/windows/posix/include/netinet/in.h | 42 +++++----- os/windows/posix/include/poll.h | 8 +- os/windows/posix/include/semaphore.h | 8 +- os/windows/posix/include/sys/ipc.h | 8 +- os/windows/posix/include/sys/mman.h | 72 ++++++++-------- os/windows/posix/include/sys/poll.h | 30 +++--- os/windows/posix/include/sys/resource.h | 38 ++++---- os/windows/posix/include/sys/shm.h | 82 +++++++++--------- os/windows/posix/include/sys/socket.h | 8 +- os/windows/posix/include/sys/uio.h | 32 ++++---- os/windows/posix/include/sys/un.h | 26 +++--- os/windows/posix/include/sys/wait.h | 24 +++--- os/windows/posix/include/syslog.h | 36 ++++---- stat.c | 6 +- t/axmap.c | 8 ++ 31 files changed, 488 insertions(+), 438 deletions(-) --- Diff of recent changes: diff --git a/FIO-VERSION-GEN b/FIO-VERSION-GEN index 85e4cda..85e6f4a 100755 --- a/FIO-VERSION-GEN +++ b/FIO-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=FIO-VERSION-FILE -DEF_VER=fio-2.0.13 +DEF_VER=fio-2.0.14 LF=' ' diff --git a/README b/README index 4173237..4f796e3 100644 --- a/README +++ b/README @@ -39,11 +39,6 @@ Starting with Ubuntu 10.04 LTS (aka "Lucid Lynx"), fio packages are part of the Ubuntu "universe" repository. http://packages.ubuntu.com/search?keywords=fio -SUSE: -Pascal Bleser <guru@xxxxxxxxxxx> has fio RPMs in his repository for SUSE -variants, you can find them here: -http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=System/fio - Red Hat, CentOS & Co: Dag Wieërs has RPMs for Red Hat related distros, find them here: http://dag.wieers.com/rpm/packages/fio/ @@ -59,7 +54,7 @@ tool (http://www.opencsw.org/get-it/pkgutil/) and then install fio via Windows: Bruce Cran <bruce@xxxxxxxxxxx> has fio packages for Windows at -http://www.bluestop.org/fio . +http://www.bluestop.org/fio/ . Mailing list @@ -128,6 +123,11 @@ How to compile FIO on 64-bit Windows: To build fio on 32-bit Windows, download x86/pthreadGC2.dll instead and do './configure --build-32bit-win=yes' before 'make'. +It's recommended that once built or installed, fio be run in a Command Prompt +or other 'native' console such as console2, since there are known to be display +and signal issues when running it under a Cygwin shell +(see http://code.google.com/p/mintty/issues/detail?id=56 for details). + Command line ------------ diff --git a/arch/arch-ia64.h b/arch/arch-ia64.h index 2df55ba..8e8dd7f 100644 --- a/arch/arch-ia64.h +++ b/arch/arch-ia64.h @@ -34,9 +34,9 @@ static inline unsigned long arch_ffz(unsigned long bitmask) return ia64_popcnt(bitmask & (~bitmask - 1)); } -static inline unsigned long get_cpu_clock(void) +static inline unsigned long long get_cpu_clock(void) { - unsigned long ret; + unsigned long long ret; __asm__ __volatile__("mov %0=ar.itc" : "=r" (ret) : : "memory"); return ret; diff --git a/arch/arch-x86.h b/arch/arch-x86.h index 679ec28..8eea538 100644 --- a/arch/arch-x86.h +++ b/arch/arch-x86.h @@ -34,7 +34,7 @@ static inline unsigned long arch_ffz(unsigned long bitmask) static inline unsigned long long get_cpu_clock(void) { - unsigned long ret; + unsigned long long ret; __asm__ __volatile__("rdtsc" : "=A" (ret)); return ret; diff --git a/filesetup.c b/filesetup.c index 3054d9d..4e82854 100644 --- a/filesetup.c +++ b/filesetup.c @@ -958,8 +958,8 @@ int init_random_map(struct thread_data *td) for_each_file(td, f, i) { uint64_t file_size = min(f->real_file_size, f->io_size); - blocks = (file_size + td->o.rw_min_bs - 1) / - (unsigned long long) td->o.rw_min_bs; + blocks = file_size / (unsigned long long) td->o.rw_min_bs; + if (td->o.random_generator == FIO_RAND_GEN_LFSR) { unsigned long seed; diff --git a/gettime.c b/gettime.c index cc9dcb7..5b85a23 100644 --- a/gettime.c +++ b/gettime.c @@ -501,6 +501,7 @@ int fio_monotonic_clocktest(void) unsigned int nr_cpus = cpus_online(); struct clock_entry *entries; unsigned long tentries, failed; + struct clock_entry *prev, *this; uint64_t seq = 0; int i; @@ -558,7 +559,7 @@ int fio_monotonic_clocktest(void) qsort(entries, tentries, sizeof(struct clock_entry), clock_cmp); for (failed = i = 0; i < tentries; i++) { - struct clock_entry *prev, *this = &entries[i]; + this = &entries[i]; if (!i) { prev = this; diff --git a/lib/axmap.c b/lib/axmap.c index 533a155..eeb32d4 100644 --- a/lib/axmap.c +++ b/lib/axmap.c @@ -374,9 +374,9 @@ static int axmap_next_free_fn(struct axmap_level *al, unsigned long offset, unsigned int bit, void *__data) { struct axmap_next_free_data *data = __data; - uint64_t mask = ~((1UL << ((data->bit & BLOCKS_PER_UNIT_MASK) + 1)) - 1); + uint64_t mask = ~bit_masks[(data->bit + 1) & BLOCKS_PER_UNIT_MASK]; - if (!(mask & al->map[offset])) + if (!(mask & ~al->map[offset])) return 0; if (al->map[offset] != -1UL) { @@ -395,6 +395,7 @@ static int axmap_next_free_fn(struct axmap_level *al, unsigned long offset, uint64_t axmap_next_free(struct axmap *axmap, uint64_t bit_nr) { struct axmap_next_free_data data = { .level = -1U, .bit = bit_nr, }; + uint64_t ret; if (firstfree_valid(axmap) && bit_nr < axmap->first_free) return axmap->first_free; @@ -404,5 +405,14 @@ uint64_t axmap_next_free(struct axmap *axmap, uint64_t bit_nr) assert(data.level != -1U); - return axmap_find_first_free(axmap, data.level, data.offset); + /* + * In the rare case that the map is unaligned, we might end up + * finding an offset that's beyond the valid end. For that case, + * find the first free one, the map is practically full. + */ + ret = axmap_find_first_free(axmap, data.level, data.offset); + if (ret != -1ULL) + return ret; + + return axmap_first_free(axmap); } diff --git a/os/os-freebsd.h b/os/os-freebsd.h index c55a7c3..57ce409 100644 --- a/os/os-freebsd.h +++ b/os/os-freebsd.h @@ -8,6 +8,8 @@ #include <sys/disk.h> #include <sys/thr.h> #include <sys/socket.h> +#include <sys/param.h> +#include <sys/cpuset.h> #include "../file.h" @@ -16,6 +18,7 @@ #define FIO_USE_GENERIC_INIT_RANDOM_STATE #define FIO_HAVE_CHARDEV_SIZE #define FIO_HAVE_GETTID +#define FIO_HAVE_CPU_AFFINITY #define OS_MAP_ANON MAP_ANON @@ -25,6 +28,34 @@ typedef off_t off64_t; +typedef cpuset_t os_cpu_mask_t; + +#define fio_cpu_clear(mask, cpu) (void) CPU_CLR((cpu), (mask)) +#define fio_cpu_set(mask, cpu) (void) CPU_SET((cpu), (mask)) + +static inline int fio_cpuset_init(os_cpu_mask_t *mask) +{ + CPU_ZERO(mask); + return 0; +} + +static inline int fio_cpuset_exit(os_cpu_mask_t *mask) +{ + return 0; +} + +static inline int fio_setaffinity(int pid, os_cpu_mask_t cpumask) +{ + return cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, pid, sizeof(cpumask), &cpumask); +} + +static inline int fio_getaffinity(int pid, os_cpu_mask_t *cpumask) +{ + return cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, sizeof(cpumask), cpumask); +} + +#define FIO_MAX_CPUS CPU_SETSIZE + static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) { off_t size; diff --git a/os/windows/examples.wxs b/os/windows/examples.wxs index 84f2a86..7717309 100755 --- a/os/windows/examples.wxs +++ b/os/windows/examples.wxs @@ -1,75 +1,75 @@ -<?xml version="1.0" encoding="utf-8"?> -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> - <Fragment> - <DirectoryRef Id="examples"> - <Component> - <File Source="..\..\examples\1mbs_clients" /> - </Component> - <Component> - <File Source="..\..\examples\aio-read" /> - </Component> - <Component> - <File Source="..\..\examples\disk-zone-profile" /> - </Component> - <Component> - <File Source="..\..\examples\fsx" /> - </Component> - <Component> - <File Source="..\..\examples\iometer-file-access-server" /> - </Component> - <Component> - <File Source="..\..\examples\netio" /> - </Component> - <Component> - <File Source="..\..\examples\ssd-test" /> - </Component> - <Component> - <File Source="..\..\examples\surface-scan" /> - </Component> - <Component> - <File Source="..\..\examples\tiobench-example" /> - </Component> - <Component> - <File Source="..\..\examples\null" /> - </Component> - <Component> - <File Source="..\..\examples\flow" /> - </Component> - <Component> - <File Source="..\..\examples\cpuio" /> - </Component> - <Component> - <File Source="..\..\examples\falloc" /> - </Component> - <Component> - <File Source="..\..\examples\fusion-aw-sync.ini" /> - </Component> - <Component> - <File Source="..\..\examples\ssd-steadystate.fio" /> - </Component> - <Component> - <File Source="..\..\examples\zipf" /> - </Component> - </DirectoryRef> - </Fragment> - <Fragment> - <ComponentGroup Id="examples"> - <ComponentRef Id="_1mbs_clients" /> - <ComponentRef Id="aio_read" /> - <ComponentRef Id="disk_zone_profile" /> - <ComponentRef Id="fsx" /> - <ComponentRef Id="iometer_file_access_server" /> - <ComponentRef Id="netio" /> - <ComponentRef Id="ssd_test" /> - <ComponentRef Id="surface_scan" /> - <ComponentRef Id="tiobench_example" /> - <ComponentRef Id="null" /> - <ComponentRef Id="flow" /> - <ComponentRef Id="cpuio" /> - <ComponentRef Id="falloc" /> - <ComponentRef Id="fusion_aw_sync.ini" /> - <ComponentRef Id="ssd_steadystate.fio" /> - <ComponentRef Id="zipf" /> - </ComponentGroup> - </Fragment> -</Wix> +<?xml version="1.0" encoding="utf-8"?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> + <Fragment> + <DirectoryRef Id="examples"> + <Component> + <File Source="..\..\examples\1mbs_clients" /> + </Component> + <Component> + <File Source="..\..\examples\aio-read" /> + </Component> + <Component> + <File Source="..\..\examples\disk-zone-profile" /> + </Component> + <Component> + <File Source="..\..\examples\fsx" /> + </Component> + <Component> + <File Source="..\..\examples\iometer-file-access-server" /> + </Component> + <Component> + <File Source="..\..\examples\netio" /> + </Component> + <Component> + <File Source="..\..\examples\ssd-test" /> + </Component> + <Component> + <File Source="..\..\examples\surface-scan" /> + </Component> + <Component> + <File Source="..\..\examples\tiobench-example" /> + </Component> + <Component> + <File Source="..\..\examples\null" /> + </Component> + <Component> + <File Source="..\..\examples\flow" /> + </Component> + <Component> + <File Source="..\..\examples\cpuio" /> + </Component> + <Component> + <File Source="..\..\examples\falloc" /> + </Component> + <Component> + <File Source="..\..\examples\fusion-aw-sync.ini" /> + </Component> + <Component> + <File Source="..\..\examples\ssd-steadystate.fio" /> + </Component> + <Component> + <File Source="..\..\examples\zipf" /> + </Component> + </DirectoryRef> + </Fragment> + <Fragment> + <ComponentGroup Id="examples"> + <ComponentRef Id="_1mbs_clients" /> + <ComponentRef Id="aio_read" /> + <ComponentRef Id="disk_zone_profile" /> + <ComponentRef Id="fsx" /> + <ComponentRef Id="iometer_file_access_server" /> + <ComponentRef Id="netio" /> + <ComponentRef Id="ssd_test" /> + <ComponentRef Id="surface_scan" /> + <ComponentRef Id="tiobench_example" /> + <ComponentRef Id="null" /> + <ComponentRef Id="flow" /> + <ComponentRef Id="cpuio" /> + <ComponentRef Id="falloc" /> + <ComponentRef Id="fusion_aw_sync.ini" /> + <ComponentRef Id="ssd_steadystate.fio" /> + <ComponentRef Id="zipf" /> + </ComponentGroup> + </Fragment> +</Wix> diff --git a/os/windows/install.wxs b/os/windows/install.wxs index b43120a..5b4b939 100755 --- a/os/windows/install.wxs +++ b/os/windows/install.wxs @@ -1,71 +1,71 @@ -<?xml version="1.0" encoding="utf-8"?> -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> - - <?if $(env.FIO_ARCH) = x86 ?> - <?define ProgramDirectory = ProgramFilesFolder ?> - <?else?> - <?define ProgramDirectory = ProgramFiles64Folder ?> - <?endif?> - - <Product Id="*" - Codepage="1252" Language="1033" - Manufacturer="fio" Name="fio" - UpgradeCode="2338A332-5511-43CF-B9BD-5C60496CCFCC" Version="2.0.13"> - <Package - Description="Flexible IO Tester" - InstallerVersion="301" Keywords="Installer,MSI,Database" - Languages="1033" Manufacturer="fio" - InstallScope="perMachine" InstallPrivileges="elevated" Compressed="yes"/> - - <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" CompressionLevel="high"/> - - <Directory Id="TARGETDIR" Name="SourceDir"> - <Directory Id="$(var.ProgramDirectory)"> - <Directory Id="INSTALLDIR"> - <Directory Id="fio" Name="fio"> - <Component> - <File Source="..\..\fio.exe"/> - </Component> - <Component> - <File KeyPath="yes" Source="..\..\pthreadGC2.dll"/> - </Component> - <Component> - <File Id="README" Name="README.rtf" Source="..\..\README"/> - </Component> - <Component> - <File Id="REPORTING_BUGS" Name="REPORTING-BUGS.rtf" Source="..\..\REPORTING-BUGS"/> - </Component> - <Component> - <File Id="HOWTO" Name="HOWTO.rtf" Source="..\..\HOWTO"/> - </Component> - <Component> - <File Id="COPYING" Name="COPYING.rtf" Source="..\..\COPYING"/> - </Component> - <Directory Id="examples" Name="examples"/> - </Directory> - </Directory> - </Directory> - </Directory> - - <Feature Id="AlwaysInstall" Absent="disallow" ConfigurableDirectory="INSTALLDIR" Display="hidden" Level="1" Title="Flexible IO Tester"> - <ComponentRef Id="fio.exe"/> - <ComponentRef Id="pthreadGC2.dll"/> - <ComponentRef Id="HOWTO"/> - <ComponentRef Id="README"/> - <ComponentRef Id="REPORTING_BUGS"/> - <ComponentRef Id="COPYING"/> - <ComponentGroupRef Id="examples"/> - </Feature> - - <Property Id="ARPURLINFOABOUT" Value="http://git.kernel.dk/?p=fio.git" /> - <Property Id='ARPCONTACT'>fio@xxxxxxxxxxxxxxx</Property> - <Property Id='ARPHELPLINK'>http://www.spinics.net/lists/fio/</Property> - <Property Id='ARPURLUPDATEINFO'>http://git.kernel.dk/?p=fio.git</Property> - - <WixVariable Id="WixUILicenseRtf" Value="eula.rtf" /> - - <UIRef Id="WixUI_Minimal"/> - - <MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="A newer version of the application is already installed."/> -</Product> -</Wix> +<?xml version="1.0" encoding="utf-8"?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> + + <?if $(env.FIO_ARCH) = x86 ?> + <?define ProgramDirectory = ProgramFilesFolder ?> + <?else?> + <?define ProgramDirectory = ProgramFiles64Folder ?> + <?endif?> + + <Product Id="*" + Codepage="1252" Language="1033" + Manufacturer="fio" Name="fio" + UpgradeCode="2338A332-5511-43CF-B9BD-5C60496CCFCC" Version="2.0.14"> + <Package + Description="Flexible IO Tester" + InstallerVersion="301" Keywords="Installer,MSI,Database" + Languages="1033" Manufacturer="fio" + InstallScope="perMachine" InstallPrivileges="elevated" Compressed="yes"/> + + <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" CompressionLevel="high"/> + + <Directory Id="TARGETDIR" Name="SourceDir"> + <Directory Id="$(var.ProgramDirectory)"> + <Directory Id="INSTALLDIR"> + <Directory Id="fio" Name="fio"> + <Component> + <File Source="..\..\fio.exe"/> + </Component> + <Component> + <File KeyPath="yes" Source="..\..\pthreadGC2.dll"/> + </Component> + <Component> + <File Id="README" Name="README.rtf" Source="..\..\README"/> + </Component> + <Component> + <File Id="REPORTING_BUGS" Name="REPORTING-BUGS.rtf" Source="..\..\REPORTING-BUGS"/> + </Component> + <Component> + <File Id="HOWTO" Name="HOWTO.rtf" Source="..\..\HOWTO"/> + </Component> + <Component> + <File Id="COPYING" Name="COPYING.rtf" Source="..\..\COPYING"/> + </Component> + <Directory Id="examples" Name="examples"/> + </Directory> + </Directory> + </Directory> + </Directory> + + <Feature Id="AlwaysInstall" Absent="disallow" ConfigurableDirectory="INSTALLDIR" Display="hidden" Level="1" Title="Flexible IO Tester"> + <ComponentRef Id="fio.exe"/> + <ComponentRef Id="pthreadGC2.dll"/> + <ComponentRef Id="HOWTO"/> + <ComponentRef Id="README"/> + <ComponentRef Id="REPORTING_BUGS"/> + <ComponentRef Id="COPYING"/> + <ComponentGroupRef Id="examples"/> + </Feature> + + <Property Id="ARPURLINFOABOUT" Value="http://git.kernel.dk/?p=fio.git" /> + <Property Id='ARPCONTACT'>fio@xxxxxxxxxxxxxxx</Property> + <Property Id='ARPHELPLINK'>http://www.spinics.net/lists/fio/</Property> + <Property Id='ARPURLUPDATEINFO'>http://git.kernel.dk/?p=fio.git</Property> + + <WixVariable Id="WixUILicenseRtf" Value="eula.rtf" /> + + <UIRef Id="WixUI_Minimal"/> + + <MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="A newer version of the application is already installed."/> +</Product> +</Wix> diff --git a/os/windows/posix/include/arpa/inet.h b/os/windows/posix/include/arpa/inet.h index df9e278..7e3bfb7 100644 --- a/os/windows/posix/include/arpa/inet.h +++ b/os/windows/posix/include/arpa/inet.h @@ -1,13 +1,13 @@ -#ifndef ARPA_INET_H -#define ARPA_INET_H - -#include <winsock2.h> -#include <inttypes.h> - -typedef int socklen_t; - -const char *inet_ntop(int af, const void *restrict src, - char *restrict dst, socklen_t size); -int inet_pton(int af, const char *restrict src, void *restrict dst); - -#endif /* ARPA_INET_H */ +#ifndef ARPA_INET_H +#define ARPA_INET_H + +#include <winsock2.h> +#include <inttypes.h> + +typedef int socklen_t; + +const char *inet_ntop(int af, const void *restrict src, + char *restrict dst, socklen_t size); +int inet_pton(int af, const char *restrict src, void *restrict dst); + +#endif /* ARPA_INET_H */ diff --git a/os/windows/posix/include/asm/types.h b/os/windows/posix/include/asm/types.h index 89ab3d0..7e1489a 100644 --- a/os/windows/posix/include/asm/types.h +++ b/os/windows/posix/include/asm/types.h @@ -1,8 +1,8 @@ -#ifndef ASM_TYPES_H -#define ASM_TYPES_H - -typedef unsigned short __u16; -typedef unsigned int __u32; -typedef unsigned long long __u64; - -#endif /* ASM_TYPES_H */ +#ifndef ASM_TYPES_H +#define ASM_TYPES_H + +typedef unsigned short __u16; +typedef unsigned int __u32; +typedef unsigned long long __u64; + +#endif /* ASM_TYPES_H */ diff --git a/os/windows/posix/include/dirent.h b/os/windows/posix/include/dirent.h index eef6a88..379fdf0 100644 --- a/os/windows/posix/include/dirent.h +++ b/os/windows/posix/include/dirent.h @@ -1,24 +1,24 @@ -#ifndef DIRENT_H -#define DIRENT_H - -#include <windows.h> - -struct dirent -{ - ino_t d_ino; /* File serial number */ - char d_name[MAX_PATH]; /* Name of entry */ -}; - -struct dirent_ctx -{ - HANDLE find_handle; - char dirname[MAX_PATH]; -}; - -typedef struct dirent_ctx DIR; - -DIR *opendir(const char *dirname); -struct dirent *readdir(DIR *dirp); -int closedir(DIR *dirp); - -#endif /* DIRENT_H */ +#ifndef DIRENT_H +#define DIRENT_H + +#include <windows.h> + +struct dirent +{ + ino_t d_ino; /* File serial number */ + char d_name[MAX_PATH]; /* Name of entry */ +}; + +struct dirent_ctx +{ + HANDLE find_handle; + char dirname[MAX_PATH]; +}; + +typedef struct dirent_ctx DIR; + +DIR *opendir(const char *dirname); +struct dirent *readdir(DIR *dirp); +int closedir(DIR *dirp); + +#endif /* DIRENT_H */ diff --git a/os/windows/posix/include/dlfcn.h b/os/windows/posix/include/dlfcn.h index aaffb52..57f2930 100644 --- a/os/windows/posix/include/dlfcn.h +++ b/os/windows/posix/include/dlfcn.h @@ -1,11 +1,11 @@ -#ifndef DLFCN_H -#define DLFCN_H - -#define RTLD_LAZY 1 - -void *dlopen(const char *file, int mode); -int dlclose(void *handle); -void *dlsym(void *restrict handle, const char *restrict name); -char *dlerror(void); - -#endif /* DLFCN_H */ +#ifndef DLFCN_H +#define DLFCN_H + +#define RTLD_LAZY 1 + +void *dlopen(const char *file, int mode); +int dlclose(void *handle); +void *dlsym(void *restrict handle, const char *restrict name); +char *dlerror(void); + +#endif /* DLFCN_H */ diff --git a/os/windows/posix/include/libgen.h b/os/windows/posix/include/libgen.h index 9d97c25..5c4fb23 100644 --- a/os/windows/posix/include/libgen.h +++ b/os/windows/posix/include/libgen.h @@ -1,6 +1,6 @@ -#ifndef LIBGEN_H -#define LIBGEN_H - -char *basename(char *path); - -#endif /* LIBGEN_H */ +#ifndef LIBGEN_H +#define LIBGEN_H + +char *basename(char *path); + +#endif /* LIBGEN_H */ diff --git a/os/windows/posix/include/netdb.h b/os/windows/posix/include/netdb.h index 237288b..5dace16 100644 --- a/os/windows/posix/include/netdb.h +++ b/os/windows/posix/include/netdb.h @@ -1,4 +1,4 @@ -#ifndef NETDB_H -#define NETDB_H - -#endif /* NETDB_H */ +#ifndef NETDB_H +#define NETDB_H + +#endif /* NETDB_H */ diff --git a/os/windows/posix/include/netinet/in.h b/os/windows/posix/include/netinet/in.h index 814a30e..b58c209 100644 --- a/os/windows/posix/include/netinet/in.h +++ b/os/windows/posix/include/netinet/in.h @@ -1,21 +1,21 @@ -#ifndef NETINET_IN_H -#define NETINET_IN_H - -#include <inttypes.h> -#include <sys/un.h> - -struct in6_addr -{ - uint8_t s6_addr[16]; -}; - -struct sockaddr_in6 -{ - sa_family_t sin6_family; /* AF_INET6 */ - in_port_t sin6_port; /* Port number */ - uint32_t sin6_flowinfo; /* IPv6 traffic class and flow information */ - struct in6_addr sin6_addr; /* IPv6 address */ - uint32_t sin6_scope_id; /* Set of interfaces for a scope */ -}; - -#endif /* NETINET_IN_H */ +#ifndef NETINET_IN_H +#define NETINET_IN_H + +#include <inttypes.h> +#include <sys/un.h> + +struct in6_addr +{ + uint8_t s6_addr[16]; +}; + +struct sockaddr_in6 +{ + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* Port number */ + uint32_t sin6_flowinfo; /* IPv6 traffic class and flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + uint32_t sin6_scope_id; /* Set of interfaces for a scope */ +}; + +#endif /* NETINET_IN_H */ diff --git a/os/windows/posix/include/poll.h b/os/windows/posix/include/poll.h index f5c47e7..058e23a 100644 --- a/os/windows/posix/include/poll.h +++ b/os/windows/posix/include/poll.h @@ -1,4 +1,4 @@ -#ifndef POLL_H -#define POLL_H - -#endif /* POLL_H */ +#ifndef POLL_H +#define POLL_H + +#endif /* POLL_H */ diff --git a/os/windows/posix/include/semaphore.h b/os/windows/posix/include/semaphore.h index d58f899..39cd624 100644 --- a/os/windows/posix/include/semaphore.h +++ b/os/windows/posix/include/semaphore.h @@ -1,4 +1,4 @@ -#ifndef SEMAPHORE_H -#define SEMAPHORE_H - -#endif /* SEMAPHORE_H */ +#ifndef SEMAPHORE_H +#define SEMAPHORE_H + +#endif /* SEMAPHORE_H */ diff --git a/os/windows/posix/include/sys/ipc.h b/os/windows/posix/include/sys/ipc.h index 2601a53..abf26e8 100644 --- a/os/windows/posix/include/sys/ipc.h +++ b/os/windows/posix/include/sys/ipc.h @@ -1,4 +1,4 @@ -#ifndef SYS_IPC_H -#define SYS_IPC_H - -#endif /* SYS_IPC_H */ +#ifndef SYS_IPC_H +#define SYS_IPC_H + +#endif /* SYS_IPC_H */ diff --git a/os/windows/posix/include/sys/mman.h b/os/windows/posix/include/sys/mman.h index ea139ee..8edd9fc 100644 --- a/os/windows/posix/include/sys/mman.h +++ b/os/windows/posix/include/sys/mman.h @@ -1,36 +1,36 @@ -#ifndef SYS_MMAN_H -#define SYS_MMAN_H - -#include <sys/types.h> - -#define PROT_NONE 0x1 -#define PROT_READ 0x2 -#define PROT_WRITE 0x4 - -#define MAP_ANON 0x1 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_FIXED 0x2 -#define MAP_HASSEMAPHORE 0x4 -#define MAP_INHERIT 0x8 -#define MAP_NOCORE 0x10 -#define MAP_NOSYNC 0x20 -#define MAP_PREFAULT_READ 0x40 -#define MAP_PRIVATE 0x80 -#define MAP_SHARED 0x100 -#define MAP_STACK 0x200 - -#define MAP_FAILED NULL - -#define MS_ASYNC 0x1 -#define MS_SYNC 0x2 -#define MS_INVALIDATE 0x3 - -int posix_madvise(void *addr, size_t len, int advice); -void *mmap(void *addr, size_t len, int prot, int flags, - int fildes, off_t off); -int munmap(void *addr, size_t len); -int msync(void *addr, size_t len, int flags); -int munlock(const void * addr, size_t len); -int mlock(const void *addr, size_t len); - -#endif /* SYS_MMAN_H */ +#ifndef SYS_MMAN_H +#define SYS_MMAN_H + +#include <sys/types.h> + +#define PROT_NONE 0x1 +#define PROT_READ 0x2 +#define PROT_WRITE 0x4 + +#define MAP_ANON 0x1 +#define MAP_ANONYMOUS MAP_ANON +#define MAP_FIXED 0x2 +#define MAP_HASSEMAPHORE 0x4 +#define MAP_INHERIT 0x8 +#define MAP_NOCORE 0x10 +#define MAP_NOSYNC 0x20 +#define MAP_PREFAULT_READ 0x40 +#define MAP_PRIVATE 0x80 +#define MAP_SHARED 0x100 +#define MAP_STACK 0x200 + +#define MAP_FAILED NULL + +#define MS_ASYNC 0x1 +#define MS_SYNC 0x2 +#define MS_INVALIDATE 0x3 + +int posix_madvise(void *addr, size_t len, int advice); +void *mmap(void *addr, size_t len, int prot, int flags, + int fildes, off_t off); +int munmap(void *addr, size_t len); +int msync(void *addr, size_t len, int flags); +int munlock(const void * addr, size_t len); +int mlock(const void *addr, size_t len); + +#endif /* SYS_MMAN_H */ diff --git a/os/windows/posix/include/sys/poll.h b/os/windows/posix/include/sys/poll.h index e1626b2..f009d6e 100644 --- a/os/windows/posix/include/sys/poll.h +++ b/os/windows/posix/include/sys/poll.h @@ -1,15 +1,15 @@ -#ifndef SYS_POLL_H -#define SYS_POLL_H - -typedef int nfds_t; - -struct pollfd -{ - int fd; - short events; - short revents; -}; - -int poll(struct pollfd fds[], nfds_t nfds, int timeout); - -#endif /* SYS_POLL_H */ +#ifndef SYS_POLL_H +#define SYS_POLL_H + +typedef int nfds_t; + +struct pollfd +{ + int fd; + short events; + short revents; +}; + +int poll(struct pollfd fds[], nfds_t nfds, int timeout); + +#endif /* SYS_POLL_H */ diff --git a/os/windows/posix/include/sys/resource.h b/os/windows/posix/include/sys/resource.h index fd46b28..aa95705 100644 --- a/os/windows/posix/include/sys/resource.h +++ b/os/windows/posix/include/sys/resource.h @@ -1,19 +1,19 @@ -#ifndef SYS_RESOURCE_H -#define SYS_RESOURCE_H - -#define RUSAGE_SELF 0 -#define RUSAGE_THREAD 1 - -struct rusage -{ - struct timeval ru_utime; - struct timeval ru_stime; - int ru_nvcsw; - int ru_minflt; - int ru_majflt; - int ru_nivcsw; -}; - -int getrusage(int who, struct rusage *r_usage); - -#endif /* SYS_RESOURCE_H */ +#ifndef SYS_RESOURCE_H +#define SYS_RESOURCE_H + +#define RUSAGE_SELF 0 +#define RUSAGE_THREAD 1 + +struct rusage +{ + struct timeval ru_utime; + struct timeval ru_stime; + int ru_nvcsw; + int ru_minflt; + int ru_majflt; + int ru_nivcsw; +}; + +int getrusage(int who, struct rusage *r_usage); + +#endif /* SYS_RESOURCE_H */ diff --git a/os/windows/posix/include/sys/shm.h b/os/windows/posix/include/sys/shm.h index 6ed5957..c059274 100644 --- a/os/windows/posix/include/sys/shm.h +++ b/os/windows/posix/include/sys/shm.h @@ -1,41 +1,41 @@ -#ifndef SYS_SHM_H -#define SYS_SHM_H - -#define IPC_RMID 0x1 -#define IPC_CREAT 0x2 -#define IPC_PRIVATE 0x4 - -typedef int uid_t; -typedef int gid_t; - -typedef int shmatt_t; -typedef int key_t; - -struct ipc_perm -{ - uid_t uid; /* owner's user ID */ - gid_t gid; /* owner's group ID */ - uid_t cuid; /* creator's user ID */ - gid_t cgid; /* creator's group ID */ - mode_t mode; /* read/write permission */ -}; - - -struct shmid_ds -{ - struct ipc_perm shm_perm; /* operation permission structure */ - size_t shm_segsz; /* size of segment in bytes */ - pid_t shm_lpid; /* process ID of last shared memory operation */ - pid_t shm_cpid; /* process ID of creator */ - shmatt_t shm_nattch; /* number of current attaches */ - time_t shm_atime; /* time of last shmat() */ - time_t shm_dtime; /* time of last shmdt() */ - time_t shm_ctime; /* time of last change by shmctl() */ -}; - -int shmctl(int shmid, int cmd, struct shmid_ds *buf); -int shmget(key_t key, size_t size, int shmflg); -void *shmat(int shmid, const void *shmaddr, int shmflg); -int shmdt(const void *shmaddr); - -#endif /* SYS_SHM_H */ +#ifndef SYS_SHM_H +#define SYS_SHM_H + +#define IPC_RMID 0x1 +#define IPC_CREAT 0x2 +#define IPC_PRIVATE 0x4 + +typedef int uid_t; +typedef int gid_t; + +typedef int shmatt_t; +typedef int key_t; + +struct ipc_perm +{ + uid_t uid; /* owner's user ID */ + gid_t gid; /* owner's group ID */ + uid_t cuid; /* creator's user ID */ + gid_t cgid; /* creator's group ID */ + mode_t mode; /* read/write permission */ +}; + + +struct shmid_ds +{ + struct ipc_perm shm_perm; /* operation permission structure */ + size_t shm_segsz; /* size of segment in bytes */ + pid_t shm_lpid; /* process ID of last shared memory operation */ + pid_t shm_cpid; /* process ID of creator */ + shmatt_t shm_nattch; /* number of current attaches */ + time_t shm_atime; /* time of last shmat() */ + time_t shm_dtime; /* time of last shmdt() */ + time_t shm_ctime; /* time of last change by shmctl() */ +}; + +int shmctl(int shmid, int cmd, struct shmid_ds *buf); +int shmget(key_t key, size_t size, int shmflg); +void *shmat(int shmid, const void *shmaddr, int shmflg); +int shmdt(const void *shmaddr); + +#endif /* SYS_SHM_H */ diff --git a/os/windows/posix/include/sys/socket.h b/os/windows/posix/include/sys/socket.h index eef3b45..4da6f2f 100644 --- a/os/windows/posix/include/sys/socket.h +++ b/os/windows/posix/include/sys/socket.h @@ -1,4 +1,4 @@ -#ifndef SYS_SOCKET_H -#define SYS_SOCKET_H - -#endif /* SYS_SOCKET_H */ +#ifndef SYS_SOCKET_H +#define SYS_SOCKET_H + +#endif /* SYS_SOCKET_H */ diff --git a/os/windows/posix/include/sys/uio.h b/os/windows/posix/include/sys/uio.h index 077550c..25f83d6 100644 --- a/os/windows/posix/include/sys/uio.h +++ b/os/windows/posix/include/sys/uio.h @@ -1,16 +1,16 @@ -#ifndef SYS_UIO_H -#define SYS_UIO_H - -#include <inttypes.h> -#include <unistd.h> - - struct iovec - { - void *iov_base; /* Base address of a memory region for input or output */ - size_t iov_len; /* The size of the memory pointed to by iov_base */ -}; - - ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); - ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); - -#endif /* SYS_UIO_H */ +#ifndef SYS_UIO_H +#define SYS_UIO_H + +#include <inttypes.h> +#include <unistd.h> + + struct iovec + { + void *iov_base; /* Base address of a memory region for input or output */ + size_t iov_len; /* The size of the memory pointed to by iov_base */ +}; + + ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); + ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); + +#endif /* SYS_UIO_H */ diff --git a/os/windows/posix/include/sys/un.h b/os/windows/posix/include/sys/un.h index 64e57a5..b9ea630 100644 --- a/os/windows/posix/include/sys/un.h +++ b/os/windows/posix/include/sys/un.h @@ -1,13 +1,13 @@ -#ifndef SYS_UN_H -#define SYS_UN_H - -typedef int sa_family_t; -typedef int in_port_t; - - struct sockaddr_un - { - sa_family_t sun_family; /* Address family */ - char sun_path[]; /* Socket pathname */ -}; - -#endif /* SYS_UN_H */ +#ifndef SYS_UN_H +#define SYS_UN_H + +typedef int sa_family_t; +typedef int in_port_t; + + struct sockaddr_un + { + sa_family_t sun_family; /* Address family */ + char sun_path[]; /* Socket pathname */ +}; + +#endif /* SYS_UN_H */ diff --git a/os/windows/posix/include/sys/wait.h b/os/windows/posix/include/sys/wait.h index 9e68d54..5b8fd3a 100644 --- a/os/windows/posix/include/sys/wait.h +++ b/os/windows/posix/include/sys/wait.h @@ -1,12 +1,12 @@ -#ifndef SYS_WAIT_H -#define SYS_WAIT_H - -#define WIFSIGNALED(a) 0 -#define WIFEXITED(a) 0 -#define WTERMSIG(a) 0 -#define WEXITSTATUS(a) 0 -#define WNOHANG 0 - -pid_t waitpid(pid_t, int *stat_loc, int options); - -#endif /* SYS_WAIT_H */ +#ifndef SYS_WAIT_H +#define SYS_WAIT_H + +#define WIFSIGNALED(a) 0 +#define WIFEXITED(a) 0 +#define WTERMSIG(a) 0 +#define WEXITSTATUS(a) 0 +#define WNOHANG 0 + +pid_t waitpid(pid_t, int *stat_loc, int options); + +#endif /* SYS_WAIT_H */ diff --git a/os/windows/posix/include/syslog.h b/os/windows/posix/include/syslog.h index 172261c..b8582e9 100644 --- a/os/windows/posix/include/syslog.h +++ b/os/windows/posix/include/syslog.h @@ -1,18 +1,18 @@ -#ifndef SYSLOG_H -#define SYSLOG_H - -int syslog(); - -#define LOG_INFO 0x1 -#define LOG_ERROR 0x2 -#define LOG_WARN 0x4 - -#define LOG_NDELAY 0x1 -#define LOG_NOWAIT 0x2 -#define LOG_PID 0x4 -#define LOG_USER 0x8 - -void closelog(void); -void openlog(const char *ident, int logopt, int facility); - -#endif /* SYSLOG_H */ +#ifndef SYSLOG_H +#define SYSLOG_H + +int syslog(); + +#define LOG_INFO 0x1 +#define LOG_ERROR 0x2 +#define LOG_WARN 0x4 + +#define LOG_NDELAY 0x1 +#define LOG_NOWAIT 0x2 +#define LOG_PID 0x4 +#define LOG_USER 0x8 + +void closelog(void); +void openlog(const char *ident, int logopt, int facility); + +#endif /* SYSLOG_H */ diff --git a/stat.c b/stat.c index 8835f7f..c3d3c4a 100644 --- a/stat.c +++ b/stat.c @@ -1322,10 +1322,10 @@ void show_run_stats(void) if (is_backend) fio_server_send_du(); - else if (output_format == FIO_OUTPUT_NORMAL) + else if (output_format == FIO_OUTPUT_NORMAL) { show_disk_util(0, NULL); - - show_idle_prof_stats(FIO_OUTPUT_NORMAL, NULL); + show_idle_prof_stats(FIO_OUTPUT_NORMAL, NULL); + } free(runstats); free(threadstats); diff --git a/t/axmap.c b/t/axmap.c index 27fdaa7..61e3220 100644 --- a/t/axmap.c +++ b/t/axmap.c @@ -45,7 +45,15 @@ int main(int argc, char *argv[]) printf("lfsr: short loop\n"); break; } + if (axmap_isset(map, val)) { + printf("bit already set\n"); + break; + } axmap_set(map, val); + if (!axmap_isset(map, val)) { + printf("bit not set\n"); + break; + } } ff = axmap_next_free(map, osize); -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html