]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/perf_index/stress_file_local.c
d948caf1ae269dc4233177d525579d9b1dd0165c
[apple/xnu.git] / tools / tests / perf_index / stress_file_local.c
1 #include <fcntl.h>
2 #include "perf_index.h"
3 #include <errno.h>
4
5
6 const stress_test_t file_local_create_test = {"file_create", &stress_file_local_create_init, &stress_file_local_create, &stress_file_local_create_cleanup, &no_validate};
7 const stress_test_t file_local_write_test = {"file_write", &stress_file_local_write_init, &stress_file_local_write, &stress_file_local_write_cleanup, &no_validate};
8 const stress_test_t file_local_read_test = {"file_read", &stress_file_local_read_init, &stress_file_local_read, &stress_file_local_read_cleanup, &no_validate};
9
10 static char fs_path[MAXPATHLEN];
11
12 static void setup_local_volume(void) {
13 snprintf(fs_path, MAXPATHLEN, "%s", "/tmp");
14 }
15
16 DECL_INIT(stress_file_local_read_init) {
17 setup_local_volume();
18 stress_file_read_init(fs_path, num_threads, length, 0L);
19 }
20
21 DECL_TEST(stress_file_local_read) {
22 stress_file_read(fs_path, thread_id, num_threads, length, 0L);
23 }
24
25 DECL_CLEANUP(stress_file_local_read_cleanup) {
26 stress_file_read_cleanup(fs_path, num_threads, length);
27 }
28
29 DECL_INIT(stress_file_local_write_init) {
30 setup_local_volume();
31 stress_file_write_init(fs_path, num_threads, length);
32 }
33
34 DECL_TEST(stress_file_local_write) {
35 stress_file_write(fs_path, thread_id, num_threads, length, 0L);
36 }
37
38 DECL_CLEANUP(stress_file_local_write_cleanup) {
39 }
40
41 DECL_INIT(stress_file_local_create_init) {
42 setup_local_volume();
43 }
44
45 DECL_TEST(stress_file_local_create) {
46 stress_file_create(fs_path, thread_id, num_threads, length);
47 }
48
49 DECL_CLEANUP(stress_file_local_create_cleanup) {
50 }