bench.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef BENCH_H
  2. #define BENCH_H
  3. /*
  4. * The madvise transparent hugepage constants were added in glibc
  5. * 2.13. For compatibility with older versions of glibc, define these
  6. * tokens if they are not already defined.
  7. *
  8. * PA-RISC uses different madvise values from other architectures and
  9. * needs to be special-cased.
  10. */
  11. #ifdef __hppa__
  12. # ifndef MADV_HUGEPAGE
  13. # define MADV_HUGEPAGE 67
  14. # endif
  15. # ifndef MADV_NOHUGEPAGE
  16. # define MADV_NOHUGEPAGE 68
  17. # endif
  18. #else
  19. # ifndef MADV_HUGEPAGE
  20. # define MADV_HUGEPAGE 14
  21. # endif
  22. # ifndef MADV_NOHUGEPAGE
  23. # define MADV_NOHUGEPAGE 15
  24. # endif
  25. #endif
  26. int bench_numa(int argc, const char **argv, const char *prefix);
  27. int bench_sched_messaging(int argc, const char **argv, const char *prefix);
  28. int bench_sched_pipe(int argc, const char **argv, const char *prefix);
  29. int bench_mem_memcpy(int argc, const char **argv, const char *prefix);
  30. int bench_mem_memset(int argc, const char **argv, const char *prefix);
  31. int bench_futex_hash(int argc, const char **argv, const char *prefix);
  32. int bench_futex_wake(int argc, const char **argv, const char *prefix);
  33. int bench_futex_wake_parallel(int argc, const char **argv, const char *prefix);
  34. int bench_futex_requeue(int argc, const char **argv, const char *prefix);
  35. /* pi futexes */
  36. int bench_futex_lock_pi(int argc, const char **argv, const char *prefix);
  37. #define BENCH_FORMAT_DEFAULT_STR "default"
  38. #define BENCH_FORMAT_DEFAULT 0
  39. #define BENCH_FORMAT_SIMPLE_STR "simple"
  40. #define BENCH_FORMAT_SIMPLE 1
  41. #define BENCH_FORMAT_UNKNOWN -1
  42. extern int bench_format;
  43. extern unsigned int bench_repeat;
  44. #endif