fio: fix cycles_start build issue
authorChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Fri, 27 Feb 2015 15:20:46 +0000 (08:20 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 27 Feb 2015 15:20:46 +0000 (08:20 -0700)
commit96170421ea0b77779faf9e14499a14910e88de33
tree1740d806316a462e7b3a38d118eec6a9be497a1b
parent9f68fe3abd9f2f9e31c681fc22d0e94b1c80cfff
fio: fix cycles_start build issue

There is an issue introduced with "commit 73df3e07 gettime: offset CPU cycle
counter by initial value". For architectures which define
ARCH_CPU_CLOCK_CYCLES_PER_USEC (currently only s390) this causes a build
error

gettime.c:174:11: error: â€˜cycles_start’ undeclared (first use in this
function)
    if (t < cycles_start && !cycles_wrap)

To make sure variables and code are only compiled in the same cases I
added a
clock definition called ARCH_CPU_CLOCK_WRAPS. We could merge
ARCH_CPU_CLOCK_WRAPS and the existing ARCH_CPU_CLOCK_CYCLES_PER_USEC
into one
if you prefer, so far nobody else uses it.

To avoid cluttering all architecture headers I enabled it by default in
arch-generic.h, so any arch not needing the wrap handling can undef
ARCH_CPU_CLOCK_WRAPS later in their headers.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
arch/arch-s390.h
arch/arch.h
gettime.c