Rom Lemarchand | de3942a | 2014-11-10 10:32:49 -0800 | [diff] [blame] | 1 | #include <unistd.h> |
| 2 | #include <stdbool.h> |
| 3 | |
| 4 | #ifndef __PAGINGTEST_H__ |
| 5 | #define __PAGINGTEST_H__ |
| 6 | #define USEC_PER_SEC 1000000ULL |
| 7 | #define mincore_vec_len(size) (((size) + sysconf(_SC_PAGE_SIZE) - 1) / sysconf(_SC_PAGE_SIZE)) |
| 8 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a))) |
| 9 | |
| 10 | //Helpers |
| 11 | int create_tmp_file(char *filename, off_t size); |
| 12 | unsigned char *alloc_mincore_vec(size_t size); |
| 13 | bool check_caching(void *buf, unsigned char *vec, size_t size, bool is_cached); |
| 14 | |
| 15 | //Tests |
| 16 | int mmap_test(int test_runs, unsigned long long alloc_size); |
Rom Lemarchand | f63f120 | 2016-05-17 10:10:18 -0700 | [diff] [blame] | 17 | int pageinout_test(int test_runs, bool cache, unsigned long long file_size); |
| 18 | int thrashing_test(int test_runs, bool cache); |
Rom Lemarchand | de3942a | 2014-11-10 10:32:49 -0800 | [diff] [blame] | 19 | |
| 20 | #endif //__PAGINGTEST_H__ |