bench.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. extern int bench_numa(int argc, const char **argv, const char *prefix);
  27. extern int bench_sched_messaging(int argc, const char **argv, const char *prefix);
  28. extern int bench_sched_pipe(int argc, const char **argv, const char *prefix);
  29. extern int bench_mem_memcpy(int argc, const char **argv,
  30. const char *prefix __maybe_unused);
  31. extern int bench_mem_memset(int argc, const char **argv, const char *prefix);
  32. extern int bench_futex_hash(int argc, const char **argv, const char *prefix);
  33. extern int bench_futex_wake(int argc, const char **argv, const char *prefix);
  34. extern int bench_futex_wake_parallel(int argc, const char **argv,
  35. const char *prefix);
  36. extern int bench_futex_requeue(int argc, const char **argv, const char *prefix);
  37. /* pi futexes */
  38. extern int bench_futex_lock_pi(int argc, const char **argv, const char *prefix);
  39. #define BENCH_FORMAT_DEFAULT_STR "default"
  40. #define BENCH_FORMAT_DEFAULT 0
  41. #define BENCH_FORMAT_SIMPLE_STR "simple"
  42. #define BENCH_FORMAT_SIMPLE 1
  43. #define BENCH_FORMAT_UNKNOWN -1
  44. extern int bench_format;
  45. extern unsigned int bench_repeat;
  46. #endif