1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2c426bba0SHitoshi Mitake #ifndef BENCH_H 3c426bba0SHitoshi Mitake #define BENCH_H 4c426bba0SHitoshi Mitake 5d1398ccfSVinson Lee /* 6d1398ccfSVinson Lee * The madvise transparent hugepage constants were added in glibc 7d1398ccfSVinson Lee * 2.13. For compatibility with older versions of glibc, define these 8d1398ccfSVinson Lee * tokens if they are not already defined. 9d1398ccfSVinson Lee * 10d1398ccfSVinson Lee * PA-RISC uses different madvise values from other architectures and 11d1398ccfSVinson Lee * needs to be special-cased. 12d1398ccfSVinson Lee */ 13d1398ccfSVinson Lee #ifdef __hppa__ 14d1398ccfSVinson Lee # ifndef MADV_HUGEPAGE 15d1398ccfSVinson Lee # define MADV_HUGEPAGE 67 16d1398ccfSVinson Lee # endif 17d1398ccfSVinson Lee # ifndef MADV_NOHUGEPAGE 18d1398ccfSVinson Lee # define MADV_NOHUGEPAGE 68 19d1398ccfSVinson Lee # endif 20d1398ccfSVinson Lee #else 21d1398ccfSVinson Lee # ifndef MADV_HUGEPAGE 22d1398ccfSVinson Lee # define MADV_HUGEPAGE 14 23d1398ccfSVinson Lee # endif 24d1398ccfSVinson Lee # ifndef MADV_NOHUGEPAGE 25d1398ccfSVinson Lee # define MADV_NOHUGEPAGE 15 26d1398ccfSVinson Lee # endif 27d1398ccfSVinson Lee #endif 28d1398ccfSVinson Lee 29b0ad8ea6SArnaldo Carvalho de Melo int bench_numa(int argc, const char **argv); 30b0ad8ea6SArnaldo Carvalho de Melo int bench_sched_messaging(int argc, const char **argv); 31b0ad8ea6SArnaldo Carvalho de Melo int bench_sched_pipe(int argc, const char **argv); 32b0ad8ea6SArnaldo Carvalho de Melo int bench_mem_memcpy(int argc, const char **argv); 33b0ad8ea6SArnaldo Carvalho de Melo int bench_mem_memset(int argc, const char **argv); 34b0ad8ea6SArnaldo Carvalho de Melo int bench_futex_hash(int argc, const char **argv); 35b0ad8ea6SArnaldo Carvalho de Melo int bench_futex_wake(int argc, const char **argv); 36b0ad8ea6SArnaldo Carvalho de Melo int bench_futex_wake_parallel(int argc, const char **argv); 37b0ad8ea6SArnaldo Carvalho de Melo int bench_futex_requeue(int argc, const char **argv); 38d2f3f5d2SDavidlohr Bueso /* pi futexes */ 39b0ad8ea6SArnaldo Carvalho de Melo int bench_futex_lock_pi(int argc, const char **argv); 40c426bba0SHitoshi Mitake 41242aa14aSHitoshi Mitake #define BENCH_FORMAT_DEFAULT_STR "default" 42242aa14aSHitoshi Mitake #define BENCH_FORMAT_DEFAULT 0 43242aa14aSHitoshi Mitake #define BENCH_FORMAT_SIMPLE_STR "simple" 44242aa14aSHitoshi Mitake #define BENCH_FORMAT_SIMPLE 1 45242aa14aSHitoshi Mitake 46242aa14aSHitoshi Mitake #define BENCH_FORMAT_UNKNOWN -1 47242aa14aSHitoshi Mitake 48242aa14aSHitoshi Mitake extern int bench_format; 49b6f0629aSDavidlohr Bueso extern unsigned int bench_repeat; 50242aa14aSHitoshi Mitake 51c426bba0SHitoshi Mitake #endif 52