1 #ifndef __PERF_INDEX_H_
2 #define __PERF_INDEX_H_
10 #include <sys/types.h>
12 #define DECL_VALIDATE(validatetest) int validatetest(int test_argc, const char **test_argv)
13 #define DECL_INIT(inittest) void inittest(int num_threads, long long length, int test_argc, const char **test_argv)
14 #define DECL_TEST(test) void test(int thread_id, int num_threads, long long length, int test_argc, const char **test_argv)
15 #define DECL_CLEANUP(cleanuptest) void cleanuptest(int num_threads, long long length)
17 #define MAXPATHLEN 1024
19 typedef DECL_INIT((*init_func
));
20 typedef DECL_TEST((*stress_func
));
21 typedef DECL_CLEANUP((*cleanup_func
));
22 typedef DECL_VALIDATE((*validate_func
));
29 validate_func validate
;
32 extern const stress_test_t cpu_test
;
33 extern const stress_test_t memory_test
;
34 extern const stress_test_t syscall_test
;
35 extern const stress_test_t fault_test
;
36 extern const stress_test_t zfod_test
;
37 extern const stress_test_t file_local_create_test
;
38 extern const stress_test_t file_local_write_test
;
39 extern const stress_test_t file_local_read_test
;
40 extern const stress_test_t file_ram_create_test
;
41 extern const stress_test_t file_ram_write_test
;
42 extern const stress_test_t file_ram_read_test
;
43 extern const stress_test_t iperf_test
;
44 extern const stress_test_t compile_test
;
46 DECL_VALIDATE(no_validate
);
47 DECL_VALIDATE(validate_iperf
);
49 DECL_INIT(stress_memory_init
);
50 DECL_INIT(stress_syscall_init
);
51 DECL_INIT(stress_fault_init
);
52 DECL_INIT(stress_file_local_create_init
);
53 DECL_INIT(stress_file_local_read_init
);
54 DECL_INIT(stress_file_local_write_init
);
55 DECL_INIT(stress_file_ram_create_init
);
56 DECL_INIT(stress_file_ram_read_init
);
57 DECL_INIT(stress_file_ram_write_init
);
58 DECL_INIT(compile_init
);
59 DECL_INIT(stress_general_init
);
61 DECL_TEST(stress_memory
);
62 DECL_TEST(stress_cpu
);
63 DECL_TEST(stress_syscall
);
64 DECL_TEST(stress_fault
);
65 DECL_TEST(stress_zfod
);
66 DECL_TEST(stress_file_local_create
);
67 DECL_TEST(stress_file_local_read
);
68 DECL_TEST(stress_file_local_write
);
69 DECL_TEST(stress_file_ram_create
);
70 DECL_TEST(stress_file_ram_read
);
71 DECL_TEST(stress_file_ram_write
);
74 DECL_TEST(stress_general
);
76 DECL_CLEANUP(stress_general_cleanup
);
77 DECL_CLEANUP(stress_file_local_create_cleanup
);
78 DECL_CLEANUP(stress_file_local_read_cleanup
);
79 DECL_CLEANUP(stress_file_local_write_cleanup
);
80 DECL_CLEANUP(stress_file_ram_create_cleanup
);
81 DECL_CLEANUP(stress_file_ram_read_cleanup
);
82 DECL_CLEANUP(stress_file_ram_write_cleanup
);
83 DECL_CLEANUP(compile_cleanup
);
85 void stress_file_create(const char *fs_path
, int thread_id
, int num_threads
, long long length
);
87 void stress_file_write_init(const char *fs_path
, int num_threads
, long long length
);
88 void stress_file_write(const char *fs_path
, int thread_id
, int num_threads
, long long length
, long long max_file_size
);
90 void stress_file_read_init(const char *fs_path
, int num_threads
, long long length
, long long max_file_size
);
91 void stress_file_read(const char *fs_path
, int thread_id
, int num_threads
, long long length
, long long max_file_size
);
92 void stress_file_read_cleanup(const char *fs_path
, int num_threads
, long long length
);
94 void md5_hash(uint8_t *message
, uint64_t len
, uint32_t *hash
);