Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3ab80cfe
Commit
3ab80cfe
authored
Jan 15, 2011
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve output display of test_fsync.
parent
677b06ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
src/tools/fsync/test_fsync.c
src/tools/fsync/test_fsync.c
+18
-17
No files found.
src/tools/fsync/test_fsync.c
View file @
3ab80cfe
...
...
@@ -30,7 +30,8 @@
#define WRITE_SIZE (8 * 1024)
/* 8k */
#define LABEL_FORMAT "\t%-30s"
#define LABEL_FORMAT " %-32s"
#define NA_FORMAT LABEL_FORMAT "%18s"
int
loops
=
2000
;
...
...
@@ -129,7 +130,7 @@ main(int argc, char *argv[])
#if PG_O_DIRECT != 0
fflush
(
stdout
);
if
((
tmpfile
=
open
(
filename
,
O_RDWR
|
O_DSYNC
|
PG_O_DIRECT
,
0
))
==
-
1
)
printf
(
"
\t
(unavailable: o_direct on this filesystem)
\n
"
);
printf
(
NA_FORMAT
,
"o_direct"
,
"n/a on this filesystem
\n
"
);
else
{
printf
(
LABEL_FORMAT
,
"open_datasync 8k direct I/O write"
);
...
...
@@ -146,11 +147,11 @@ main(int argc, char *argv[])
print_elapse
(
start_t
,
stop_t
);
}
#else
printf
(
"
\t
(unavailable: o_direct)
\n
"
);
printf
(
NA_FORMAT
,
"o_direct"
,
"n/a
\n
"
);
#endif
#else
printf
(
"
\t
(unavailable: open_datasync)
\n
"
);
printf
(
NA_FORMAT
,
"open_datasync"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -180,7 +181,7 @@ main(int argc, char *argv[])
printf
(
LABEL_FORMAT
,
"open_sync 8k direct I/O write"
);
fflush
(
stdout
);
if
((
tmpfile
=
open
(
filename
,
O_RDWR
|
OPEN_SYNC_FLAG
|
PG_O_DIRECT
,
0
))
==
-
1
)
printf
(
"
\t
(unavailable: o_direct on this filesystem)
\n
"
);
printf
(
NA_FORMAT
,
"o_direct"
,
"n/a on this filesystem
\n
"
);
else
{
gettimeofday
(
&
start_t
,
NULL
);
...
...
@@ -196,11 +197,11 @@ main(int argc, char *argv[])
print_elapse
(
start_t
,
stop_t
);
}
#else
printf
(
"
\t
(unavailable: o_direct)
\n
"
);
printf
(
NA_FORMAT
,
"o_direct"
,
"n/a
\n
"
);
#endif
#else
printf
(
"
\t
(unavailable: open_sync)
\n
"
);
printf
(
NA_FORMAT
,
"open_sync"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -224,7 +225,7 @@ main(int argc, char *argv[])
close
(
tmpfile
);
print_elapse
(
start_t
,
stop_t
);
#else
printf
(
"
\t
(unavailable: fdatasync)
\n
"
);
printf
(
NA_FORMAT
,
"fdatasync"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -270,7 +271,7 @@ main(int argc, char *argv[])
close
(
tmpfile
);
print_elapse
(
start_t
,
stop_t
);
#else
printf
(
"
\t
(unavailable: fsync_writethrough)
\n
"
);
printf
(
NA_FORMAT
,
"fsync_writethrough"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -320,11 +321,11 @@ main(int argc, char *argv[])
close
(
tmpfile
);
print_elapse
(
start_t
,
stop_t
);
#else
printf
(
"
\t
(unavailable: o_direct)
\n
"
);
printf
(
NA_FORMAT
,
"o_direct"
"n/a
\n
"
);
#endif
#else
printf
(
"
\t
(unavailable: open_datasync)
\n
"
);
printf
(
NA_FORMAT
,
"open_datasync"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -368,11 +369,11 @@ main(int argc, char *argv[])
close
(
tmpfile
);
print_elapse
(
start_t
,
stop_t
);
#else
printf
(
"
\t
(unavailable: o_direct)
\n
"
);
printf
(
NA_FORMAT
,
"o_direct"
,
"n/a
\n
"
);
#endif
#else
printf
(
"
\t
(unavailable: open_sync)
\n
"
);
printf
(
NA_FORMAT
,
"open_sync"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -398,7 +399,7 @@ main(int argc, char *argv[])
close
(
tmpfile
);
print_elapse
(
start_t
,
stop_t
);
#else
printf
(
"
\t
(unavailable: fdatasync)
\n
"
);
printf
(
NA_FORMAT
,
"fdatasync"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -448,7 +449,7 @@ main(int argc, char *argv[])
close
(
tmpfile
);
print_elapse
(
start_t
,
stop_t
);
#else
printf
(
"
\t
(unavailable: fsync_writethrough)
\n
"
);
printf
(
NA_FORMAT
,
"fsync_writethrough"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -496,7 +497,7 @@ main(int argc, char *argv[])
close
(
tmpfile
);
print_elapse
(
start_t
,
stop_t
);
#else
printf
(
"
\t
(unavailable: open_sync)
\n
"
);
printf
(
NA_FORMAT
,
"open_sync"
,
"n/a
\n
"
);
#endif
/*
...
...
@@ -581,7 +582,7 @@ print_elapse(struct timeval start_t, struct timeval stop_t)
(
stop_t
.
tv_usec
-
start_t
.
tv_usec
)
*
0
.
000001
;
double
per_second
=
loops
/
total_time
;
printf
(
"%9.3f
/second
\n
"
,
per_second
);
printf
(
"%9.3f
ops/sec
\n
"
,
per_second
);
}
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment