2 static char sfs_c_datSid[] = "@(#)sfs_c_dat.c 2.1 97/10/23";
6 * Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
8 * Standard Performance Evaluation Corporation (SPEC)
9 * 6585 Merchant Place, Suite 100
12 * This product contains benchmarks acquired from several sources who
13 * understand and agree with SPEC's goal of creating fair and objective
14 * benchmarks to measure computer performance.
16 * This copyright notice is placed here only to protect SPEC in the
17 * event the source is misused in any manner that is contrary to the
18 * spirit, the goals and the intent of SPEC.
20 * The source code is provided to the user or company under the license
21 * agreement for the SPEC Benchmark Suite for this product.
24 /*****************************************************************
26 * Copyright 1991,1992 Legato Systems, Inc. *
27 * Copyright 1991,1992 Auspex Systems, Inc. *
28 * Copyright 1991,1992 Data General Corporation *
29 * Copyright 1991,1992 Digital Equipment Corporation *
30 * Copyright 1991,1992 Interphase Corporation *
31 * Copyright 1991,1992 Sun Microsystems, Inc. *
33 *****************************************************************/
37 * ------------------------- sfs_c_dat.c --------------------------
39 * Space declarations for sfs.
42 * 11-Jul-94 ChakChung Ng Add codes for NFS/v3
43 * 24-Aug-92 Wittle New file set access.
44 * 05-Jan-92 Pawlowski Added hooks for raw data dump.
45 * 04-Dec-91 Bruce Keith Include string.h for SYSV/SVR4.
46 * 17-May-90 Richard Bean Created.
51 * ------------------------- Include Files -------------------------
62 #include <sys/types.h>
67 #include "sfs_c_def.h"
68 #include "sfs_m_def.h"
72 * ------------------------- NFS Operations -------------------------
76 * RPC timeout values by call type.
77 * Index'ed by #defines in sfs_def.h.
79 struct timeval *Nfs_timers;
81 struct timeval Nfs_udp_timers[] = {
84 { 10, 0 }, /* All commands during initialization phase */
85 { 1, 0 }, /* Lookup during warmup and test run phases */
86 { 2, 0 }, /* Read during warmup and test run phases */
87 { 3, 0 }, /* Write during warmup and test run phases */
91 * TCP is a "reliable" protocol so timeouts should never occur. Set
92 * the values to be large enough to ensure all servers will respond
93 * but not too large so a broken implementation will still complete.
95 struct timeval Nfs_tcp_timers[] = {
98 { 60, 0 }, /* All commands during initialization phase */
99 { 60, 0 }, /* Lookup during warmup and test run phases */
100 { 60, 0 }, /* Read during warmup and test run phases */
101 { 60, 0 }, /* Write during warmup and test run phases */
105 * ----------------------- Transfer Size Distribution -----------------------
107 * Over-the-wire transfer sizes are divided into 2 cases: read and write.
108 * For each case, a percentile rank determines the basic size unit of the
109 * transfer which is multiplied by a count to give the total size for the
112 * The block transfer size distribution is specified by a table of values.
113 * The first column gives the percent of operations that will be a
114 * specific block transfer size. The second column gives the number of
115 * blocks units that will be transferred. Normally the block unit size
116 * is 8KB. The third column is a boolean specifying whether a trailing
117 * fragment block should be transferred. The fragment size for each transfer
118 * is a random multiple of 1 KB, up to the block size - 1 KB. Two tables
119 * are needed, one for read operation and one for write operations. The
120 * following table gives the default distributions.
122 * Read - Default Block Transfer Size Distribution Table
123 * percent block count fragment resulting transfer (8KB block size)
124 * ------- ----------- -------- -----------------------------------
126 * 85 1 0 85% 9 - 15 KB
127 * 8 2 1 8% 17 - 23 KB
128 * 4 4 1 4% 33 - 39 KB
129 * 2 8 1 2% 65 - 71 KB
130 * 1 16 1 1% 129 - 135 KB
132 * Write - Default Block Transfer Size Distribution Table
133 * percent block count fragment resulting transfer (8KB block size)
134 * ------- ----------- -------- -----------------------------------
135 * 49 0 1 49% 1 - 7 KB
136 * 36 1 1 36% 9 - 15 KB
137 * 8 2 1 8% 17 - 23 KB
138 * 4 4 1 4% 33 - 39 KB
139 * 2 8 1 2% 65 - 71 KB
140 * 1 16 1 1% 129 - 135 KB
142 * The user may specify a a different distribution by using the '-b' option.
143 * The format for the block size distribution file consists of the first
144 * three columns given above: percent, block count, and fragment. Read
145 * and write distribution tables are identified by the keywords "Read" and
146 * "Write". An example input file, using the default values, is given below:
163 * A second parameter controlled by the block transfer size distribution table
164 * is the network transport packet size. The distribution tables define the
165 * relative proportion of full blocks packets to fragment packets. For
166 * instance, the default tables have been constructed to produce a specific
167 * distribution of ethernet packet sizes for i/o operations by controlling
168 * the amount of data in each packet. The write packets produced consist
169 * of 50% 8-KB packets, and 50% 1-7 KB packets. The read packets consist
170 * of 85% 8-KB packets, and 15% 1-7 KB packets. These figures are
171 * determined by multiplying the percentage for the type of transfer by
172 * the number of blocks and fragments generated, and adding the totals.
173 * These conmputations are performed below for the default block size
174 * distribution tables:
176 * Read blocks fragments
194 * 100 (50%) 100 (50%)
198 static sfs_io_op_dist_type Default_read_size_dist[] = {
199 /* percentile 8KB xfers fragments */
200 { 0, 0, 0 }, /* 0% 1 - 7 KB */
201 { 85, 1, 0 }, /* 85% 8 KB */
202 { 93, 2, 1 }, /* 8% 17 - 23 KB */
203 { 97, 4, 1 }, /* 4% 33 - 39 KB */
204 { 99, 8, 1 }, /* 2% 65 - 71 KB */
205 { 100, 16, 1 }, /* 1% 129 - 135 KB */
208 static sfs_io_op_dist_type Default_write_size_dist[] = {
209 /* percentile 8KB xfers fragments */
210 { 49, 0, 1 }, /* 49% 1 - 7 KB */
211 { 85, 1, 1 }, /* 36% 9 - 15 KB */
212 { 93, 2, 1 }, /* 8% 17 - 23 KB */
213 { 97, 4, 1 }, /* 4% 33 - 39 KB */
214 { 99, 8, 1 }, /* 2% 65 - 71 KB */
215 { 100, 16, 1 }, /* 1% 129 - 135 KB */
218 static sfs_io_dist_type Default_io_dist = {
219 Default_read_size_dist, /* read size distribution */
220 Default_write_size_dist, /* write size distribution */
221 17, /* max file size in Block_size units */
222 1.64, /* average read ops / request */
223 2 /* average write ops / request */
226 sfs_io_file_size_dist Default_file_size_dist[] = {
227 /* percentage KB size */
237 { 100, 1024}, /* 1% */
242 * ------------------------- Remote File Information -------------------------
244 int Num_io_file_sizes; /* # of different size of files */
245 int Num_io_files; /* # of files used for i/o */
246 int Num_non_io_files; /* # of non-i/o regular files */
247 int Num_dirs; /* # of pre-created directories */
248 int Num_dir_files; /* # of directories */
249 int Num_symlinks; /* # of pre-created symlinks */
250 int Num_symlink_files; /* # of symlinks */
252 int Num_working_io_files; /* # of i/o files in working set */
253 int Num_working_non_io_files; /* # of non i/o files in working set */
254 int Num_working_dirs; /* # of dirs in working set */
255 int Num_working_symlinks; /* # of symlinks in working set */
256 int files_per_megabyte; /* # of files created of each MB */
259 sfs_io_dist_type *Io_dist_ptr= /* block transfer distribution info */
262 sfs_fh_type *Io_files; /* list of i/o files */
263 sfs_fh_type *Non_io_files; /* list of non-i/o files */
264 sfs_fh_type *Dirs; /* list of directories */
265 sfs_fh_type *Symlinks; /* list of symlinks */
267 sfs_fh_type *Cur_file_ptr; /* current file */
268 char Cur_filename[SFS_MAXNAMLEN]; /* current dir entry name */
269 char Filespec[SFS_MAXNAMLEN] /* sprintf spec for file names */
271 char Dirspec[SFS_MAXNAMLEN] /* sprintf spec for directory names */
273 char Symspec[SFS_MAXNAMLEN] /* sprintf spec for symlink names */
277 * ------------------------- Run Parameters -------------------------
281 sfs_phase_type Current_test_phase; /* current phase of the test */
283 sfs_fh_type Export_dir; /* filehandle for exported fs */
284 CLIENT * NFS_client; /* RPC client handle */
285 CLIENT * NFS_client_recv; /* RPC client handle used for recv_thread */
287 bool_t Timed_run = TRUE; /* Timed run or call target ? */
288 int Runtime = DEFAULT_RUNTIME; /* seconds in benchmark run */
289 int Warmuptime = DEFAULT_WARMUP; /* seconds to warmup */
290 int Access_percent = DEFAULT_ACCESS; /* % of file set to access */
291 int Append_percent = DEFAULT_APPEND; /* % of writes that append */
292 int Fss_delta_percent = DEFAULT_DELTA_FSS; /* allowed change to file set */
293 int Kb_per_block = DEFAULT_KB_PER_BLOCK; /* i/o pkt block sz in KB */
294 int Bytes_per_block = DEFAULT_KB_PER_BLOCK * 1024;/* i/o pkt sz in bytes */
295 int Num_failed_lookup = DEFAULT_FAILED_LOOKUP; /* percent failed lookups */
296 int Testop = -1; /* test mode operation number */
297 int Interactive = 0; /* test synchronized by user*/
298 int Populate_only = 0; /* populate test dirs & quit */
299 int Debug_level = 0xFFFF; /* debugging switch */
303 * --------------------- Biod Simulation Variables ---------------------
306 int Biod_max_outstanding_writes = DEFAULT_BIOD_MAX_WRITE;
307 int Biod_max_outstanding_reads = DEFAULT_BIOD_MAX_READ;
311 * ------------------- File Set Size Control -------------------------
314 int avg_bytes_per_file = 136*1024; /* calculated average file size */
315 int Base_fss_bytes = 0; /* base file set size in bytes */
316 int Most_fss_bytes = 0; /* most bytes ever in file set */
317 int Least_fss_bytes = 0; /* least bytes ever in file set */
318 int Limit_fss_bytes = 0; /* target upper limit on fileset size */
319 int Cur_fss_bytes = 0; /* bytes currently in file set */
320 int Total_fss_bytes = 0; /* Total bytes created */
324 * ------------- Per Child Load Generation Rate Variables -----------
327 int Msec_per_period; /* total msec during the current run period */
331 * ------------------------- Miscellaneous -------------------------
334 struct ladtime Cur_time; /* current time of day */
335 struct ladtime Starttime; /* start of test */
336 int start_run_phase = 0;
338 char lad_hostname[HOSTNAME_LEN];