|
20 | 20 | */ |
21 | 21 | #defineFSYNC_FILENAME"./pg_test_fsync.out" |
22 | 22 |
|
23 | | -#ifXLOG_BLCKSZ!=8*1024/* 8k */ |
24 | | -#error Unknown block size for test. |
25 | | -#endif |
| 23 | +#defineXLOG_BLCKSZ_K(XLOG_BLCKSZ / 1024) |
26 | 24 |
|
27 | 25 | #defineLABEL_FORMAT" %-32s" |
28 | 26 | #defineNA_FORMATLABEL_FORMAT "%18s" |
@@ -61,10 +59,10 @@ main(int argc, char *argv[]) |
61 | 59 |
|
62 | 60 | test_open(); |
63 | 61 |
|
64 | | -/* Test using 18k write */ |
| 62 | +/* Test using 1XLOG_BLCKSZ write */ |
65 | 63 | test_sync(1); |
66 | 64 |
|
67 | | -/* Test using 28k writes */ |
| 65 | +/* Test using 2XLOG_BLCKSZ writes */ |
68 | 66 | test_sync(2); |
69 | 67 |
|
70 | 68 | test_open_syncs(); |
@@ -177,9 +175,9 @@ test_sync(int writes_per_op) |
177 | 175 | boolfs_warning= false; |
178 | 176 |
|
179 | 177 | if (writes_per_op==1) |
180 | | -printf("\nCompare file sync methods using one8k write:\n"); |
| 178 | +printf("\nCompare file sync methods using one%dk write:\n",XLOG_BLCKSZ_K); |
181 | 179 | else |
182 | | -printf("\nCompare file sync methods using two8k writes:\n"); |
| 180 | +printf("\nCompare file sync methods using two%dk writes:\n",XLOG_BLCKSZ_K); |
183 | 181 | printf("(in wal_sync_method preference order, except fdatasync\n"); |
184 | 182 | printf("is Linux's default)\n"); |
185 | 183 |
|
@@ -396,11 +394,11 @@ test_open_syncs(void) |
396 | 394 | printf("(This is designed to compare the cost of writing 16k\n"); |
397 | 395 | printf("in different write open_sync sizes.)\n"); |
398 | 396 |
|
399 | | -test_open_sync(" 116k open_sync write",16); |
400 | | -test_open_sync("28k open_sync writes",8); |
401 | | -test_open_sync("44k open_sync writes",4); |
402 | | -test_open_sync("82k open_sync writes",2); |
403 | | -test_open_sync("16 1k open_sync writes",1); |
| 397 | +test_open_sync("16k open_sync write",16); |
| 398 | +test_open_sync(" 8k open_sync writes",8); |
| 399 | +test_open_sync(" 4k open_sync writes",4); |
| 400 | +test_open_sync(" 2k open_sync writes",2); |
| 401 | +test_open_sync(" 1k open_sync writes",1); |
404 | 402 | } |
405 | 403 |
|
406 | 404 | /* |
@@ -519,7 +517,7 @@ test_non_sync(void) |
519 | 517 | /* |
520 | 518 | * Test a simple write without fsync |
521 | 519 | */ |
522 | | -printf("\nNon-sync'ed8k writes:\n"); |
| 520 | +printf("\nNon-sync'ed%dk writes:\n",XLOG_BLCKSZ_K); |
523 | 521 | printf(LABEL_FORMAT,"write"); |
524 | 522 | fflush(stdout); |
525 | 523 |
|
|