2 * fio - the flexible io tester
4 * Copyright (C) 2005 Jens Axboe <axboe@suse.de>
5 * Copyright (C) 2006-2012 Jens Axboe <axboe@kernel.dk>
7 * The license below covers all files distributed with fio unless otherwise
8 * noted in the file itself.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
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.
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
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 unsigned long page_mask;
52 unsigned long page_size;
55 unsigned int thread_number = 0;
56 unsigned int nr_process = 0;
57 unsigned int nr_thread = 0;
60 unsigned long done_secs = 0;
63 * Just expose an empty list, if the OS does not support disk util stats
65 #ifndef FIO_HAVE_DISK_UTIL
66 FLIST_HEAD(disk_list);
69 unsigned long arch_flags = 0;
71 static int endian_check(void)
82 else if (u.c[0] == 0x12)
85 #if defined(FIO_LITTLE_ENDIAN)
88 #elif defined(FIO_BIG_ENDIAN)
101 int main(int argc, char *argv[], char *envp[])
105 if (endian_check()) {
106 log_err("fio: endianness settings appear wrong.\n");
107 log_err("fio: please report this to fio@vger.kernel.org\n");
116 * We need locale for number printing, if it isn't set then just
117 * go with the US format.
119 if (!getenv("LC_NUMERIC"))
120 setlocale(LC_NUMERIC, "en_US");
122 ps = sysconf(_SC_PAGESIZE);
124 log_err("Failed to get page size\n");
133 if (parse_options(argc, argv))
137 return fio_handle_clients();
139 return fio_backend();