bench.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #define BENCH_FORMAT_DEFAULT_STR "default"
  33. #define BENCH_FORMAT_DEFAULT 0
  34. #define BENCH_FORMAT_SIMPLE_STR "simple"
  35. #define BENCH_FORMAT_SIMPLE 1
  36. #define BENCH_FORMAT_UNKNOWN -1
  37. extern int bench_format;
  38. #endif