xref: /freebsd/tools/test/stress2/include/stress.h (revision 8a272653)
18a272653SPeter Holm /*-
28a272653SPeter Holm  * Copyright (c) 2008 Peter Holm <pho@FreeBSD.org>
38a272653SPeter Holm  * All rights reserved.
48a272653SPeter Holm  *
58a272653SPeter Holm  * Redistribution and use in source and binary forms, with or without
68a272653SPeter Holm  * modification, are permitted provided that the following conditions
78a272653SPeter Holm  * are met:
88a272653SPeter Holm  * 1. Redistributions of source code must retain the above copyright
98a272653SPeter Holm  *    notice, this list of conditions and the following disclaimer.
108a272653SPeter Holm  * 2. Redistributions in binary form must reproduce the above copyright
118a272653SPeter Holm  *    notice, this list of conditions and the following disclaimer in the
128a272653SPeter Holm  *    documentation and/or other materials provided with the distribution.
138a272653SPeter Holm  *
148a272653SPeter Holm  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
158a272653SPeter Holm  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
168a272653SPeter Holm  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
178a272653SPeter Holm  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
188a272653SPeter Holm  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
198a272653SPeter Holm  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
208a272653SPeter Holm  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
218a272653SPeter Holm  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
228a272653SPeter Holm  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
238a272653SPeter Holm  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
248a272653SPeter Holm  * SUCH DAMAGE.
258a272653SPeter Holm  */
268a272653SPeter Holm 
278a272653SPeter Holm #ifndef _STRESS_H_
288a272653SPeter Holm #define _STRESS_H_
298a272653SPeter Holm extern int setup(int);
308a272653SPeter Holm extern int test(void);
318a272653SPeter Holm extern void cleanup(void);
328a272653SPeter Holm extern void options(int, char **);
338a272653SPeter Holm extern int random_int(int, int);
348a272653SPeter Holm /*extern void limits(void);*/
358a272653SPeter Holm 
368a272653SPeter Holm typedef struct {
378a272653SPeter Holm 	int argc;
388a272653SPeter Holm 	char **argv;
398a272653SPeter Holm 	int run_time;
408a272653SPeter Holm 	int load;
418a272653SPeter Holm 	char *wd;
428a272653SPeter Holm 	char *cd;
438a272653SPeter Holm 	int verbose;
448a272653SPeter Holm 	int incarnations;
458a272653SPeter Holm 	int hog;
468a272653SPeter Holm 	int nodelay;
478a272653SPeter Holm 	int kill;
488a272653SPeter Holm 	int64_t kblocks;
498a272653SPeter Holm 	int64_t inodes;
508a272653SPeter Holm } opt_t;
518a272653SPeter Holm 
528a272653SPeter Holm extern opt_t *op;
538a272653SPeter Holm 
548a272653SPeter Holm extern volatile int done_testing;
558a272653SPeter Holm extern char *home;
568a272653SPeter Holm extern void rmval(void);
578a272653SPeter Holm extern void putval(unsigned long);
588a272653SPeter Holm extern unsigned long getval(void);
598a272653SPeter Holm extern void getdf(int64_t *, int64_t *);
608a272653SPeter Holm extern void reservedf(int64_t, int64_t);
618a272653SPeter Holm extern void show_status(void);
628a272653SPeter Holm extern int64_t swap(void);
638a272653SPeter Holm extern unsigned long usermem(void);
648a272653SPeter Holm #endif
65