@@ -55,7 +55,7 @@ ____________________________________________________________________________-->
55
55
56
56
<!--==========================orignal english content==========================
57
57
<para>
58
- <application>pg_test_timing</> is a tool to measure the timing overhead
58
+ <application>pg_test_timing</application > is a tool to measure the timing overhead
59
59
on your system and confirm that the system time never moves backwards.
60
60
Systems that are slow to collect timing data can give less accurate
61
61
<command>EXPLAIN ANALYZE</command> results.
@@ -93,8 +93,8 @@ ____________________________________________________________________________-->
93
93
</varlistentry>
94
94
95
95
<varlistentry>
96
- <term><option>-V</></term>
97
- <term><option>-−version</></term>
96
+ <term><option>-V</option ></term>
97
+ <term><option>-−version</option ></term>
98
98
<listitem>
99
99
<para>
100
100
Print the <application>pg_test_timing</application> version and exit.
@@ -103,8 +103,8 @@ ____________________________________________________________________________-->
103
103
</varlistentry>
104
104
105
105
<varlistentry>
106
- <term><option>-?</></term>
107
- <term><option>-−help</></term>
106
+ <term><option>-?</option ></term>
107
+ <term><option>-−help</option ></term>
108
108
<listitem>
109
109
<para>
110
110
Show help about <application>pg_test_timing</application> command line
@@ -175,7 +175,7 @@ ____________________________________________________________________________-->
175
175
nanoseconds. This example from an Intel i7-860 system using a TSC clock
176
176
source shows excellent performance:
177
177
178
- <screen>
178
+ <screen><![CDATA[
179
179
Testing timing overhead for 3 seconds.
180
180
Per loop time including overhead: 35.96 ns
181
181
Histogram of timing durations:
@@ -185,13 +185,13 @@ Histogram of timing durations:
185
185
4 0.00015 126
186
186
8 0.00002 13
187
187
16 0.00000 2
188
- </screen>
188
+ ]]> </screen>
189
189
</para>
190
190
____________________________________________________________________________-->
191
191
<para>
192
192
好的结果将显示大部分(>90%)的单个计时调用用时都小于 1 微秒。每次循环的平均开销将会更低,低于 100 纳秒。下面的例子来自于一台使用了一份 TSC 时钟源码的 Intel i7-860 系统,它展示了非常好的性能:
193
193
194
- <screen>
194
+ <screen><![CDATA[
195
195
Testing timing overhead for 3 seconds.
196
196
Per loop time including overhead: 35.96 ns
197
197
Histogram of timing durations:
@@ -201,7 +201,7 @@ Histogram of timing durations:
201
201
4 0.00015 126
202
202
8 0.00002 13
203
203
16 0.00000 2
204
- </screen>
204
+ ]]> </screen>
205
205
</para>
206
206
207
207
<!--==========================orignal english content==========================
@@ -278,7 +278,7 @@ ____________________________________________________________________________-->
278
278
possible from switching to the slower acpi_pm time source, on the same
279
279
system used for the fast results above:
280
280
281
- <screen>
281
+ <screen><![CDATA[
282
282
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
283
283
tsc hpet acpi_pm
284
284
# echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource
@@ -291,13 +291,13 @@ Histogram of timing durations:
291
291
4 0.07810 3241
292
292
8 0.01357 563
293
293
16 0.00007 3
294
- </screen>
294
+ ]]> </screen>
295
295
</para>
296
296
____________________________________________________________________________-->
297
297
<para>
298
298
在一些较新的 Linux 系统上,可以在任何时候更改用来收集计时数据的时钟来源。第二个例子显示了在上述快速结果的相同系统上切换到较慢的 acpi_pm 时间源可能带来的降速:
299
299
300
- <screen>
300
+ <screen><![CDATA[
301
301
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
302
302
tsc hpet acpi_pm
303
303
# echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource
@@ -310,7 +310,7 @@ Histogram of timing durations:
310
310
4 0.07810 3241
311
311
8 0.01357 563
312
312
16 0.00007 3
313
- </screen>
313
+ ]]> </screen>
314
314
</para>
315
315
316
316
<!--==========================orignal english content==========================
@@ -367,7 +367,7 @@ kern.timecounter.hardware: ACPI-fast -> TSC
367
367
implementation, which can have good resolution when it's backed by fast
368
368
enough timing hardware, as in this example:
369
369
370
- <screen>
370
+ <screen><![CDATA[
371
371
$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
372
372
jiffies
373
373
$ dmesg | grep time.c
@@ -384,12 +384,12 @@ Histogram of timing durations:
384
384
8 0.00007 22
385
385
16 0.00000 1
386
386
32 0.00000 1
387
- </screen></para>
387
+ ]]> </screen></para>
388
388
____________________________________________________________________________-->
389
389
<para>
390
390
其他系统可能只允许在启动时设定时间源。在旧的 Linux 系统上,“clock”内核设置是做这类更改的唯一方法。并且即使在一些更近的系统上,对于一个时钟源你将只能看到唯一的选项 "jiffies"。Jiffies 是老的 Linux 软件时钟实现,当有足够快的计时硬件支持时,它能够具有很好的解析度,就像在这个例子中:
391
391
392
- <screen>
392
+ <screen><![CDATA[
393
393
$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
394
394
jiffies
395
395
$ dmesg | grep time.c
@@ -406,7 +406,7 @@ Histogram of timing durations:
406
406
8 0.00007 22
407
407
16 0.00000 1
408
408
32 0.00000 1
409
- </screen></para>
409
+ ]]> </screen></para>
410
410
411
411
</refsect2>
412
412
0 commit comments