PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fileop.c
Go to the documentation of this file.
1 /*
2  * Author: Don Capps
3  * 3/13/2006
4  *
5  * Author: Don Capps (capps@iozone.org)
6  * 7417 Crenshaw
7  * Plano, TX 75025
8  *
9  * Copyright 2006, 2007, 2008, 2009 Don Capps.
10  *
11  * License to freely use and distribute this software is hereby granted
12  * by the author, subject to the condition that this copyright notice
13  * remains intact. The author retains the exclusive right to publish
14  * derivative works based on this work, including, but not limited to,
15  * revised versions of this work",
16  *
17  *
18  fileop [-f X ]|[-l # -u #] [-s Y] [-e] [-b] [-w] [-d <dir>] [-t] [-v] [-h]
19  -f # Force factor. X^3 files will be created and removed.
20  -l # Lower limit on the value of the Force factor.
21  -u # Upper limit on the value of the Force factor.
22  -s # Optional. Sets filesize for the create/write. May use suffix 'K' or 'M'.
23  -e Excel importable format.
24  -b Output best case.
25  -w Output worst case.
26  -d <dir> Specify starting directory.
27  -U <dir> Mount point to remount between tests.
28  -t Verbose output option.
29  -v Version information.
30  -h Help text.
31  *
32  * X is a force factor. The total number of files will
33  * be X * X * X ( X ^ 3 )
34  * The structure of the file tree is:
35  * X number of Level 1 directories, with X number of
36  * level 2 directories, with X number of files in each
37  * of the level 2 directories.
38  *
39  * Example: fileop 2
40  *
41  * dir_1 dir_2
42  * / \ / \
43  * sdir_1 sdir_2 sdir_1 sdir_2
44  * / \ / \ / \ / \
45  * file_1 file_2 file_1 file_2 file_1 file_2 file_1 file_2
46  *
47  * Each file will be created, and then 1 byte is written to the file.
48  *
49  */
50 
51 #include <sys/types.h>
52 #include <sys/stat.h>
53 #include <fcntl.h>
54 #include <sys/time.h>
55 #include <stdlib.h>
56 #include <stdio.h>
57 #include <signal.h>
58 #include <unistd.h>
59 #include <dirent.h>
60 #include <string.h>
61 
62 #include <limits.h>
63 
64 #if defined(Windows)
65 #include <Windows.h>
66 #endif
67 #if !defined(PATH_MAX)
68 #define PATH_MAX 255
69 #endif
70 
71 #if defined(_SUA_)
72 extern char *optarg;
73 extern char *opterr;
74 int fsync();
75 int getopt();
76 #endif
77 int junk, *junkp;
78 int x,excel;
79 int verbose = 0;
80 int sz = 1;
81 char *mbuffer;
82 int incr = 1;
83 #define _STAT_CREATE 0
84 #define _STAT_WRITE 1
85 #define _STAT_CLOSE 2
86 #define _STAT_LINK 3
87 #define _STAT_UNLINK 4
88 #define _STAT_DELETE 5
89 #define _STAT_STAT 6
90 #define _STAT_ACCESS 7
91 #define _STAT_CHMOD 8
92 #define _STAT_READDIR 9
93 #define _STAT_DIR_CREATE 10
94 #define _STAT_DIR_DELETE 11
95 #define _STAT_READ 12
96 #define _STAT_OPEN 13
97 #define _STAT_DIR_TRAVERSE 14
98 #define _NUM_STATS 15
99 struct stat_struct {
100  double starttime;
101  double endtime;
102  double speed;
103  double best;
104  double worst;
105  double dummy;
106  double total_time;
107  double dummy1;
108  long long counter;
109 } volatile stats[_NUM_STATS];
110 
111 
112 static double time_so_far(void);
113 void dir_create(int);
114 void dir_traverse(int);
115 void dir_delete(int);
116 void file_create(int);
117 void file_stat(int);
118 void file_access(int);
119 void file_chmod(int);
120 void file_readdir(int);
121 void file_delete(int);
122 void file_link(int);
123 void file_unlink(int);
124 void file_read(int);
125 void splash(void);
126 void usage(void);
127 void bzero();
128 void clear_stats();
129 int validate(char *, int , char );
130 
131 #define THISVERSION " $Revision$"
132 /*#define NULL 0*/
133 
135 char thedir[PATH_MAX]="."; /* Default is to use the current directory */
136 const char *mountname=NULL; /* Default is not to unmount anything between the tests */
137 
138 int cret;
140 int i;
141 int best, worst;
142 int dirlen;
143 
144 /************************************************************************/
145 /* Routine to purge the buffer cache by unmounting drive. */
146 /************************************************************************/
148 {
149  if (!mountname)
150  return;
151 
152  char cwd[PATH_MAX];
153  char command[1024];
154  int ret,i;
155 
156  junkp=(int *)getcwd(cwd, sizeof(cwd));
157  junk=chdir("/");
158  strcpy(command,"umount ");
159  strcat(command, mountname);
160  /*
161  umount might fail if the device is still busy, so
162  retry unmounting several times with increasing delays
163  */
164  for (i = 1; i < 10; ++i) {
165  ret = system(command);
166  if (ret == 0)
167  break;
168  sleep(i); /* seconds */
169  }
170  strcpy(command,"mount ");
171  strcat(command, mountname);
172  junk=system(command);
173  junk=chdir(cwd);
174 }
175 
176 int main(int argc, char **argv)
177 {
178  if(argc == 1)
179  {
180  usage();
181  exit(1);
182  }
183  while((cret = getopt(argc,argv,"hbwetvf:s:l:u:d:U:i: ")) != EOF){
184  switch(cret){
185  case 'h':
186  usage();
187  exit(0);
188  break;
189  case 'd' :
190  dirlen=strlen(optarg);
191  if (optarg[dirlen-1]=='/')
192  --dirlen;
193  strncpy(thedir, optarg, dirlen);
194  thedir[dirlen] = 0;
195  break;
196  case 'U':
197  mountname = optarg;
198  break;
199  case 'i': /* Increment force by */
200  incr=atoi(optarg);
201  if(incr < 0)
202  incr=1;
203  break;
204  case 'f': /* Force factor */
205  x=atoi(optarg);
206  if(x < 0)
207  x=1;
208  break;
209  case 's': /* Size of files */
210  sz=atoi(optarg);
211  if(optarg[strlen(optarg)-1]=='k' ||
212  optarg[strlen(optarg)-1]=='K'){
213  sz = (1024 * atoi(optarg));
214  }
215  if(optarg[strlen(optarg)-1]=='m' ||
216  optarg[strlen(optarg)-1]=='M'){
217  sz = (1024 * 1024 * atoi(optarg));
218  }
219  if(sz < 0)
220  sz=1;
221  break;
222  case 'l': /* lower force value */
223  lower=atoi(optarg);
224  range=1;
225  if(lower < 0)
226  lower=1;
227  break;
228  case 'v': /* version */
229  splash();
230  exit(0);
231  break;
232  case 'u': /* upper force value */
233  upper=atoi(optarg);
234  range=1;
235  if(upper < 0)
236  upper=1;
237  break;
238  case 't': /* verbose */
239  verbose=1;
240  break;
241  case 'e': /* Excel */
242  excel=1;
243  break;
244  case 'b': /* Best */
245  best=1;
246  break;
247  case 'w': /* Worst */
248  worst=1;
249  break;
250  }
251  }
252  mbuffer=(char *)malloc(sz);
253  memset(mbuffer,'a',sz);
254  if(!excel)
255  printf("\nFileop: Working in %s, File size is %d, Output is in Ops/sec. (A=Avg, B=Best, W=Worst)\n", thedir, sz);
256  if(!verbose)
257  {
258 #ifdef Windows
259  printf(" . %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %10s\n",
260  "mkdir","chdir","rmdir","create","open","read","write","close","stat",
261  "access","chmod","readdir","delete"," Total_files");
262 #else
263 
264  printf(" . %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %10s\n",
265  "mkdir","chdir","rmdir","create","open", "read","write","close","stat",
266  "access","chmod","readdir","link ","unlink","delete",
267  " Total_files");
268 #endif
269  }
270  junk=chdir(thedir); /* change starting point */
271  if(x==0)
272  x=1;
273  if(range==0)
274  lower=upper=x;
275  for(i=lower;i<=upper;i+=incr)
276  {
277  clear_stats();
278  x=i;
279  /*
280  * Dir Create test
281  */
283  dir_create(x);
284 
285  if(verbose)
286  {
287  printf("mkdir: Dirs = %9lld ",stats[_STAT_DIR_CREATE].counter);
288  printf("Total Time = %12.9f seconds\n", stats[_STAT_DIR_CREATE].total_time);
289  printf(" Avg mkdir(s)/sec = %12.2f (%12.9f seconds/op)\n",
290  stats[_STAT_DIR_CREATE].counter/stats[_STAT_DIR_CREATE].total_time,
291  stats[_STAT_DIR_CREATE].total_time/stats[_STAT_DIR_CREATE].counter);
292  printf(" Best mkdir(s)/sec = %12.2f (%12.9f seconds/op)\n",1/stats[_STAT_DIR_CREATE].best,stats[_STAT_DIR_CREATE].best);
293  printf(" Worst mkdir(s)/sec = %12.2f (%12.9f seconds/op)\n\n",1/stats[_STAT_DIR_CREATE].worst,stats[_STAT_DIR_CREATE].worst);
294  }
295 
296  /*
297  * Dir Traverse test
298  */
300  dir_traverse(x);
301 
302  if(verbose)
303  {
304  printf("chdir: Dirs = %9lld ",stats[_STAT_DIR_TRAVERSE].counter);
305  printf("Total Time = %12.9f seconds\n", stats[_STAT_DIR_TRAVERSE].total_time);
306  printf(" Avg chdir(s)/sec = %12.2f (%12.9f seconds/op)\n",
307  stats[_STAT_DIR_TRAVERSE].counter/stats[_STAT_DIR_TRAVERSE].total_time,
308  stats[_STAT_DIR_TRAVERSE].total_time/stats[_STAT_DIR_TRAVERSE].counter);
309  printf(" Best chdir(s)/sec = %12.2f (%12.9f seconds/op)\n",1/stats[_STAT_DIR_TRAVERSE].best,stats[_STAT_DIR_TRAVERSE].best);
310  printf(" Worst chdir(s)/sec = %12.2f (%12.9f seconds/op)\n\n",1/stats[_STAT_DIR_TRAVERSE].worst,stats[_STAT_DIR_TRAVERSE].worst);
311  }
312 
313  /*
314  * Dir delete test
315  */
317  dir_delete(x);
318 
319  if(verbose)
320  {
321  printf("rmdir: Dirs = %9lld ",stats[_STAT_DIR_DELETE].counter);
322  printf("Total Time = %12.9f seconds\n",stats[_STAT_DIR_DELETE].total_time);
323  printf(" Avg rmdir(s)/sec = %12.2f (%12.9f seconds/op)\n",
324  stats[_STAT_DIR_DELETE].counter/stats[_STAT_DIR_DELETE].total_time,
325  stats[_STAT_DIR_DELETE].total_time/stats[_STAT_DIR_DELETE].counter);
326  printf(" Best rmdir(s)/sec = %12.2f (%12.9f seconds/op)\n",1/stats[_STAT_DIR_DELETE].best,stats[_STAT_DIR_DELETE].best);
327  printf(" Worst rmdir(s)/sec = %12.2f (%12.9f seconds/op)\n\n",1/stats[_STAT_DIR_DELETE].worst,stats[_STAT_DIR_DELETE].worst);
328  }
329 
330  /*
331  * Create test
332  */
334  file_create(x);
335  if(verbose)
336  {
337  printf("create: Files = %9lld ",stats[_STAT_CREATE].counter);
338  printf("Total Time = %12.9f seconds\n", stats[_STAT_CREATE].total_time);
339  printf(" Avg create(s)/sec = %12.2f (%12.9f seconds/op)\n",
340  stats[_STAT_CREATE].counter/stats[_STAT_CREATE].total_time,
341  stats[_STAT_CREATE].total_time/stats[_STAT_CREATE].counter);
342  printf(" Best create(s)/sec = %12.2f (%12.9f seconds/op)\n",
344  printf(" Worst create(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
346  printf("write: Files = %9lld ",stats[_STAT_WRITE].counter);
347  printf("Total Time = %12.9f seconds\n", stats[_STAT_WRITE].total_time);
348  printf(" Avg write(s)/sec = %12.2f (%12.9f seconds/op)\n",
349  stats[_STAT_WRITE].counter/stats[_STAT_WRITE].total_time,
350  stats[_STAT_WRITE].total_time/stats[_STAT_WRITE].counter);
351  printf(" Best write(s)/sec = %12.2f (%12.9f seconds/op)\n",
352  1/stats[_STAT_WRITE].best,stats[_STAT_WRITE].best);
353  printf(" Worst write(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
354  1/stats[_STAT_WRITE].worst,stats[_STAT_WRITE].worst);
355  printf("close: Files = %9lld ",stats[_STAT_CLOSE].counter);
356  printf("Total Time = %12.9f seconds\n", stats[_STAT_CLOSE].total_time);
357  printf(" Avg close(s)/sec = %12.2f (%12.9f seconds/op)\n",
358  stats[_STAT_CLOSE].counter/stats[_STAT_CLOSE].total_time,
359  stats[_STAT_CLOSE].total_time/stats[_STAT_CLOSE].counter);
360  printf(" Best close(s)/sec = %12.2f (%12.9f seconds/op)\n",
361  1/stats[_STAT_CLOSE].best,stats[_STAT_CLOSE].best);
362  printf(" Worst close(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
363  1/stats[_STAT_CLOSE].worst,stats[_STAT_CLOSE].worst);
364  }
365 
366  /*
367  * Stat test
368  */
370  file_stat(x);
371 
372  if(verbose)
373  {
374  printf("stat: Files = %9lld ",stats[_STAT_STAT].counter);
375  printf("Total Time = %12.9f seconds\n", stats[_STAT_STAT].total_time);
376  printf(" Avg stat(s)/sec = %12.2f (%12.9f seconds/op)\n",
377  stats[_STAT_STAT].counter/stats[_STAT_STAT].total_time,
378  stats[_STAT_STAT].total_time/stats[_STAT_STAT].counter);
379  printf(" Best stat(s)/sec = %12.2f (%12.9f seconds/op)\n",
381  printf(" Worst stat(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
383  }
384  /*
385  * Read test
386  */
388  file_read(x);
389 
390  if(verbose)
391  {
392  printf("open: Files = %9lld ",stats[_STAT_OPEN].counter);
393  printf("Total Time = %12.9f seconds\n", stats[_STAT_OPEN].total_time);
394  printf(" Avg open(s)/sec = %12.2f (%12.9f seconds/op)\n",
395  stats[_STAT_OPEN].counter/stats[_STAT_OPEN].total_time,
396  stats[_STAT_OPEN].total_time/stats[_STAT_OPEN].counter);
397  printf(" Best open(s)/sec = %12.2f (%12.9f seconds/op)\n",
399  printf(" Worst open(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
401 
402  printf("read: Files = %9lld ",stats[_STAT_READ].counter);
403  printf("Total Time = %12.9f seconds\n", stats[_STAT_READ].total_time);
404  printf(" Avg read(s)/sec = %12.2f (%12.9f seconds/op)\n",
405  stats[_STAT_READ].counter/stats[_STAT_READ].total_time,
406  stats[_STAT_READ].total_time/stats[_STAT_READ].counter);
407  printf(" Best read(s)/sec = %12.2f (%12.9f seconds/op)\n",
408  1/stats[_STAT_READ].best,stats[_STAT_READ].best);
409  printf(" Worst read(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
410  1/stats[_STAT_READ].worst,stats[_STAT_READ].worst);
411  }
412 
413  /*
414  * Access test
415  */
417  file_access(x);
418  if(verbose)
419  {
420  printf("access: Files = %9lld ",stats[_STAT_ACCESS].counter);
421  printf("Total Time = %12.9f seconds\n", stats[_STAT_ACCESS].total_time);
422  printf(" Avg access(s)/sec = %12.2f (%12.9f seconds/op)\n",
423  stats[_STAT_ACCESS].counter/stats[_STAT_ACCESS].total_time,
424  stats[_STAT_ACCESS].total_time/stats[_STAT_ACCESS].counter);
425  printf(" Best access(s)/sec = %12.2f (%12.9f seconds/op)\n",
427  printf(" Worst access(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
429  }
430  /*
431  * Chmod test
432  */
434  file_chmod(x);
435 
436  if(verbose)
437  {
438  printf("chmod: Files = %9lld ",stats[_STAT_CHMOD].counter);
439  printf("Total Time = %12.9f seconds\n", stats[_STAT_CHMOD].total_time);
440  printf(" Avg chmod(s)/sec = %12.2f (%12.9f seconds/op)\n",
441  stats[_STAT_CHMOD].counter/stats[_STAT_CHMOD].total_time,
442  stats[_STAT_CHMOD].total_time/stats[_STAT_CHMOD].counter);
443  printf(" Best chmod(s)/sec = %12.2f (%12.9f seconds/op)\n",
445  printf(" Worst chmod(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
447  }
448  /*
449  * readdir test
450  */
452  file_readdir(x);
453 
454  if(verbose)
455  {
456  printf("readdir: Files = %9lld ",stats[_STAT_READDIR].counter);
457  printf("Total Time = %12.9f seconds\n", stats[_STAT_READDIR].total_time);
458  printf(" Avg readdir(s)/sec = %12.2f (%12.9f seconds/op)\n",
459  stats[_STAT_READDIR].counter/stats[_STAT_READDIR].total_time,
460  stats[_STAT_READDIR].total_time/stats[_STAT_READDIR].counter);
461  printf(" Best readdir(s)/sec = %12.2f (%12.9f seconds/op)\n",
463  printf(" Worst readdir(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
465  }
466 #if !defined(Windows)
467  /*
468  * link test
469  */
471  file_link(x);
472  if(verbose)
473  {
474  printf("link: Files = %9lld ",stats[_STAT_LINK].counter);
475  printf("Total Time = %12.9f seconds\n",stats[_STAT_LINK].total_time);
476  printf(" Avg link(s)/sec = %12.2f (%12.9f seconds/op)\n",
477  stats[_STAT_LINK].counter/stats[_STAT_LINK].total_time,
478  stats[_STAT_LINK].total_time/stats[_STAT_LINK].counter);
479  printf(" Best link(s)/sec = %12.2f (%12.9f seconds/op)\n",
481  printf(" Worst link(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
483  }
484  /*
485  * unlink test
486  */
488  file_unlink(x);
489  if(verbose)
490  {
491  printf("unlink: Files = %9lld ",stats[_STAT_UNLINK].counter);
492  printf("Total Time = %12.9f seconds\n", stats[_STAT_UNLINK].total_time);
493  printf(" Avg unlink(s)/sec = %12.2f (%12.9f seconds/op)\n",
494  stats[_STAT_UNLINK].counter/stats[_STAT_UNLINK].total_time,
495  stats[_STAT_UNLINK].total_time/stats[_STAT_UNLINK].counter);
496  printf(" Best unlink(s)/sec = %12.2f (%12.9f seconds/op)\n",
498  printf(" Worst unlink(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
500  }
501 #endif
502  /*
503  * Delete test
504  */
506  file_delete(x);
507  if(verbose)
508  {
509  printf("delete: Files = %9lld ",stats[_STAT_DELETE].counter);
510  printf("Total Time = %12.9f seconds\n", stats[_STAT_DELETE].total_time);
511  printf(" Avg delete(s)/sec = %12.2f (%12.9f seconds/op)\n",
512  stats[_STAT_DELETE].counter/stats[_STAT_DELETE].total_time,
513  stats[_STAT_DELETE].total_time/stats[_STAT_DELETE].counter);
514  printf(" Best delete(s)/sec = %12.2f (%12.9f seconds/op)\n",
516  printf(" Worst delete(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
518  }
519  if(!verbose)
520  {
521  printf("%c %4d %7.0f ",'A',x,stats[_STAT_DIR_CREATE].counter/stats[_STAT_DIR_CREATE].total_time);
522  printf("%7.0f ",stats[_STAT_DIR_TRAVERSE].counter/stats[_STAT_DIR_TRAVERSE].total_time);
523  printf("%7.0f ",stats[_STAT_DIR_DELETE].counter/stats[_STAT_DIR_DELETE].total_time);
524  printf("%7.0f ",stats[_STAT_CREATE].counter/stats[_STAT_CREATE].total_time);
525  printf("%7.0f ",stats[_STAT_OPEN].counter/stats[_STAT_OPEN].total_time);
526  printf("%7.0f ",stats[_STAT_READ].counter/stats[_STAT_READ].total_time);
527  printf("%7.0f ",stats[_STAT_WRITE].counter/stats[_STAT_WRITE].total_time);
528  printf("%7.0f ",stats[_STAT_CLOSE].counter/stats[_STAT_CLOSE].total_time);
529  printf("%7.0f ",stats[_STAT_STAT].counter/stats[_STAT_STAT].total_time);
530  printf("%7.0f ",stats[_STAT_ACCESS].counter/stats[_STAT_ACCESS].total_time);
531  printf("%7.0f ",stats[_STAT_CHMOD].counter/stats[_STAT_CHMOD].total_time);
532  printf("%7.0f ",stats[_STAT_READDIR].counter/stats[_STAT_READDIR].total_time);
533 #ifndef Windows
534  printf("%7.0f ",stats[_STAT_LINK].counter/stats[_STAT_LINK].total_time);
535  printf("%7.0f ",stats[_STAT_UNLINK].counter/stats[_STAT_UNLINK].total_time);
536 #endif
537  printf("%7.0f ",stats[_STAT_DELETE].counter/stats[_STAT_DELETE].total_time);
538  printf("%10d ",x*x*x);
539  printf("\n");
540  fflush(stdout);
541 
542  if(best)
543  {
544  printf("%c %4d %7.0f ",'B',x, 1/stats[_STAT_DIR_CREATE].best);
545  printf("%7.0f ",1/stats[_STAT_DIR_TRAVERSE].best);
546  printf("%7.0f ",1/stats[_STAT_DIR_DELETE].best);
547  printf("%7.0f ",1/stats[_STAT_CREATE].best);
548  printf("%7.0f ",1/stats[_STAT_OPEN].best);
549  printf("%7.0f ",1/stats[_STAT_READ].best);
550  printf("%7.0f ",1/stats[_STAT_WRITE].best);
551  printf("%7.0f ",1/stats[_STAT_CLOSE].best);
552  printf("%7.0f ",1/stats[_STAT_STAT].best);
553  printf("%7.0f ",1/stats[_STAT_ACCESS].best);
554  printf("%7.0f ",1/stats[_STAT_CHMOD].best);
555  printf("%7.0f ",1/stats[_STAT_READDIR].best);
556 #ifndef Windows
557  printf("%7.0f ",1/stats[_STAT_LINK].best);
558  printf("%7.0f ",1/stats[_STAT_UNLINK].best);
559 #endif
560  printf("%7.0f ",1/stats[_STAT_DELETE].best);
561  printf("%10d ",x*x*x);
562  printf("\n");
563  fflush(stdout);
564  }
565  if(worst)
566  {
567  printf("%c %4d %7.0f ",'W',x, 1/stats[_STAT_DIR_CREATE].worst);
568  printf("%7.0f ",1/stats[_STAT_DIR_TRAVERSE].worst);
569  printf("%7.0f ",1/stats[_STAT_DIR_DELETE].worst);
570  printf("%7.0f ",1/stats[_STAT_CREATE].worst);
571  printf("%7.0f ",1/stats[_STAT_OPEN].worst);
572  printf("%7.0f ",1/stats[_STAT_READ].worst);
573  printf("%7.0f ",1/stats[_STAT_WRITE].worst);
574  printf("%7.0f ",1/stats[_STAT_CLOSE].worst);
575  printf("%7.0f ",1/stats[_STAT_STAT].worst);
576  printf("%7.0f ",1/stats[_STAT_ACCESS].worst);
577  printf("%7.0f ",1/stats[_STAT_CHMOD].worst);
578  printf("%7.0f ",1/stats[_STAT_READDIR].worst);
579 #ifndef Windows
580  printf("%7.0f ",1/stats[_STAT_LINK].worst);
581  printf("%7.0f ",1/stats[_STAT_UNLINK].worst);
582 #endif
583  printf("%7.0f ",1/stats[_STAT_DELETE].worst);
584  printf("%10d ",x*x*x);
585  printf("\n");
586  fflush(stdout);
587  }
588  }
589  }
590  return(0);
591 }
592 
593 void
595 {
596  int i,j,k;
597  int ret;
598  char buf[100];
599  stats[_STAT_DIR_CREATE].best=(double)99999.9;
600  stats[_STAT_DIR_CREATE].worst=(double)0.00000000;
601  for(i=0;i<x;i++)
602  {
603  sprintf(buf,"fileop_L1_%d",i);
605  ret=mkdir(buf,0777);
606  if(ret < 0)
607  {
608  printf("Mkdir failed\n");
609  exit(1);
610  }
613  if(stats[_STAT_DIR_CREATE].speed < (double)0.0)
621  junk=chdir(buf);
622  for(j=0;j<x;j++)
623  {
624  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
626  ret=mkdir(buf,0777);
627  if(ret < 0)
628  {
629  printf("Mkdir failed\n");
630  exit(1);
631  }
634  if(stats[_STAT_DIR_CREATE].speed < (double)0.0)
638  if(stats[_STAT_DIR_CREATE].speed < stats[_STAT_DIR_CREATE].best)
640  if(stats[_STAT_DIR_CREATE].speed > stats[_STAT_DIR_CREATE].worst)
642  junk=chdir(buf);
643  for(k=0;k<x;k++)
644  {
645  sprintf(buf,"fileop_dir_%d_%d_%d",i,j,k);
647  ret=mkdir(buf,0777);
648  if(ret < 0)
649  {
650  printf("Mkdir failed\n");
651  exit(1);
652  }
655  if(stats[_STAT_DIR_CREATE].speed < (double)0.0)
659  if(stats[_STAT_DIR_CREATE].speed < stats[_STAT_DIR_CREATE].best)
661  if(stats[_STAT_DIR_CREATE].speed > stats[_STAT_DIR_CREATE].worst)
663  junk=chdir(buf);
664  junk=chdir("..");
665  }
666  junk=chdir("..");
667  }
668  junk=chdir("..");
669  }
670 }
671 
672 void
674 {
675  int i,j,k;
676  char buf[100];
677  double time1, time2;
679  stats[_STAT_DIR_TRAVERSE].worst=(double)0.00000000;
680  for(i=0;i<x;i++)
681  {
682  sprintf(buf,"fileop_L1_%d",i);
684  junk=chdir(buf);
687  for(j=0;j<x;j++)
688  {
689  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
691  junk=chdir(buf);
694  for(k=0;k<x;k++)
695  {
696  sprintf(buf,"fileop_dir_%d_%d_%d",i,j,k);
698  junk=chdir(buf);
699  junk=chdir("..");
702  if(stats[_STAT_DIR_TRAVERSE].speed < (double)0.0)
710  }
712  junk=chdir("..");
715  if(stats[_STAT_DIR_TRAVERSE].speed < (double)0.0)
723  }
725  junk=chdir("..");
728  if(stats[_STAT_DIR_TRAVERSE].speed < (double)0.0)
736  }
737 }
738 
739 void
741 {
742  int i,j,k;
743  int fd;
744  int ret;
745  char buf[100];
746  char value;
747  stats[_STAT_CREATE].best=(double)999999.9;
749  stats[_STAT_WRITE].best=(double)999999.9;
751  stats[_STAT_CLOSE].best=(double)999999.9;
753  for(i=0;i<x;i++)
754  {
755  sprintf(buf,"fileop_L1_%d",i);
756  ret=mkdir(buf,0777);
757  if(ret < 0)
758  {
759  printf("Mkdir failed\n");
760  exit(1);
761  }
762  junk=chdir(buf);
763  for(j=0;j<x;j++)
764  {
765  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
766  ret=mkdir(buf,0777);
767  if(ret < 0)
768  {
769  printf("Mkdir failed\n");
770  exit(1);
771  }
772  junk=chdir(buf);
773  for(k=0;k<x;k++)
774  {
775  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
776  value=(char) ((i^j^k) & 0xff);
777  memset(mbuffer,value,sz);
779  fd=creat(buf,O_RDWR|0600);
780  if(fd < 0)
781  {
782  printf("Create failed\n");
783  exit(1);
784  }
787  if(stats[_STAT_CREATE].speed < (double)0.0)
795 
797  junk=write(fd,mbuffer,sz);
801  if(stats[_STAT_WRITE].speed < (double)0.0)
804  if(stats[_STAT_WRITE].speed < stats[_STAT_WRITE].best)
806  if(stats[_STAT_WRITE].speed > stats[_STAT_WRITE].worst)
808 
809  fsync(fd);
811  close(fd);
814  if(stats[_STAT_CLOSE].speed < (double)0.0)
818  if(stats[_STAT_CLOSE].speed < stats[_STAT_CLOSE].best)
820  if(stats[_STAT_CLOSE].speed > stats[_STAT_CLOSE].worst)
822  }
823  junk=chdir("..");
824  }
825  junk=chdir("..");
826  }
827 }
828 
829 void
831 {
832  int i,j,k,y;
833  char buf[100];
834  struct stat mystat;
835  stats[_STAT_STAT].best=(double)99999.9;
836  stats[_STAT_STAT].worst=(double)0.00000000;
837  for(i=0;i<x;i++)
838  {
839  sprintf(buf,"fileop_L1_%d",i);
840  junk=chdir(buf);
841  for(j=0;j<x;j++)
842  {
843  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
844  junk=chdir(buf);
845  for(k=0;k<x;k++)
846  {
847  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
849  y=stat(buf,&mystat);
850  if(y < 0)
851  {
852  printf("Stat failed\n");
853  exit(1);
854  }
857  if(stats[_STAT_STAT].speed < (double)0.0)
861  if(stats[_STAT_STAT].speed < stats[_STAT_STAT].best)
863  if(stats[_STAT_STAT].speed > stats[_STAT_STAT].worst)
865  }
866  junk=chdir("..");
867  }
868  junk=chdir("..");
869  }
870 }
871 
872 void
874 {
875  int i,j,k,y;
876  char buf[100];
877  stats[_STAT_ACCESS].best=(double)999999.9;
879  for(i=0;i<x;i++)
880  {
881  sprintf(buf,"fileop_L1_%d",i);
882  junk=chdir(buf);
883  for(j=0;j<x;j++)
884  {
885  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
886  junk=chdir(buf);
887  for(k=0;k<x;k++)
888  {
889  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
891  y=access(buf,W_OK|F_OK);
892  if(y < 0)
893  {
894  printf("access failed\n");
895  perror("what");
896  exit(1);
897  }
900  if(stats[_STAT_ACCESS].speed < (double)0.0)
908  }
909  junk=chdir("..");
910  }
911  junk=chdir("..");
912  }
913 }
914 
915 void
917 {
918  int i,j,k,y;
919  char buf[100];
920  stats[_STAT_CHMOD].best=(double)999999.9;
922  for(i=0;i<x;i++)
923  {
924  sprintf(buf,"fileop_L1_%d",i);
925  junk=chdir(buf);
926  for(j=0;j<x;j++)
927  {
928  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
929  junk=chdir(buf);
930  for(k=0;k<x;k++)
931  {
932  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
934  y=chmod(buf,0666);
935  if(y < 0)
936  {
937  printf("chmod failed\n");
938  perror("what");
939  exit(1);
940  }
943  if(stats[_STAT_CHMOD].speed < (double)0.0)
947  if(stats[_STAT_CHMOD].speed < stats[_STAT_CHMOD].best)
949  if(stats[_STAT_CHMOD].speed > stats[_STAT_CHMOD].worst)
951  }
952  junk=chdir("..");
953  }
954  junk=chdir("..");
955  }
956 }
957 
958 void
960 {
961  int i,j,ret1;
962  char buf[100];
963  DIR *dirbuf;
964  struct dirent *y;
965  stats[_STAT_READDIR].best=(double)999999.9;
967  for(i=0;i<x;i++)
968  {
969  sprintf(buf,"fileop_L1_%d",i);
970  junk=chdir(buf);
971  for(j=0;j<x;j++)
972  {
973  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
974  junk=chdir(buf);
975  dirbuf=opendir(".");
976  if(dirbuf==0)
977  {
978  printf("opendir failed\n");
979  exit(1);
980  }
982  y=readdir(dirbuf);
983  if(y == 0)
984  {
985  printf("readdir failed\n");
986  exit(1);
987  }
990  if(stats[_STAT_READDIR].speed < (double)0.0)
998  ret1=closedir(dirbuf);
999  if(ret1 < 0)
1000  {
1001  printf("closedir failed\n");
1002  exit(1);
1003  }
1004  junk=chdir("..");
1005  }
1006  junk=chdir("..");
1007  }
1008 }
1009 
1010 void
1012 {
1013  int i,j,k,y;
1014  char buf[100];
1015  char bufn[100];
1016  stats[_STAT_LINK].best=(double)999999.9;
1017  stats[_STAT_LINK].worst=(double)0.0;
1018  for(i=0;i<x;i++)
1019  {
1020  sprintf(buf,"fileop_L1_%d",i);
1021  junk=chdir(buf);
1022  for(j=0;j<x;j++)
1023  {
1024  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
1025  junk=chdir(buf);
1026  for(k=0;k<x;k++)
1027  {
1028  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
1029  sprintf(bufn,"fileop_file_%d_%d_%dL",i,j,k);
1031  y=link(buf,bufn);
1032  if(y < 0)
1033  {
1034  printf("Link failed\n");
1035  exit(1);
1036  }
1039  if(stats[_STAT_LINK].speed < (double)0.0)
1040  stats[_STAT_LINK].speed=(double)0.0;
1043  if(stats[_STAT_LINK].speed < stats[_STAT_LINK].best)
1045  if(stats[_STAT_LINK].speed > stats[_STAT_LINK].worst)
1047  }
1048  junk=chdir("..");
1049  }
1050  junk=chdir("..");
1051  }
1052 }
1053 
1054 void
1056 {
1057  int i,j,k,y;
1058  char buf[100];
1059  char bufn[100];
1060  stats[_STAT_UNLINK].best=(double)999999.9;
1062  for(i=0;i<x;i++)
1063  {
1064  sprintf(buf,"fileop_L1_%d",i);
1065  junk=chdir(buf);
1066  for(j=0;j<x;j++)
1067  {
1068  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
1069  junk=chdir(buf);
1070  for(k=0;k<x;k++)
1071  {
1072  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
1073  sprintf(bufn,"fileop_file_%d_%d_%dL",i,j,k);
1075  y=unlink(bufn);
1076  if(y < 0)
1077  {
1078  printf("Unlink failed\n");
1079  exit(1);
1080  }
1083  if(stats[_STAT_UNLINK].speed < (double)0.0)
1087  if(stats[_STAT_UNLINK].speed < stats[_STAT_UNLINK].best)
1089  if(stats[_STAT_UNLINK].speed > stats[_STAT_UNLINK].worst)
1091  }
1092  junk=chdir("..");
1093  }
1094  junk=chdir("..");
1095  }
1096 }
1097 
1098 void
1100 {
1101  int i,j,k;
1102  char buf[100];
1103  stats[_STAT_DIR_DELETE].best=(double)99999.9;
1104  stats[_STAT_DIR_DELETE].worst=(double)0.00000000;
1105  for(i=0;i<x;i++)
1106  {
1107  sprintf(buf,"fileop_L1_%d",i);
1108  junk=chdir(buf);
1109  for(j=0;j<x;j++)
1110  {
1111  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
1112  junk=chdir(buf);
1113  for(k=0;k<x;k++)
1114  {
1115  sprintf(buf,"fileop_dir_%d_%d_%d",i,j,k);
1116  junk=chdir(buf);
1117  junk=chdir("..");
1119  rmdir(buf);
1122  if(stats[_STAT_DIR_DELETE].speed < (double)0.0)
1130  }
1131  junk=chdir("..");
1132  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
1134  rmdir(buf);
1137  if(stats[_STAT_DIR_DELETE].speed < (double)0.0)
1145  }
1146  junk=chdir("..");
1147  sprintf(buf,"fileop_L1_%d",i);
1149  rmdir(buf);
1152  if(stats[_STAT_DIR_DELETE].speed < (double)0.0)
1160  }
1161 }
1162 
1163 void
1165 {
1166  int i,j,k;
1167  char buf[100];
1168  stats[_STAT_DELETE].best=(double)999999.9;
1170  for(i=0;i<x;i++)
1171  {
1172  sprintf(buf,"fileop_L1_%d",i);
1173  junk=chdir(buf);
1174  for(j=0;j<x;j++)
1175  {
1176  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
1177  junk=chdir(buf);
1178  for(k=0;k<x;k++)
1179  {
1180  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
1182  unlink(buf);
1185  if(stats[_STAT_DELETE].speed < (double)0.0)
1189  if(stats[_STAT_DELETE].speed < stats[_STAT_DELETE].best)
1191  if(stats[_STAT_DELETE].speed > stats[_STAT_DELETE].worst)
1193  }
1194  junk=chdir("..");
1195  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
1196  rmdir(buf);
1197  }
1198  junk=chdir("..");
1199  sprintf(buf,"fileop_L1_%d",i);
1200  rmdir(buf);
1201  }
1202 }
1203 void
1205 {
1206  int i,j,k,y,fd;
1207  char buf[100];
1208  char value;
1209  stats[_STAT_READ].best=(double)99999.9;
1210  stats[_STAT_READ].worst=(double)0.00000000;
1211  stats[_STAT_OPEN].best=(double)99999.9;
1212  stats[_STAT_OPEN].worst=(double)0.00000000;
1213  for(i=0;i<x;i++)
1214  {
1215  sprintf(buf,"fileop_L1_%d",i);
1216  junk=chdir(buf);
1217  for(j=0;j<x;j++)
1218  {
1219  sprintf(buf,"fileop_L1_%d_L2_%d",i,j);
1220  junk=chdir(buf);
1221  for(k=0;k<x;k++)
1222  {
1223  sprintf(buf,"fileop_file_%d_%d_%d",i,j,k);
1224  value=(char)((i^j^k) &0xff);
1226  fd=open(buf,O_RDONLY);
1227  if(fd < 0)
1228  {
1229  printf("Open failed\n");
1230  exit(1);
1231  }
1234  if(stats[_STAT_OPEN].speed < (double)0.0)
1235  stats[_STAT_OPEN].speed=(double)0.0;
1238  if(stats[_STAT_OPEN].speed < stats[_STAT_OPEN].best)
1240  if(stats[_STAT_OPEN].speed > stats[_STAT_OPEN].worst)
1242 
1244  y=read(fd,mbuffer,sz);
1245  if(y < 0)
1246  {
1247  printf("Read failed\n");
1248  exit(1);
1249  }
1250  if(validate(mbuffer,sz, value) !=0)
1251  printf("Error: Data Mis-compare\n");;
1253  close(fd);
1255  if(stats[_STAT_READ].speed < (double)0.0)
1256  stats[_STAT_READ].speed=(double)0.0;
1259  if(stats[_STAT_READ].speed < stats[_STAT_READ].best)
1261  if(stats[_STAT_READ].speed > stats[_STAT_READ].worst)
1263  }
1264  junk=chdir("..");
1265  }
1266  junk=chdir("..");
1267  }
1268 }
1269 
1270 /************************************************************************/
1271 /* Time measurement routines. Thanks to Iozone :-) */
1272 /************************************************************************/
1273 
1274 #ifdef HAVE_ANSIC_C
1275 static double
1276 time_so_far(void)
1277 #else
1278 static double
1279 time_so_far()
1280 #endif
1282 #ifdef Windows
1283  LARGE_INTEGER freq,counter;
1284  double wintime,bigcounter;
1285  /* For Windows the time_of_day() is useless. It increments in 55 milli second */
1286  /* increments. By using the Win32api one can get access to the high performance */
1287  /* measurement interfaces. With this one can get back into the 8 to 9 */
1288  /* microsecond resolution. */
1289  QueryPerformanceFrequency(&freq);
1290  QueryPerformanceCounter(&counter);
1291  bigcounter=(double)counter.HighPart *(double)0xffffffff +
1292  (double)counter.LowPart;
1293  wintime = (double)(bigcounter/(double)freq.LowPart);
1294  return((double)wintime);
1295 #else
1296 #if defined (OSFV4) || defined(OSFV3) || defined(OSFV5)
1297  struct timespec gp;
1298 
1299  if (getclock(TIMEOFDAY, (struct timespec *) &gp) == -1)
1300  perror("getclock");
1301  return (( (double) (gp.tv_sec)) +
1302  ( ((float)(gp.tv_nsec)) * 0.000000001 ));
1303 #else
1304  struct timeval tp;
1305 
1306  if (gettimeofday(&tp, (struct timezone *) NULL) == -1)
1307  perror("gettimeofday");
1308  return ((double) (tp.tv_sec)) +
1309  (((double) tp.tv_usec) * 0.000001 );
1310 #endif
1311 #endif
1312 }
1313 
1314 void
1315 splash(void)
1316 {
1317  printf("\n");
1318  printf(" --------------------------------------\n");
1319  printf(" | Fileop | \n");
1320  printf(" | %s | \n",version);
1321  printf(" | | \n");
1322  printf(" | by |\n");
1323  printf(" | | \n");
1324  printf(" | Don Capps |\n");
1325  printf(" --------------------------------------\n");
1326  printf("\n");
1327 }
1328 
1329 void
1330 usage(void)
1331 {
1332  splash();
1333  printf(" fileop [-f X ]|[-l # -u #] [-s Y] [-e] [-b] [-w] [-d <dir>] [-t] [-v] [-h]\n");
1334  printf("\n");
1335  printf(" -f # Force factor. X^3 files will be created and removed.\n");
1336  printf(" -l # Lower limit on the value of the Force factor.\n");
1337  printf(" -u # Upper limit on the value of the Force factor.\n");
1338  printf(" -s # Optional. Sets filesize for the create/write. May use suffix 'K' or 'M'.\n");
1339  printf(" -e Excel importable format.\n");
1340  printf(" -b Output best case results.\n");
1341  printf(" -i # Increment force factor by this increment.\n");
1342  printf(" -w Output worst case results.\n");
1343  printf(" -d <dir> Specify starting directory.\n");
1344  printf(" -U <dir> Mount point to remount between tests.\n");
1345  printf(" -t Verbose output option.\n");
1346  printf(" -v Version information.\n");
1347  printf(" -h Help text.\n");
1348  printf("\n");
1349  printf(" The structure of the file tree is:\n");
1350  printf(" X number of Level 1 directories, with X number of\n");
1351  printf(" level 2 directories, with X number of files in each\n");
1352  printf(" of the level 2 directories.\n");
1353  printf("\n");
1354  printf(" Example: fileop 2\n");
1355  printf("\n");
1356  printf(" dir_1 dir_2\n");
1357  printf(" / \\ / \\ \n");
1358  printf(" sdir_1 sdir_2 sdir_1 sdir_2\n");
1359  printf(" / \\ / \\ / \\ / \\ \n");
1360  printf(" file_1 file_2 file_1 file_2 file_1 file_2 file_1 file_2\n");
1361  printf("\n");
1362  printf(" Each file will be created, and then Y bytes is written to the file.\n");
1363  printf("\n");
1364 }
1365 void
1367 {
1368  int i;
1369  for(i=0;i<_NUM_STATS;i++)
1370  bzero((char *)&stats[i],sizeof(struct stat_struct));
1371 }
1372 int
1373 validate(char *buffer, int size, char value)
1374 {
1375  register int i;
1376  register char *cp;
1377  register int size1;
1378  register char v1;
1379  v1=value;
1380  cp = buffer;
1381  size1=size;
1382  for(i=0;i<size;i++)
1383  {
1384  if(*cp++ != v1)
1385  return(1);
1386  }
1387  return(0);
1388 }
1389 
const char * mountname
Definition: fileop.c:136
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
double dummy1
Definition: fileop.c:107
long long counter
Definition: fileop.c:108
int atoi()
ssize_t read(int fd, void *buf, size_t count)
Definition: appio.c:225
memset(eventId, 0, size)
int * junkp
Definition: fileop.c:77
#define _STAT_OPEN
Definition: fileop.c:96
int close(int fd)
Definition: appio.c:175
#define _STAT_DIR_TRAVERSE
Definition: fileop.c:97
sleep(1)
int verbose
Definition: fileop.c:79
void file_delete(int)
Definition: fileop.c:1164
void bzero()
void clear_stats()
Definition: fileop.c:1366
void dir_delete(int)
Definition: fileop.c:1099
int fd
Definition: iozone.c:1291
void file_readdir(int)
Definition: fileop.c:959
int incr
Definition: fileop.c:82
double worst
Definition: fileop.c:104
#define _STAT_DELETE
Definition: fileop.c:88
#define THISVERSION
Definition: fileop.c:131
#define _STAT_CLOSE
Definition: fileop.c:85
fflush(stdout)
#define printf
Definition: papi_test.h:125
void double value
Definition: iozone.c:18781
static double
Definition: fileop.c:1281
int int argc
Definition: iozone.c:1609
char command[512]
Definition: iozone.c:21329
char * ret1
Definition: iozone.c:19608
#define _STAT_DIR_CREATE
Definition: fileop.c:93
struct stat_struct stats[_NUM_STATS]
long long ret
Definition: iozone.c:1346
char ** argv
Definition: iozone.c:1610
void file_link(int)
Definition: fileop.c:1011
int lower
Definition: fileop.c:139
void file_access(int)
Definition: fileop.c:873
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:184
char splash[80][80]
Definition: iozone.c:1394
long long y
Definition: iozone.c:1335
int i
Definition: fileop.c:140
#define _STAT_STAT
Definition: fileop.c:89
char buf[200]
Definition: iozone.c:19609
int upper
Definition: fileop.c:139
ssize_t write(int fd, const void *buf, size_t count)
Definition: appio.c:298
char thedir[PATH_MAX]
Definition: fileop.c:135
int junk
Definition: fileop.c:77
char cp[100]
Definition: iozone.c:23586
#define _STAT_UNLINK
Definition: fileop.c:87
char *long long size
Definition: iozone.c:12023
int best
Definition: fileop.c:141
int k
Definition: iozone.c:19136
double endtime
Definition: fileop.c:101
#define _STAT_ACCESS
Definition: fileop.c:90
void usage(void)
Definition: fileop.c:1330
int validate(char *, int, char)
Definition: fileop.c:1373
void file_chmod(int)
Definition: fileop.c:916
void file_create(int)
Definition: fileop.c:740
#define _STAT_LINK
Definition: fileop.c:86
char * mbuffer
Definition: fileop.c:81
double total_time
Definition: fileop.c:106
strcat(command, mountname)
#define _STAT_CREATE
Definition: fileop.c:83
void file_read(int)
Definition: fileop.c:1204
double best
Definition: fileop.c:103
double starttime
Definition: fileop.c:100
char version[]
Definition: fileop.c:134
strcpy(filename, default_filename)
char * buffer
Definition: iozone.c:1366
int range
Definition: fileop.c:139
void file_stat(int)
Definition: fileop.c:830
#define _STAT_CHMOD
Definition: fileop.c:91
int cret
Definition: fileop.c:138
#define PATH_MAX
Definition: fileop.c:68
#define _STAT_READDIR
Definition: fileop.c:92
void purge_buffer_cache()
Definition: fileop.c:147
int x
Definition: fileop.c:78
double speed
Definition: fileop.c:102
void dir_create(int)
Definition: fileop.c:594
void dir_traverse(int)
Definition: fileop.c:673
void file_unlink(int)
Definition: fileop.c:1055
int worst
Definition: fileop.c:141
static double time_so_far(void)
#define _STAT_DIR_DELETE
Definition: fileop.c:94
int system()
int excel
Definition: fileop.c:78
long j
Definition: iozone.c:19135
#define _STAT_READ
Definition: fileop.c:95
#define _NUM_STATS
Definition: fileop.c:98
size1
Definition: iozone.c:12039
int main(int argc, char **argv)
List all appio events codes and names.
int unlink()
void exit()
#define _STAT_WRITE
Definition: fileop.c:84
char * optarg
int fsync()
int dirlen
Definition: fileop.c:142
int sz
Definition: fileop.c:80
double dummy
Definition: fileop.c:105
double total_time
Definition: iozone.c:1268