Commit | Line | Data |
---|---|---|
5f350952 JA |
1 | #include "../fio.h" |
2 | #include "../os.h" | |
2866c82d | 3 | |
ea2877a4 JA |
4 | static int fio_cpuio_setup(struct thread_data fio_unused *td) |
5 | { | |
6 | return 0; | |
7 | } | |
8 | ||
2866c82d JA |
9 | static int fio_cpuio_init(struct thread_data *td) |
10 | { | |
11 | if (!td->cpuload) { | |
12 | td_vmsg(td, EINVAL, "cpu thread needs rate"); | |
13 | return 1; | |
14 | } else if (td->cpuload > 100) | |
15 | td->cpuload = 100; | |
16 | ||
53cdc686 | 17 | td->nr_files = 0; |
2866c82d JA |
18 | |
19 | return 0; | |
20 | } | |
21 | ||
5f350952 | 22 | static struct ioengine_ops ioengine = { |
2866c82d JA |
23 | .name = "cpuio", |
24 | .version = FIO_IOOPS_VERSION, | |
25 | .init = fio_cpuio_init, | |
ea2877a4 | 26 | .setup = fio_cpuio_setup, |
4d9345ae | 27 | .flags = FIO_CPUIO | FIO_NULLIO, |
2866c82d | 28 | }; |
5f350952 JA |
29 | |
30 | static void fio_init fio_cpuio_register(void) | |
31 | { | |
32 | register_ioengine(&ioengine); | |
33 | } | |
34 | ||
35 | static void fio_exit fio_cpuio_unregister(void) | |
36 | { | |
37 | unregister_ioengine(&ioengine); | |
38 | } |