• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Disktest
3 * Copyright (c) International Business Machines Corp., 2001
4 *
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 *
20 *  Please send e-mail to yardleyb@us.ibm.com if you have
21 *  questions or comments.
22 *
23 *  Project Website:  TBD
24 *
25 *
26 * $Id: sfunc.h,v 1.5 2008/02/14 08:22:23 subrata_modak Exp $
27 * $Log: sfunc.h,v $
28 * Revision 1.5  2008/02/14 08:22:23  subrata_modak
29 * Disktest application update to version 1.4.2, by, Brent Yardley <yardleyb@us.ibm.com>
30 *
31 * Revision 1.13  2005/10/12 23:13:35  yardleyb
32 * Updates to code to support new function in disktest version 1.3.x.
33 * Actual changes are recorded in the README
34 *
35 * Revision 1.12  2005/05/03 16:24:38  yardleyb
36 * Added needed code changes to support windows
37 *
38 * Revision 1.11  2005/01/08 21:18:34  yardleyb
39 * Update performance output and usage.  Fixed pass count check
40 *
41 * Revision 1.10  2004/11/02 20:47:13  yardleyb
42 * Added -F functions.
43 * lots of minor fixes. see README
44 *
45 * Revision 1.9  2002/03/30 01:32:14  yardleyb
46 * Major Changes:
47 *
48 * Added Dumping routines for
49 * data miscompares,
50 *
51 * Updated performance output
52 * based on command line.  Gave
53 * one decimal in MB/s output.
54 *
55 * Rewrote -pL IO routine to show
56 * correct stats.  Now show pass count
57 * when using -C.
58 *
59 * Minor Changes:
60 *
61 * Code cleanup to remove the plethera
62 * if #ifdef for windows/unix functional
63 * differences.
64 *
65 * Revision 1.8  2002/02/28 02:04:32  yardleyb
66 * Moved FileSeek64 to IO
67 * source files.
68 *
69 * Revision 1.7  2002/02/19 02:46:37  yardleyb
70 * Added changes to compile for AIX.
71 * Update getvsiz so it returns a -1
72 * if the ioctl fails and we handle
73 * that fact correctly.  Added check
74 * to force vsiz to always be greater
75 * then stop_lba.
76 *
77 * Revision 1.6  2001/12/04 18:51:06  yardleyb
78 * Checkin of new source files and removal
79 * of outdated source
80 *
81 * Revision 1.4  2001/10/10 00:17:14  yardleyb
82 * Added Copyright and GPL license text.
83 * Miner bug fixes throughout text.
84 *
85 * Revision 1.3  2001/09/22 03:44:25  yardleyb
86 * Added level code pMsg.
87 *
88 * Revision 1.2  2001/09/06 18:23:30  yardleyb
89 * Added duty cycle -D.  Updated usage. Added
90 * make option to create .tar.gz of all files
91 *
92 * Revision 1.1  2001/09/05 22:44:42  yardleyb
93 * Split out some of the special functions.
94 * added O_DIRECT -Id.  Updated usage.  Lots
95 * of clean up to functions.  Added header info
96 * to pMsg.
97 *
98 *
99 */
100 
101 #ifndef _SFUNC_H
102 #define _SFUNC_H 1
103 
104 #include <stdarg.h>
105 
106 #include "main.h"
107 #include "defs.h"
108 
109 typedef enum lvl {
110 	START, END, STAT, INFO, DBUG, WARN, ERR
111 } lvl_t;
112 
113 typedef struct fmt_time {
114 	time_t days;
115 	time_t hours;
116 	time_t minutes;
117 	time_t seconds;
118 } fmt_time_t;
119 
120 OFF_T my_strtofft(const char *pStr);
121 int pMsg(lvl_t level, const child_args_t *, char *Msg,...);
122 void fill_buffer(void *, size_t, void *, size_t, const unsigned int);
123 void mark_buffer(void *, const size_t, void *, const child_args_t *, const test_env_t *);
124 void normalize_percs(child_args_t *);
125 #ifndef WINDOWS
126 void Sleep(unsigned int);
127 char *strupr(char *);
128 char *strlwr(char *);
129 #endif
130 OFF_T get_vsiz(const char *);
131 OFF_T get_file_size(char *);
132 OFF_T Rand64(void);
133 fmt_time_t format_time(time_t);
134 
135 #endif /* _SFUNC_H */
136 
137