blob: a6f3d03fd1e8361b8e2effb98c01d765b4ab804c [file] [log] [blame]
Rom Lemarchandde3942a2014-11-10 10:32:49 -08001#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
11int create_tmp_file(char *filename, off_t size);
12unsigned char *alloc_mincore_vec(size_t size);
13bool check_caching(void *buf, unsigned char *vec, size_t size, bool is_cached);
14
15//Tests
16int mmap_test(int test_runs, unsigned long long alloc_size);
Rom Lemarchandf63f1202016-05-17 10:10:18 -070017int pageinout_test(int test_runs, bool cache, unsigned long long file_size);
18int thrashing_test(int test_runs, bool cache);
Rom Lemarchandde3942a2014-11-10 10:32:49 -080019
20#endif //__PAGINGTEST_H__