PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pg_test_fsync.c File Reference
#include "postgres_fe.h"
#include <limits.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include "common/logging.h"
#include "common/pg_prng.h"
#include "getopt_long.h"
Include dependency graph for pg_test_fsync.c:

Go to the source code of this file.

Macros

#define FSYNC_FILENAME   "./pg_test_fsync.out"
 
#define XLOG_BLCKSZ_K   (XLOG_BLCKSZ / 1024)
 
#define LABEL_FORMAT   " %-30s"
 
#define NA_FORMAT   "%21s\n"
 
#define OPS_FORMAT   gettext_noop("%13.3f ops/sec %6.0f usecs/op\n")
 
#define USECS_SEC   1000000
 
#define START_TIMER
 
#define STOP_TIMER
 
#define die(msg)   pg_fatal("%s: %m", _(msg))
 

Functions

static void handle_args (int argc, char *argv[])
 
static void prepare_buf (void)
 
static void test_open (void)
 
static void test_non_sync (void)
 
static void test_sync (int writes_per_op)
 
static void test_open_syncs (void)
 
static void test_open_sync (const char *msg, int writes_size)
 
static void test_file_descriptor_sync (void)
 
static void process_alarm (SIGNAL_ARGS)
 
static void signal_cleanup (SIGNAL_ARGS)
 
static void print_elapse (struct timeval start_t, struct timeval stop_t, int ops)
 
int main (int argc, char *argv[])
 
static int open_direct (const char *path, int flags, mode_t mode)
 

Variables

static const char * progname
 
static unsigned int secs_per_test = 5
 
static int needs_unlink = 0
 
static char full_buf [DEFAULT_XLOG_SEG_SIZE]
 
static char * buf
 
static char * filename = FSYNC_FILENAME
 
static struct timeval start_t stop_t
 
static sig_atomic_t alarm_triggered = false
 

Macro Definition Documentation

◆ die

#define die (   msg)    pg_fatal("%s: %m", _(msg))

Definition at line 100 of file pg_test_fsync.c.

◆ FSYNC_FILENAME

#define FSYNC_FILENAME   "./pg_test_fsync.out"

Definition at line 30 of file pg_test_fsync.c.

◆ LABEL_FORMAT

#define LABEL_FORMAT   " %-30s"

Definition at line 34 of file pg_test_fsync.c.

◆ NA_FORMAT

#define NA_FORMAT   "%21s\n"

Definition at line 35 of file pg_test_fsync.c.

◆ OPS_FORMAT

#define OPS_FORMAT   gettext_noop("%13.3f ops/sec %6.0f usecs/op\n")

Definition at line 37 of file pg_test_fsync.c.

◆ START_TIMER

#define START_TIMER
Value:
do { \
alarm_triggered = false; \
alarm(secs_per_test); \
gettimeofday(&start_t, NULL); \
} while (0)
static unsigned int secs_per_test
Definition: pg_test_fsync.c:69

Definition at line 42 of file pg_test_fsync.c.

◆ STOP_TIMER

#define STOP_TIMER
Value:
do { \
gettimeofday(&stop_t, NULL); \
print_elapse(start_t, stop_t, ops); \
} while (0)
static struct timeval start_t stop_t
Definition: pg_test_fsync.c:74

Definition at line 60 of file pg_test_fsync.c.

◆ USECS_SEC

#define USECS_SEC   1000000

Definition at line 38 of file pg_test_fsync.c.

◆ XLOG_BLCKSZ_K

#define XLOG_BLCKSZ_K   (XLOG_BLCKSZ / 1024)

Definition at line 32 of file pg_test_fsync.c.

Function Documentation

◆ handle_args()

static void handle_args ( int  argc,
char *  argv[] 
)
static

Definition at line 147 of file pg_test_fsync.c.

148{
149 static struct option long_options[] = {
150 {"filename", required_argument, NULL, 'f'},
151 {"secs-per-test", required_argument, NULL, 's'},
152 {NULL, 0, NULL, 0}
153 };
154
155 int option; /* Command line option */
156 int optindex = 0; /* used by getopt_long */
157 unsigned long optval; /* used for option parsing */
158 char *endptr;
159
160 if (argc > 1)
161 {
162 if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
163 {
164 printf(_("Usage: %s [-f FILENAME] [-s SECS-PER-TEST]\n"), progname);
165 exit(0);
166 }
167 if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
168 {
169 puts("pg_test_fsync (PostgreSQL) " PG_VERSION);
170 exit(0);
171 }
172 }
173
174 while ((option = getopt_long(argc, argv, "f:s:",
175 long_options, &optindex)) != -1)
176 {
177 switch (option)
178 {
179 case 'f':
181 break;
182
183 case 's':
184 errno = 0;
185 optval = strtoul(optarg, &endptr, 10);
186
187 if (endptr == optarg || *endptr != '\0' ||
188 errno != 0 || optval != (unsigned int) optval)
189 {
190 pg_log_error("invalid argument for option %s", "--secs-per-test");
191 pg_log_error_hint("Try \"%s --help\" for more information.", progname);
192 exit(1);
193 }
194
195 secs_per_test = (unsigned int) optval;
196 if (secs_per_test == 0)
197 pg_fatal("%s must be in range %u..%u",
198 "--secs-per-test", 1, UINT_MAX);
199 break;
200
201 default:
202 /* getopt_long already emitted a complaint */
203 pg_log_error_hint("Try \"%s --help\" for more information.", progname);
204 exit(1);
205 }
206 }
207
208 if (argc > optind)
209 {
210 pg_log_error("too many command-line arguments (first is \"%s\")",
211 argv[optind]);
212 pg_log_error_hint("Try \"%s --help\" for more information.", progname);
213 exit(1);
214 }
215
216 printf(ngettext("%u second per test\n",
217 "%u seconds per test\n",
220#if defined(O_DIRECT)
221 printf(_("O_DIRECT supported on this platform for open_datasync and open_sync.\n"));
222#elif defined(F_NOCACHE)
223 printf(_("F_NOCACHE supported on this platform for open_datasync and open_sync.\n"));
224#else
225 printf(_("Direct I/O is not supported on this platform.\n"));
226#endif
227}
#define ngettext(s, p, n)
Definition: c.h:1135
#define _(x)
Definition: elog.c:90
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
int getopt_long(int argc, char *const argv[], const char *optstring, const struct option *longopts, int *longindex)
Definition: getopt_long.c:60
#define required_argument
Definition: getopt_long.h:25
exit(1)
#define pg_log_error(...)
Definition: logging.h:106
#define pg_log_error_hint(...)
Definition: logging.h:112
#define pg_fatal(...)
PGDLLIMPORT int optind
Definition: getopt.c:51
PGDLLIMPORT char * optarg
Definition: getopt.c:53
static char * filename
Definition: pg_test_fsync.c:73
static const char * progname
Definition: pg_test_fsync.c:67
#define printf(...)
Definition: port.h:244

References _, exit(), filename, getopt_long(), ngettext, optarg, optind, pg_fatal, pg_log_error, pg_log_error_hint, pg_strdup(), printf, progname, required_argument, and secs_per_test.

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 104 of file pg_test_fsync.c.

105{
106 pg_logging_init(argv[0]);
107 set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_test_fsync"));
108 progname = get_progname(argv[0]);
109
110 handle_args(argc, argv);
111
112 /* Prevent leaving behind the test file */
113 pqsignal(SIGINT, signal_cleanup);
114 pqsignal(SIGTERM, signal_cleanup);
115#ifndef WIN32
117#endif
118#ifdef SIGHUP
119 /* Not defined on win32 */
121#endif
122
124
125 prepare_buf();
126
127 test_open();
128
129 /* Test using 1 XLOG_BLCKSZ write */
130 test_sync(1);
131
132 /* Test using 2 XLOG_BLCKSZ writes */
133 test_sync(2);
134
136
138
140
141 unlink(filename);
142
143 return 0;
144}
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1168
uint64_t uint64
Definition: c.h:486
void set_pglocale_pgservice(const char *argv0, const char *app)
Definition: exec.c:429
void pg_logging_init(const char *argv0)
Definition: logging.c:83
void pg_prng_seed(pg_prng_state *state, uint64 seed)
Definition: pg_prng.c:89
pg_prng_state pg_global_prng_state
Definition: pg_prng.c:34
static void test_file_descriptor_sync(void)
static void prepare_buf(void)
static void test_open_syncs(void)
static void handle_args(int argc, char *argv[])
static void test_sync(int writes_per_op)
static void test_open(void)
static void test_non_sync(void)
static void process_alarm(SIGNAL_ARGS)
static void signal_cleanup(SIGNAL_ARGS)
pqsigfunc pqsignal(int signo, pqsigfunc func)
const char * get_progname(const char *argv0)
Definition: path.c:575
#define SIGHUP
Definition: win32_port.h:168
#define SIGALRM
Definition: win32_port.h:174

References filename, get_progname(), handle_args(), pg_global_prng_state, pg_logging_init(), pg_prng_seed(), PG_TEXTDOMAIN, pqsignal(), prepare_buf(), process_alarm(), progname, set_pglocale_pgservice(), SIGALRM, SIGHUP, signal_cleanup(), test_file_descriptor_sync(), test_non_sync(), test_open(), test_open_syncs(), and test_sync().

◆ open_direct()

static int open_direct ( const char *  path,
int  flags,
mode_t  mode 
)
static

Definition at line 264 of file pg_test_fsync.c.

265{
266 int fd;
267
268#ifdef O_DIRECT
269 flags |= O_DIRECT;
270#endif
271
272 fd = open(path, flags, mode);
273
274#if !defined(O_DIRECT) && defined(F_NOCACHE)
275 if (fd >= 0 && fcntl(fd, F_NOCACHE, 1) < 0)
276 {
277 int save_errno = errno;
278
279 close(fd);
280 errno = save_errno;
281 return -1;
282 }
283#endif
284
285 return fd;
286}
#define close(a)
Definition: win32.h:12
static PgChecksumMode mode
Definition: pg_checksums.c:55
static int fd(const char *x, int i)
Definition: preproc-init.c:105

References close, fd(), and mode.

Referenced by test_open_sync(), and test_sync().

◆ prepare_buf()

static void prepare_buf ( void  )
static

Definition at line 230 of file pg_test_fsync.c.

231{
232 int ops;
233
234 /* write random data into buffer */
235 for (ops = 0; ops < DEFAULT_XLOG_SEG_SIZE; ops++)
237
238 buf = (char *) TYPEALIGN(XLOG_BLCKSZ, full_buf);
239}
#define TYPEALIGN(ALIGNVAL, LEN)
Definition: c.h:758
#define DEFAULT_XLOG_SEG_SIZE
int32 pg_prng_int32(pg_prng_state *state)
Definition: pg_prng.c:243
static char full_buf[DEFAULT_XLOG_SEG_SIZE]
Definition: pg_test_fsync.c:71
static char * buf
Definition: pg_test_fsync.c:72

References buf, DEFAULT_XLOG_SEG_SIZE, full_buf, pg_global_prng_state, pg_prng_int32(), and TYPEALIGN.

Referenced by main().

◆ print_elapse()

static void print_elapse ( struct timeval  start_t,
struct timeval  stop_t,
int  ops 
)
static

Definition at line 629 of file pg_test_fsync.c.

630{
631 double total_time = (stop_t.tv_sec - start_t.tv_sec) +
632 (stop_t.tv_usec - start_t.tv_usec) * 0.000001;
633 double per_second = ops / total_time;
634 double avg_op_time_us = (total_time / ops) * USECS_SEC;
635
636 printf(_(OPS_FORMAT), per_second, avg_op_time_us);
637}
#define USECS_SEC
Definition: pg_test_fsync.c:38
#define OPS_FORMAT
Definition: pg_test_fsync.c:37

References _, OPS_FORMAT, printf, stop_t, and USECS_SEC.

◆ process_alarm()

static void process_alarm ( SIGNAL_ARGS  )
static

Definition at line 641 of file pg_test_fsync.c.

642{
643 alarm_triggered = true;
644}
static sig_atomic_t alarm_triggered
Definition: pg_test_fsync.c:76

References alarm_triggered.

Referenced by main().

◆ signal_cleanup()

static void signal_cleanup ( SIGNAL_ARGS  )
static

Definition at line 598 of file pg_test_fsync.c.

599{
600 int rc;
601
602 /* Delete the file if it exists. Ignore errors */
603 if (needs_unlink)
604 unlink(filename);
605 /* Finish incomplete line on stdout */
606 rc = write(STDOUT_FILENO, "\n", 1);
607 (void) rc; /* silence compiler warnings */
608 _exit(1);
609}
#define write(a, b, c)
Definition: win32.h:14
static int needs_unlink
Definition: pg_test_fsync.c:70
#define STDOUT_FILENO
Definition: unistd.h:8

References filename, needs_unlink, STDOUT_FILENO, and write.

Referenced by main().

◆ test_file_descriptor_sync()

static void test_file_descriptor_sync ( void  )
static

Definition at line 504 of file pg_test_fsync.c.

505{
506 int tmpfile,
507 ops;
508
509 /*
510 * Test whether fsync can sync data written on a different descriptor for
511 * the same file. This checks the efficiency of multi-process fsyncs
512 * against the same file. Possibly this should be done with writethrough
513 * on platforms which support it.
514 */
515 printf(_("\nTest if fsync on non-write file descriptor is honored:\n"));
516 printf(_("(If the times are similar, fsync() can sync data written on a different\n"
517 "descriptor.)\n"));
518
519 /*
520 * first write, fsync and close, which is the normal behavior without
521 * multiple descriptors
522 */
523 printf(LABEL_FORMAT, "write, fsync, close");
524 fflush(stdout);
525
527 for (ops = 0; alarm_triggered == false; ops++)
528 {
529 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
530 die("could not open output file");
531 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
532 die("write failed");
533 if (fsync(tmpfile) != 0)
534 die("fsync failed");
535 close(tmpfile);
536
537 /*
538 * open and close the file again to be consistent with the following
539 * test
540 */
541 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
542 die("could not open output file");
543 close(tmpfile);
544 }
546
547 /*
548 * Now open, write, close, open again and fsync This simulates processes
549 * fsyncing each other's writes.
550 */
551 printf(LABEL_FORMAT, "write, close, fsync");
552 fflush(stdout);
553
555 for (ops = 0; alarm_triggered == false; ops++)
556 {
557 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
558 die("could not open output file");
559 if (write(tmpfile, buf, XLOG_BLCKSZ) != XLOG_BLCKSZ)
560 die("write failed");
561 close(tmpfile);
562 /* reopen file */
563 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
564 die("could not open output file");
565 if (fsync(tmpfile) != 0)
566 die("fsync failed");
567 close(tmpfile);
568 }
570}
#define PG_BINARY
Definition: c.h:1227
static void const char fflush(stdout)
#define START_TIMER
Definition: pg_test_fsync.c:42
#define STOP_TIMER
Definition: pg_test_fsync.c:60
#define LABEL_FORMAT
Definition: pg_test_fsync.c:34
#define die(msg)
#define fsync(fd)
Definition: win32_port.h:85

References _, alarm_triggered, buf, close, die, fflush(), filename, fsync, LABEL_FORMAT, PG_BINARY, printf, START_TIMER, generate_unaccent_rules::stdout, STOP_TIMER, and write.

Referenced by main().

◆ test_non_sync()

static void test_non_sync ( void  )
static

Definition at line 573 of file pg_test_fsync.c.

574{
575 int tmpfile,
576 ops;
577
578 /*
579 * Test a simple write without fsync
580 */
581 printf(_("\nNon-sync'ed %dkB writes:\n"), XLOG_BLCKSZ_K);
582 printf(LABEL_FORMAT, "write");
583 fflush(stdout);
584
585 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
586 die("could not open output file");
588 for (ops = 0; alarm_triggered == false; ops++)
589 {
590 if (pg_pwrite(tmpfile, buf, XLOG_BLCKSZ, 0) != XLOG_BLCKSZ)
591 die("write failed");
592 }
594 close(tmpfile);
595}
#define XLOG_BLCKSZ_K
Definition: pg_test_fsync.c:32
#define pg_pwrite
Definition: port.h:226

References _, alarm_triggered, buf, close, die, fflush(), filename, LABEL_FORMAT, PG_BINARY, pg_pwrite, printf, START_TIMER, generate_unaccent_rules::stdout, STOP_TIMER, and XLOG_BLCKSZ_K.

Referenced by main().

◆ test_open()

static void test_open ( void  )
static

Definition at line 242 of file pg_test_fsync.c.

243{
244 int tmpfile;
245
246 /*
247 * test if we can open the target file
248 */
249 if ((tmpfile = open(filename, O_RDWR | O_CREAT | PG_BINARY, S_IRUSR | S_IWUSR)) == -1)
250 die("could not open output file");
251 needs_unlink = 1;
252 if (write(tmpfile, full_buf, DEFAULT_XLOG_SEG_SIZE) !=
254 die("write failed");
255
256 /* fsync now so that dirty buffers don't skew later tests */
257 if (fsync(tmpfile) != 0)
258 die("fsync failed");
259
260 close(tmpfile);
261}
#define S_IRUSR
Definition: win32_port.h:289
#define S_IWUSR
Definition: win32_port.h:292

References close, DEFAULT_XLOG_SEG_SIZE, die, filename, fsync, full_buf, needs_unlink, PG_BINARY, S_IRUSR, S_IWUSR, and write.

Referenced by main().

◆ test_open_sync()

static void test_open_sync ( const char *  msg,
int  writes_size 
)
static

Definition at line 468 of file pg_test_fsync.c.

469{
470#ifdef O_SYNC
471 int tmpfile,
472 ops,
473 writes;
474#endif
475
476 printf(LABEL_FORMAT, msg);
477 fflush(stdout);
478
479#ifdef O_SYNC
480 if ((tmpfile = open_direct(filename, O_RDWR | O_SYNC | PG_BINARY, 0)) == -1)
481 printf(NA_FORMAT, _("n/a*"));
482 else
483 {
485 for (ops = 0; alarm_triggered == false; ops++)
486 {
487 for (writes = 0; writes < 16 / writes_size; writes++)
488 if (pg_pwrite(tmpfile,
489 buf,
490 writes_size * 1024,
491 writes * writes_size * 1024) !=
492 writes_size * 1024)
493 die("write failed");
494 }
496 close(tmpfile);
497 }
498#else
499 printf(NA_FORMAT, _("n/a"));
500#endif
501}
#define NA_FORMAT
Definition: pg_test_fsync.c:35
static int open_direct(const char *path, int flags, mode_t mode)

References _, alarm_triggered, buf, close, die, fflush(), filename, LABEL_FORMAT, NA_FORMAT, open_direct(), PG_BINARY, pg_pwrite, printf, START_TIMER, generate_unaccent_rules::stdout, and STOP_TIMER.

Referenced by test_open_syncs().

◆ test_open_syncs()

static void test_open_syncs ( void  )
static

Definition at line 451 of file pg_test_fsync.c.

452{
453 printf(_("\nCompare open_sync with different write sizes:\n"));
454 printf(_("(This is designed to compare the cost of writing 16kB in different write\n"
455 "open_sync sizes.)\n"));
456
457 test_open_sync(_(" 1 * 16kB open_sync write"), 16);
458 test_open_sync(_(" 2 * 8kB open_sync writes"), 8);
459 test_open_sync(_(" 4 * 4kB open_sync writes"), 4);
460 test_open_sync(_(" 8 * 2kB open_sync writes"), 2);
461 test_open_sync(_("16 * 1kB open_sync writes"), 1);
462}
static void test_open_sync(const char *msg, int writes_size)

References _, printf, and test_open_sync().

Referenced by main().

◆ test_sync()

static void test_sync ( int  writes_per_op)
static

Definition at line 289 of file pg_test_fsync.c.

290{
291 int tmpfile,
292 ops,
293 writes;
294 bool fs_warning = false;
295
296 if (writes_per_op == 1)
297 printf(_("\nCompare file sync methods using one %dkB write:\n"), XLOG_BLCKSZ_K);
298 else
299 printf(_("\nCompare file sync methods using two %dkB writes:\n"), XLOG_BLCKSZ_K);
300 printf(_("(in \"wal_sync_method\" preference order, except fdatasync is Linux's default)\n"));
301
302 /*
303 * Test open_datasync if available
304 */
305 printf(LABEL_FORMAT, "open_datasync");
306 fflush(stdout);
307
308#ifdef O_DSYNC
309 if ((tmpfile = open_direct(filename, O_RDWR | O_DSYNC | PG_BINARY, 0)) == -1)
310 {
311 printf(NA_FORMAT, _("n/a*"));
312 fs_warning = true;
313 }
314 else
315 {
317 for (ops = 0; alarm_triggered == false; ops++)
318 {
319 for (writes = 0; writes < writes_per_op; writes++)
320 if (pg_pwrite(tmpfile,
321 buf,
322 XLOG_BLCKSZ,
323 writes * XLOG_BLCKSZ) != XLOG_BLCKSZ)
324 die("write failed");
325 }
327 close(tmpfile);
328 }
329#else
330 printf(NA_FORMAT, _("n/a"));
331#endif
332
333/*
334 * Test fdatasync if available
335 */
336 printf(LABEL_FORMAT, "fdatasync");
337 fflush(stdout);
338
339 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
340 die("could not open output file");
342 for (ops = 0; alarm_triggered == false; ops++)
343 {
344 for (writes = 0; writes < writes_per_op; writes++)
345 if (pg_pwrite(tmpfile,
346 buf,
347 XLOG_BLCKSZ,
348 writes * XLOG_BLCKSZ) != XLOG_BLCKSZ)
349 die("write failed");
350 fdatasync(tmpfile);
351 }
353 close(tmpfile);
354
355/*
356 * Test fsync
357 */
358 printf(LABEL_FORMAT, "fsync");
359 fflush(stdout);
360
361 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
362 die("could not open output file");
364 for (ops = 0; alarm_triggered == false; ops++)
365 {
366 for (writes = 0; writes < writes_per_op; writes++)
367 if (pg_pwrite(tmpfile,
368 buf,
369 XLOG_BLCKSZ,
370 writes * XLOG_BLCKSZ) != XLOG_BLCKSZ)
371 die("write failed");
372 if (fsync(tmpfile) != 0)
373 die("fsync failed");
374 }
376 close(tmpfile);
377
378/*
379 * If fsync_writethrough is available, test as well
380 */
381 printf(LABEL_FORMAT, "fsync_writethrough");
382 fflush(stdout);
383
384#ifdef HAVE_FSYNC_WRITETHROUGH
385 if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1)
386 die("could not open output file");
388 for (ops = 0; alarm_triggered == false; ops++)
389 {
390 for (writes = 0; writes < writes_per_op; writes++)
391 if (pg_pwrite(tmpfile,
392 buf,
393 XLOG_BLCKSZ,
394 writes * XLOG_BLCKSZ) != XLOG_BLCKSZ)
395 die("write failed");
396 if (pg_fsync_writethrough(tmpfile) != 0)
397 die("fsync failed");
398 }
400 close(tmpfile);
401#else
402 printf(NA_FORMAT, _("n/a"));
403#endif
404
405/*
406 * Test open_sync if available
407 */
408 printf(LABEL_FORMAT, "open_sync");
409 fflush(stdout);
410
411#ifdef O_SYNC
412 if ((tmpfile = open_direct(filename, O_RDWR | O_SYNC | PG_BINARY, 0)) == -1)
413 {
414 printf(NA_FORMAT, _("n/a*"));
415 fs_warning = true;
416 }
417 else
418 {
420 for (ops = 0; alarm_triggered == false; ops++)
421 {
422 for (writes = 0; writes < writes_per_op; writes++)
423 if (pg_pwrite(tmpfile,
424 buf,
425 XLOG_BLCKSZ,
426 writes * XLOG_BLCKSZ) != XLOG_BLCKSZ)
427
428 /*
429 * This can generate write failures if the filesystem has
430 * a large block size, e.g. 4k, and there is no support
431 * for O_DIRECT writes smaller than the file system block
432 * size, e.g. XFS.
433 */
434 die("write failed");
435 }
437 close(tmpfile);
438 }
439#else
440 printf(NA_FORMAT, _("n/a"));
441#endif
442
443 if (fs_warning)
444 {
445 printf(_("* This file system and its mount options do not support direct\n"
446 " I/O, e.g. ext4 in journaled mode.\n"));
447 }
448}
int fdatasync(int fildes)
int pg_fsync_writethrough(int fd)
Definition: fd.c:460
#define O_DSYNC
Definition: win32_port.h:352

References _, alarm_triggered, buf, close, die, fdatasync(), fflush(), filename, fsync, LABEL_FORMAT, NA_FORMAT, O_DSYNC, open_direct(), PG_BINARY, pg_fsync_writethrough(), pg_pwrite, printf, START_TIMER, generate_unaccent_rules::stdout, STOP_TIMER, and XLOG_BLCKSZ_K.

Referenced by main().

Variable Documentation

◆ alarm_triggered

sig_atomic_t alarm_triggered = false
static

◆ buf

char * buf
static

Definition at line 72 of file pg_test_fsync.c.

Referenced by _bt_allocbuf(), _bt_binsrch(), _bt_blnewpage(), _bt_blwritepage(), _bt_bottomupdel_pass(), _bt_checkpage(), _bt_clear_incomplete_split(), _bt_conditionallockbuf(), _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_delete_check(), _bt_delitems_vacuum(), _bt_get_endpoint(), _bt_getbuf(), _bt_getstackbuf(), _bt_insert_parent(), _bt_insertonpg(), _bt_killitems(), _bt_leftsib_splitflag(), _bt_lock_and_validate_left(), _bt_lockbuf(), _bt_moveright(), _bt_relandgetbuf(), _bt_relbuf(), _bt_rightsib_halfdeadflag(), _bt_split(), _bt_unlink_halfdead_page(), _bt_unlockbuf(), _bt_upgradelockbufcleanup(), _conv(), _CustomReadFunc(), _CustomWriteFunc(), _EndLO(), _fileExistsInDirectory(), _getObjectDescription(), _hash_addovflpage(), _hash_checkpage(), _hash_doinsert(), _hash_dropbuf(), _hash_first(), _hash_getbucketbuf_from_hashkey(), _hash_getbuf(), _hash_getbuf_with_condlock_cleanup(), _hash_getbuf_with_strategy(), _hash_getinitbuf(), _hash_getnewbuf(), _hash_init(), _hash_init_metabuffer(), _hash_initbitmapbuffer(), _hash_initbuf(), _hash_kill_items(), _hash_next(), _hash_pgaddmultitup(), _hash_pgaddtup(), _hash_readpage(), _hash_relbuf(), _hash_vacuum_one_page(), _LoadLOs(), _PG_init(), _pgfstat64(), _pglstat64(), _pgstat64(), _PrintFileData(), _ReadBuf(), _scriptOut(), _skipData(), _tarAddFile(), _tarReadRaw(), _WriteBuf(), _WriteLOData(), abbroffset(), add_cast_to(), add_role_attribute(), add_tablespace_footer(), AddBufferToRing(), AddFileToBackupManifest(), addFooterToPublicationDesc(), addunicode(), alignStringInfoInt(), AlterSequence(), append_database_pattern(), append_db_pattern_cte(), append_num_word(), append_rel_pattern_filtered_cte(), append_rel_pattern_raw_cte(), append_with_tabs(), appendAggOrderBy(), appendArrayEscapedString(), appendByteaLiteral(), appendConditions(), appendConnStrItem(), appendConnStrVal(), appendContextKeyword(), appendCSVLiteral(), appendFunctionName(), appendGroupByClause(), AppendIntegerCommandOption(), appendJSONKeyValue(), appendJSONKeyValueFmt(), appendLimitClause(), appendOrderByClause(), appendOrderBySuffix(), AppendPlainCommandOption(), appendPsqlMetaConnect(), appendQualifiedRelation(), appendShellString(), appendShellStringNoError(), AppendStringCommandOption(), appendStringLiteral(), appendStringLiteralConn(), appendStringLiteralDQ(), appendWhereClause(), array_agg_array_deserialize(), array_agg_array_serialize(), array_agg_deserialize(), array_agg_serialize(), array_desc(), array_dims(), array_recv(), array_send(), array_to_text_internal(), asyncQueueReadAllNotifications(), auth_peer(), autoprewarm_database_main(), BaseBackup(), basebackup_read_file(), bbsink_copystream_archive_contents(), bbsink_copystream_begin_archive(), bbsink_copystream_begin_backup(), bbsink_copystream_begin_manifest(), bbsink_copystream_end_archive(), be_lo_export(), bind_param_error_callback(), bit_recv(), boolrecv(), boolsend(), bootstrap_template1(), box_recv(), box_send(), bpcharrecv(), bqarr_in(), brin_desc(), brin_evacuate_page(), brin_getinsertbuffer(), brin_minmax_multi_summary_out(), brin_page_cleanup(), brin_start_evacuating_page(), brin_vacuum_scan(), brin_xlog_createidx(), brin_xlog_revmap_extend(), bringetbitmap(), brinGetTupleForHeapBlock(), brininsert(), brinSetHeapBlockItemptr(), brinsummarize(), btree_desc(), btree_xlog_dedup(), btree_xlog_split(), btvacuumpage(), buf_add_txid(), buf_finalize(), buf_init(), BufferAlloc(), BufferManagerShmemInit(), build_client_final_message(), build_client_first_message(), build_regexp_match_result(), build_regexp_split_result(), build_test_info_result(), build_test_match_result(), BuildIndexValueDescription(), BuildParamLogString(), buildWorkerCommand(), buildWorkerResponse(), bytearecv(), bzero2(), cache_locale_time(), calc_s2k_iter_salted(), calc_s2k_salted(), calc_s2k_simple(), cash_out(), cash_recv(), cash_send(), cash_words(), charrecv(), charsend(), check_backup_label_files(), check_default_text_search_config(), check_key_cksum(), check_ssl_key_file_permissions(), CheckPointTwoPhase(), CheckSASLAuth(), ChooseExtendedStatisticNameAddition(), ChooseForeignKeyConstraintNameAddition(), ChooseIndexColumnNames(), ChooseIndexNameAddition(), cidr_recv(), cidrecv(), cidsend(), circle_recv(), circle_send(), clog_desc(), CLOGShmemInit(), cluster_conn_opts(), commit_ts_desc(), CommitTsShmemInit(), compile_pltcl_function(), complex_recv(), complex_send(), concat_conninfo_dbname(), ConditionalLockBuffer(), conninfo_parse(), conninfo_uri_decode(), conninfo_uri_parse_options(), constructConnStr(), convert(), convert64(), convert_to_base(), convertJsonbScalar(), copy_read_data(), CopyGetInt16(), CopyGetInt32(), CopySendInt16(), CopySendInt32(), count_lines_in_buf(), count_nondeletable_pages(), count_spaces_until(), crc32_sz(), create_cursor(), create_database(), create_role(), create_sql_command(), createBackupLabel(), CreateDirAndVersionFile(), cstring_recv(), cstring_send(), cube_out(), cube_recv(), cube_send(), dataBeginPlaceToPage(), dataBeginPlaceToPageInternal(), dataBeginPlaceToPageLeaf(), dataExecPlaceToPage(), dataExecPlaceToPageInternal(), dataExecPlaceToPageLeaf(), dataPlaceToPageLeafRecompress(), date_out(), date_recv(), date_send(), date_test_fmt(), datum_to_json_internal(), dbase_desc(), dblink_close(), dblink_fetch(), dblink_open(), DebugPrintBufferRefcount(), DecodeAbort(), DecodeCommit(), DecodeDelete(), DecodeInsert(), DecodeMultiInsert(), DecodePrepare(), DecodeSpecConfirm(), DecodeTruncate(), DecodeTXNNeedSkip(), DecodeUpdate(), decompile_column_index_array(), decrypt_read(), default_desc(), DeleteAllExportedSnapshotFiles(), delvacuum_desc(), deparse_expression_pretty(), deparse_lquery(), deparse_ltree(), deparseAggref(), deparseAnalyzeInfoSql(), deparseAnalyzeSizeSql(), deparseAnalyzeSql(), deparseArrayExpr(), deparseBoolExpr(), deparseCaseExpr(), deparseColumnRef(), deparseConst(), deparseDeleteSql(), deparseDirectDeleteSql(), deparseDirectUpdateSql(), deparseDistinctExpr(), deparseExplicitTargetList(), deparseFromExpr(), deparseFromExprForRel(), deparseFuncExpr(), deparseInsertSql(), deparseLockingClause(), deparseNullTest(), deparseOperatorName(), deparseOpExpr(), deparseRangeTblRef(), deparseRelation(), deparseReturningList(), deparseScalarArrayOpExpr(), deparseSelectSql(), deparseSelectStmtForRel(), deparseSortGroupClause(), deparseStringLiteral(), deparseSubqueryTargetList(), deparseSubscriptingRef(), deparseTargetList(), deparseTruncateSql(), deparseUpdateSql(), desc_recompress_leaf(), describeAccessMethods(), describeAggregates(), describeConfigurationParameters(), describeDumpableObject(), describeFunctions(), DescribeLockTag(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describePublications(), DescribeQuery(), describeRoleGrants(), describeRoles(), describeSubscriptions(), describeTableDetails(), describeTablespaces(), describeTypes(), dir_write(), DispatchJobForTocEntry(), do_analyze_rel(), do_compile(), do_setval(), domain_recv(), drain(), drop_database_if_exists(), drop_role_if_exists(), dropRoles(), dsm_cleanup_for_mmap(), dummy_ssl_passwd_cb(), dump_binary(), dump_lo_buf(), dumpDatabaseConfig(), dumpLOs(), dumpRoleGUCPrivs(), dumpRoleMembership(), dumpRoles(), dumpTablespaces(), dumpTimestamp(), dumpUserConfig(), ean13_out(), ean2isn(), entryBeginPlaceToPage(), entryExecPlaceToPage(), entryIsEnoughSpace(), enum_recv(), enum_send(), err_sendstring(), escape_json(), escape_json_char(), escape_json_text(), escape_json_with_len(), escape_param_str(), escape_xml(), escape_yaml(), evaluate_backtick(), EvictUnpinnedBuffer(), ExceptionalCondition(), exec_command_password(), exec_command_sf_sv(), ExecBuildSlotPartitionKeyDescription(), ExecBuildSlotValueDescription(), ExecEvalXmlExpr(), ExecQueryAndProcessResults(), executeItemOptUnwrapTarget(), executeMetaCommand(), ExecuteSimpleCommands(), ExecuteSqlCommandBuf(), ExplainPropertyFloat(), ExplainPropertyInteger(), ExplainPropertyUInteger(), explicit_bzero(), exportFile(), ExportSnapshot(), ExtendBufferedRel(), ExtendBufferedRelLocal(), ExtendBufferedRelShared(), fe_recvint64(), fe_sendint64(), fileinfo_to_stat(), fill_seq_fork_with_data(), find_provider(), FindStreamingStart(), FinishPreparedTransaction(), flatten_reloptions(), flatten_set_variable_args(), flattenJsonPathParseItem(), float4_numeric(), float4recv(), float4send(), float8_numeric(), float8recv(), float8send(), flush_pipe_input(), FlushBuffer(), fmtlong(), format_aggregate_signature(), format_operator_extended(), format_procedure_extended(), format_type_extended(), formatPGVersionNumber(), FreePageManagerDump(), FreePageManagerDumpBtree(), FreePageManagerDumpSpans(), FreeSpaceMapPrepareTruncateRel(), fsm_readbuf(), fsm_search(), fsm_search_avail(), fsm_set_and_search(), fsm_vacuum_page(), generate_opclass_name(), generate_operator_clause(), generate_operator_name(), generate_trgm_only(), generate_wildcard_trgm(), generic_desc(), get_agg_expr_helper(), get_base_conninfo(), get_basic_select_query(), get_coercion_expr(), get_collation_actual_version(), get_column_alias_list(), get_connect_string(), get_const_collation(), get_const_expr(), get_create_object_cmd(), get_delete_query_def(), get_eol_offset(), get_from_clause(), get_from_clause_coldeflist(), get_from_clause_item(), get_func_expr(), get_func_sql_syntax(), get_home_path(), get_insert_query_def(), get_json_constructor(), get_json_constructor_options(), get_json_format(), get_json_returning(), get_json_table(), get_json_table_columns(), get_merge_query_def(), get_modifiers(), get_opclass_name(), get_oper_expr(), get_parallel_object_list(), get_prompt(), get_query_def(), get_range_partbound_string(), get_raw_page_internal(), get_reloptions(), get_rule_expr(), get_rule_expr_funccall(), get_rule_groupingset(), get_rule_orderby(), get_rule_sortgroupclause(), get_rule_windowclause(), get_rule_windowspec(), get_select_query_def(), get_setop_query(), get_special_variable(), get_sql_delete(), get_sql_insert(), get_sql_update(), get_sub_conninfo(), get_sublink_expr(), get_tablesample_def(), get_target_list(), get_tuple_of_interest(), get_update_query_def(), get_update_query_targetlist_def(), get_utility_query_def(), get_values_def(), get_variable(), get_wildcard_part(), get_windowfunc_expr_helper(), get_with_clause(), get_xmltable(), GetBufferFromRing(), GetHugePageSize(), GetRecordedFreeSpace(), GetVictimBuffer(), GetWALBlockInfo(), gin_desc(), ginCompressPostingList(), gist_desc(), gist_indexsortbuild_levelstate_flush(), gist_page_items(), gistcheckpage(), gistfixsplit(), gistformdownlink(), gnuish_strerror_r(), handleCopyIn(), handleCopyOut(), HandleUploadManifestPacket(), hash_desc(), hash_xlog_split_page(), hashbpchar(), hashbpcharextended(), hashbucketcleanup(), hashbulkdelete(), hashtext(), hashtextextended(), heap2_decode(), heap2_desc(), heap_decode(), heap_desc(), heap_force_common(), heap_index_delete_tuples(), heap_lock_updated_tuple_rec(), heap_page_is_all_visible(), heap_vacuum_rel(), heapam_relation_copy_for_cluster(), helpVariables(), hladdword(), hlfinditem(), hlparsetext(), hmac_finish(), hstore_recv(), hstore_send(), hstorePairs(), ignore_boolean_expression(), importFile(), indent_lines(), inet_recv(), infile(), infobits_desc(), initialize_SSL(), initialize_worker_spi(), InitializeShmemGUCs(), InitLocalBuffers(), int2recv(), int2send(), int2vectorrecv(), int4recv(), int4send(), int8_avg_deserialize(), int8_avg_serialize(), int8out(), int8recv(), int8send(), internal_flush_buffer(), interval_avg_deserialize(), interval_avg_serialize(), interval_out(), interval_recv(), interval_send(), inv_read(), inv_write(), InvalidateBuffer(), is_true_boolean_expression(), isn_out(), IssueACLPerBlob(), IssueCommandPerBlob(), json_recv(), json_send(), jsonb_agg_transfn_worker(), jsonb_object_agg_transfn_worker(), jsonb_recv(), jsonb_send(), JsonEncodeDateTime(), jsonpath_recv(), jsonpath_send(), jsonPathFromCstring(), jsonPathToCstring(), KnownAssignedXidsDisplay(), lazy_scan_heap(), lazy_scan_new_or_empty(), lazy_scan_noprune(), lazy_scan_prune(), lazy_vacuum_heap_rel(), libpqrcv_get_conninfo(), line_recv(), line_send(), listAllDbs(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtendedStats(), listExtensionContents(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listLargeObjects(), listOneExtensionContents(), listOperatorClasses(), listOperatorFamilies(), listOpFamilyFunctions(), listOpFamilyOperators(), listPartitionedTables(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSConfigsVerbose(), listTSDictionaries(), listTSParsers(), listTSParsersVerbose(), listTSTemplates(), listUserMappings(), llvm_create_types(), lo_export(), lo_import_internal(), lo_read(), lo_write(), load_module(), load_resultmap(), local_queue_fetch_file(), local_queue_fetch_range(), locale_date_order(), LockBuffer(), log_line_prefix(), log_newpage_range(), log_split_page(), log_status_format(), LogicalDecodingProcessRecord(), logicalmsg_decode(), logicalmsg_desc(), LogicalRepApplyLoop(), LogRecoveryConflict(), LookupGXact(), lquery_in(), lquery_recv(), lquery_send(), lseg_recv(), lseg_send(), ltree_crc32_sz(), ltree_in(), ltree_recv(), ltree_send(), ltxtq_recv(), ltxtq_send(), macaddr8_recv(), macaddr8_send(), macaddr_recv(), macaddr_send(), main(), make_absolute_path(), make_ruledef(), make_viewdef(), makeAlterConfigCommand(), makeMultirangeTypeName(), map_sql_identifier_to_xml_name(), map_sql_value_to_xml_value(), map_xml_name_to_sql_identifier(), MatchText(), mbuf_append(), multirange_out(), multirange_recv(), multirange_send(), multixact_desc(), mxid_to_string(), namerecv(), namesend(), network_recv(), network_send(), next_field_expand(), next_token(), nextval_internal(), NotifyMyFrontEnd(), numeric_abbrev_convert(), numeric_avg_deserialize(), numeric_avg_serialize(), numeric_deserialize(), numeric_poly_deserialize(), numeric_poly_serialize(), numeric_recv(), numeric_send(), numeric_serialize(), numericvar_deserialize(), numericvar_serialize(), objectDescription(), offset_elem_desc(), oid_elem_desc(), OidReceiveFunctionCall(), oidrecv(), oidsend(), oidvectorrecv(), out_gistxlogDelete(), out_gistxlogPageDelete(), out_gistxlogPageReuse(), out_gistxlogPageSplit(), out_member(), outDouble(), overwrite(), pad_eme_pkcs1_v15(), parse_backup_label(), parse_literal_data(), parse_lquery(), parse_ltree(), parse_snapshot(), parse_tsquery(), parseAclItem(), parseServiceFile(), parsetext(), passwordFromFile(), path_recv(), path_send(), patternToSQLRegex(), PerformWalRecovery(), permissionsList(), pg_armor(), pg_b64_decode(), pg_b64_encode(), pg_base64_decode(), pg_base64_encode(), pg_buffercache_evict(), pg_dearmor(), pg_fe_getusername(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_constraintdef_worker(), pg_get_function_arguments(), pg_get_function_identity_arguments(), pg_get_function_result(), pg_get_function_sqlbody(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_line(), pg_get_line_append(), pg_get_line_buf(), pg_get_partkeydef_worker(), pg_get_querydef(), pg_get_ruledef_worker(), pg_get_sequence_data(), pg_get_statisticsobj_worker(), pg_get_triggerdef_worker(), pg_get_viewdef_worker(), pg_get_wait_events(), pg_log_filter_error(), pg_log_generic_v(), pg_lsn_mi(), pg_lsn_mii(), pg_lsn_out(), pg_lsn_pli(), pg_lsn_recv(), pg_lsn_send(), pg_md5_encrypt(), pg_popcount(), pg_popcount_masked(), pg_popcount_masked_optimized(), pg_popcount_masked_slow(), pg_popcount_optimized(), pg_popcount_slow(), pg_pread(), pg_prewarm(), pg_pwrite(), pg_saslprep(), pg_sequence_last_value(), pg_size_pretty(), pg_snapshot_recv(), pg_snapshot_send(), pg_split_walfile_name(), pg_stat_get_wal(), pg_stat_statements_internal(), pg_strerror_r(), pg_strong_random(), pgconn_bio_read(), pgconn_bio_write(), pgp_armor_decode(), pgp_encrypt(), pgp_extract_armor_headers(), pgp_key_id_w(), pgp_mpi_hash(), pgp_mpi_write(), pgrowlocks(), pgstat_btree_page(), pgstat_gist_page(), pgstat_hash_page(), pgstathashindex(), PGTYPESdate_to_asc(), PGTYPESinterval_to_asc(), PGTYPESnumeric_div(), PGTYPEStimestamp_to_asc(), pgwin32_recv(), pgwin32_select(), pgwin32_send(), pgwin32_waitforsinglesocket(), pgxmlNodeSetToText(), pickout(), PinBuffer(), PinBuffer_Locked(), plan_elem_desc(), plpgsql_append_source_text(), PLy_exception_set(), PLy_exception_set_plural(), point_recv(), point_send(), poly_recv(), poly_send(), populate_scalar(), port_bio_read(), port_bio_write(), postgresImportForeignSchema(), PostgresMain(), pq_beginmessage(), pq_beginmessage_reuse(), pq_begintypsend(), pq_copymsgbytes(), pq_endmessage(), pq_endmessage_reuse(), pq_endtypsend(), pq_send_ascii_string(), pq_sendbyte(), pq_sendbytes(), pq_sendcountedtext(), pq_sendfloat4(), pq_sendfloat8(), pq_sendint(), pq_sendint16(), pq_sendint32(), pq_sendint64(), pq_sendint8(), pq_sendstring(), pq_sendtext(), pq_writeint16(), pq_writeint32(), pq_writeint64(), pq_writeint8(), pq_writestring(), PQcancel(), PQchangePassword(), PQdefaultSSLKeyPassHook_OpenSSL(), pqGetHomeDirectory(), pqGetNegotiateProtocolVersion3(), pqGets(), pqGets_append(), pqGets_internal(), PQoidStatus(), pqPacketSend(), pqPutMsgBytes(), PQssl_passwd_cb(), prefix_init(), prepare_buf(), PrepareRedoAdd(), PrescanPreparedTransactions(), print_function_arguments(), print_function_rettype(), print_function_sqlbody(), print_function_trftypes(), print_wchar_str(), printACLColumn(), printJsonPathItem(), PrintQueryStatus(), printRemoteParam(), printRemotePlaceholder(), printsimple(), printsimple_startup(), printSubscripts(), printtup(), printVerboseErrorMessages(), process_file(), process_pgfdw_appname(), process_pipe_input(), processIndirection(), processSQLNamePattern(), ProcessStartupPacket(), ProcessTwoPhaseBuffer(), ProcSleep(), psql_add_command(), psql_end_command(), psql_get_variable(), psql_start_command(), puttzcode(), puttzcodepass(), pvsnprintf(), pwdfMatchesString(), px_crypt(), px_debug(), px_find_combo(), px_gen_salt(), qtext_load_file(), queryin(), quote_qualified_identifier(), range_bound_escape(), range_deparse(), range_parse_bound(), range_recv(), range_send(), read_binary_file(), read_file_contents(), read_pg_version_file(), read_seq_tuple(), read_text_file(), read_whole_file(), ReadArrayBinary(), ReadBufferExtended(), ReadDataFromArchiveNone(), ReadStr(), ReadTwoPhaseFile(), ReadyForQuery(), rebuildInsertSql(), ReceiveBackupManifestInMemory(), ReceiveBackupManifestInMemoryChunk(), ReceiveCopyBegin(), ReceiveFunctionCall(), ReceiveTarFile(), record_in(), record_out(), record_recv(), record_send(), RecoverPreparedTransactions(), recv_password_packet(), redirect_elem_desc(), regression_main(), RelationCopyStorage(), RelationCopyStorageUsingBuffer(), relmap_desc(), repairDependencyLoop(), replace_text_regexp(), replorigin_desc(), report_invalid_encoding(), report_untranslatable_char(), ReportWalSummaryError(), reserveSpaceForItemPointer(), ResetSequence(), restore(), restoreTwoPhaseData(), revmap_physical_extend(), ri_GenerateQual(), ri_GenerateQualCollation(), rm_redo_error_callback(), rot13_passphrase(), run_crypt_bf(), run_crypt_des(), run_crypt_md5(), run_ssl_passphrase_command(), sanitize_char(), sanitize_str(), scan_file(), scan_profile(), ScanSourceDatabasePgClass(), ScanSourceDatabasePgClassPage(), scram_get_mechanisms(), search_directory(), secure_open_server(), send_message_to_frontend(), send_message_to_server_log(), sendAuthRequest(), SendCopyBegin(), SendCopyOutResponse(), SendFunctionResult(), SendNegotiateProtocolVersion(), SendQuery(), SendRowDescriptionMessage(), SendTimeLineHistory(), sepgsql_audit_log(), seq_desc(), SequenceChangePersistence(), serialize_deflist(), serializeAnalyzeReceive(), set_backtrace(), setFilePath(), SetShellResultVariables(), show_data_directory_mode(), show_log_file_mode(), show_sortorder_options(), show_unix_socket_permissions(), ShowTransactionStateRec(), simple_quote_literal(), slashUsage(), slurp_file(), smgr_bulk_write(), smgr_desc(), spg_desc(), spgbuildempty(), SPI_result_code_string(), SplitToVariants(), ssl_extension_info(), ssl_external_passwd_cb(), SSLerrfree(), standby_decode(), standby_desc(), standby_desc_invalidations(), standby_desc_running_xacts(), StandbyRecoverPreparedTransactions(), StandbyTransactionIdIsPrepared(), StartBufferIO(), StartLogicalReplication(), StartReplication(), statapprox_heap(), stop_postmaster(), str_time(), StrategyFreeBuffer(), StrategyGetBuffer(), StrategyRejectBuffer(), string2ean(), string_agg_deserialize(), string_agg_serialize(), stringinfo_to_xmltype(), strncoll_libc(), strnxfrm_libc(), SUBTRANSShmemInit(), syntax_error(), tar_write(), tarRead(), tarWrite(), tblspc_desc(), TerminateBufferIO(), test_dsa_basic(), test_file_descriptor_sync(), test_non_sync(), test_open_sync(), test_sync(), testcustomrmgrs_desc(), text_format_append_string(), text_format_string_conversion(), textrecv(), textsend(), tidout(), tidrecv(), tidsend(), time_out(), time_recv(), time_send(), timeofday(), timestamp_out(), timestamp_recv(), timestamp_send(), timestamptz_out(), timestamptz_recv(), timestamptz_send(), timestamptz_to_str(), timetz_out(), timetz_recv(), timetz_send(), tokenize_auth_file(), truncate_flags_desc(), ts_stat_sql(), tsquery_rewrite_query(), tsqueryrecv(), tsquerysend(), tsvectorin(), tsvectorrecv(), tsvectorsend(), tuplesort_readtup_alloc(), unaccent_lexize(), unicode_normalize_func(), uniqueentry(), unknownrecv(), unknownsend(), UnlockBuffers(), unpack_sql_state(), UnpinBuffer(), UnpinBufferNoOwner(), UploadManifest(), usage(), uuid_generate_v1mc(), uuid_out(), vacuum_one_database(), vacuumlo(), validate_exec(), validateSQLNamePattern(), varbit_recv(), varbit_send(), varcharrecv(), verifyBackupPageConsistency(), vm_extend(), vm_readbuf(), void_send(), WaitBufHdrUnlocked(), WaitForCommands(), WaitIO(), WALRead(), WalReceiverMain(), WordEntryCMP(), worker_spi_main(), write_auto_conf_file(), write_backup_label(), write_csvlog(), write_jsonlog(), write_target_range(), xact_decode(), xact_desc(), xact_desc_abort(), xact_desc_assignment(), xact_desc_commit(), xact_desc_prepare(), xact_desc_relations(), xact_desc_stats(), xact_desc_subxacts(), xid8recv(), xid8send(), xidrecv(), xidsend(), xlog_block_info(), xlog_decode(), xlog_desc(), xlog_outdesc(), XLogInitBufferForRedo(), XLogInsertRecord(), XLogReadBufferForRedo(), XLogReadBufferForRedoExtended(), XlogReadTwoPhaseData(), XLogRecGetBlockRefInfo(), XLogRecordPageWithFreeSpace(), XLogRecordSaveFPWs(), XLOGShmemSize(), XLogWalRcvProcessMsg(), XLogWalRcvWrite(), xml_out_internal(), xml_recv(), xml_send(), xmlcomment(), xmlconcat(), xmlelement(), xmlpi(), xmlroot(), and xmltotext_with_options().

◆ filename

◆ full_buf

char full_buf[DEFAULT_XLOG_SEG_SIZE]
static

Definition at line 71 of file pg_test_fsync.c.

Referenced by prepare_buf(), and test_open().

◆ needs_unlink

int needs_unlink = 0
static

Definition at line 70 of file pg_test_fsync.c.

Referenced by signal_cleanup(), and test_open().

◆ progname

const char* progname
static

Definition at line 67 of file pg_test_fsync.c.

Referenced by handle_args(), and main().

◆ secs_per_test

unsigned int secs_per_test = 5
static

Definition at line 69 of file pg_test_fsync.c.

Referenced by handle_args().

◆ stop_t

struct timeval start_t stop_t
static

Definition at line 75 of file pg_test_fsync.c.

Referenced by print_elapse().