3030
3131#define WRITE_SIZE (8 * 1024)/* 8k */
3232
33- #define LABEL_FORMAT "\t%-30s"
33+ #define LABEL_FORMAT " %-32s"
34+ #define NA_FORMAT LABEL_FORMAT "%18s"
3435
3536
3637int loops = 2000 ;
@@ -129,7 +130,7 @@ main(int argc, char *argv[])
129130#if PG_O_DIRECT != 0
130131fflush (stdout );
131132if ((tmpfile = open (filename ,O_RDWR |O_DSYNC |PG_O_DIRECT ,0 ))== -1 )
132- printf ("\t(unavailable: o_direct on this filesystem) \n" );
133+ printf (NA_FORMAT , " o_direct" , "n/a on this filesystem\n" );
133134else
134135{
135136printf (LABEL_FORMAT ,"open_datasync 8k direct I/O write" );
@@ -146,11 +147,11 @@ main(int argc, char *argv[])
146147print_elapse (start_t ,stop_t );
147148}
148149#else
149- printf ("\t(unavailable: o_direct) \n" );
150+ printf (NA_FORMAT , " o_direct" , "n/a \n" );
150151#endif
151152
152153#else
153- printf ("\t(unavailable: open_datasync) \n" );
154+ printf (NA_FORMAT , " open_datasync" , "n/a \n" );
154155#endif
155156
156157/*
@@ -180,7 +181,7 @@ main(int argc, char *argv[])
180181printf (LABEL_FORMAT ,"open_sync 8k direct I/O write" );
181182fflush (stdout );
182183if ((tmpfile = open (filename ,O_RDWR |OPEN_SYNC_FLAG |PG_O_DIRECT ,0 ))== -1 )
183- printf ("\t(unavailable: o_direct on this filesystem) \n" );
184+ printf (NA_FORMAT , " o_direct" , "n/a on this filesystem\n" );
184185else
185186{
186187gettimeofday (& start_t ,NULL );
@@ -196,11 +197,11 @@ main(int argc, char *argv[])
196197print_elapse (start_t ,stop_t );
197198}
198199#else
199- printf ("\t(unavailable: o_direct) \n" );
200+ printf (NA_FORMAT , " o_direct" , "n/a \n" );
200201#endif
201202
202203#else
203- printf ("\t(unavailable: open_sync) \n" );
204+ printf (NA_FORMAT , " open_sync" , "n/a \n" );
204205#endif
205206
206207/*
@@ -224,7 +225,7 @@ main(int argc, char *argv[])
224225close (tmpfile );
225226print_elapse (start_t ,stop_t );
226227#else
227- printf ("\t(unavailable: fdatasync) \n" );
228+ printf (NA_FORMAT , " fdatasync" , "n/a \n" );
228229#endif
229230
230231/*
@@ -270,7 +271,7 @@ main(int argc, char *argv[])
270271close (tmpfile );
271272print_elapse (start_t ,stop_t );
272273#else
273- printf ("\t(unavailable: fsync_writethrough) \n" );
274+ printf (NA_FORMAT , " fsync_writethrough" , "n/a \n" );
274275#endif
275276
276277/*
@@ -320,11 +321,11 @@ main(int argc, char *argv[])
320321close (tmpfile );
321322print_elapse (start_t ,stop_t );
322323#else
323- printf ("\t(unavailable: o_direct) \n" );
324+ printf (NA_FORMAT , " o_direct" "n/a \n" );
324325#endif
325326
326327#else
327- printf ("\t(unavailable: open_datasync) \n" );
328+ printf (NA_FORMAT , " open_datasync" , "n/a \n" );
328329#endif
329330
330331/*
@@ -368,11 +369,11 @@ main(int argc, char *argv[])
368369close (tmpfile );
369370print_elapse (start_t ,stop_t );
370371#else
371- printf ("\t(unavailable: o_direct) \n" );
372+ printf (NA_FORMAT , " o_direct" , "n/a \n" );
372373#endif
373374
374375#else
375- printf ("\t(unavailable: open_sync) \n" );
376+ printf (NA_FORMAT , " open_sync" , "n/a \n" );
376377#endif
377378
378379/*
@@ -398,7 +399,7 @@ main(int argc, char *argv[])
398399close (tmpfile );
399400print_elapse (start_t ,stop_t );
400401#else
401- printf ("\t(unavailable: fdatasync) \n" );
402+ printf (NA_FORMAT , " fdatasync" , "n/a \n" );
402403#endif
403404
404405/*
@@ -448,7 +449,7 @@ main(int argc, char *argv[])
448449close (tmpfile );
449450print_elapse (start_t ,stop_t );
450451#else
451- printf ("\t(unavailable: fsync_writethrough) \n" );
452+ printf (NA_FORMAT , " fsync_writethrough" , "n/a \n" );
452453#endif
453454
454455/*
@@ -496,7 +497,7 @@ main(int argc, char *argv[])
496497close (tmpfile );
497498print_elapse (start_t ,stop_t );
498499#else
499- printf ("\t(unavailable: open_sync) \n" );
500+ printf (NA_FORMAT , " open_sync" , "n/a \n" );
500501#endif
501502
502503/*
@@ -581,7 +582,7 @@ print_elapse(struct timeval start_t, struct timeval stop_t)
581582(stop_t .tv_usec - start_t .tv_usec )* 0.000001 ;
582583double per_second = loops /total_time ;
583584
584- printf ("%9.3f/second \n" ,per_second );
585+ printf ("%9.3f ops/sec \n" ,per_second );
585586}
586587
587588void