t/nvmept_trim: increase transfer size for some tests
[fio.git] / fio.c
CommitLineData
ebac4655
JA
1/*
2 * fio - the flexible io tester
3 *
4 * Copyright (C) 2005 Jens Axboe <axboe@suse.de>
2e1df07d 5 * Copyright (C) 2006-2012 Jens Axboe <axboe@kernel.dk>
ebac4655 6 *
8e9fe637
JA
7 * The license below covers all files distributed with fio unless otherwise
8 * noted in the file itself.
9 *
ebac4655 10 * This program is free software; you can redistribute it and/or modify
8e9fe637
JA
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
ebac4655
JA
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
fa07eaa6 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
ebac4655
JA
22 *
23 */
ebac4655 24#include "fio.h"
d529ee19 25
50d16976
JA
26int main(int argc, char *argv[], char *envp[])
27{
af1dc266
JA
28 int ret = 1;
29
480b8112 30 if (initialize_fio(envp))
0ad5edcc 31 return 1;
50d16976 32
67bf9823
JA
33#if !defined(CONFIG_GETTIMEOFDAY) && !defined(CONFIG_CLOCK_GETTIME)
34#error "No available clock source!"
35#endif
36
3d80c735
JA
37 if (fio_server_create_sk_key())
38 goto done;
39
50d16976 40 if (parse_options(argc, argv))
518a1cf0 41 goto done_key;
50d16976 42
18dc4295
KD
43 /*
44 * line buffer stdout to avoid output lines from multiple
45 * threads getting mixed
46 */
47 setvbuf(stdout, NULL, _IOLBF, 0);
48
fa80feae
JA
49 fio_time_init();
50
b9d2f30a 51 if (nr_clients) {
91c0e7c5
JA
52 set_genesis_time();
53
b9d2f30a 54 if (fio_start_all_clients())
518a1cf0 55 goto done_key;
af1dc266 56 ret = fio_handle_clients(&fio_client_ops);
b9d2f30a 57 } else
2a2804c9 58 ret = fio_backend(NULL);
af1dc266 59
518a1cf0
JA
60done_key:
61 fio_server_destroy_sk_key();
af1dc266
JA
62done:
63 deinitialize_fio();
64 return ret;
50d16976 65}