Skip to content

Commit d89b651

Browse files
mattwang44mindihx
andauthored
Translate howto/perf_profiling.po (#563)
* translate `howto/perf_profiling.po` * Apply suggestions from code review Co-authored-by: mindihx <ymhuang.ymh@gmail.com> * Apply suggestions from code review --------- Co-authored-by: mindihx <ymhuang.ymh@gmail.com>
1 parent 644b84e commit d89b651

File tree

1 file changed

+48
-19
lines changed

1 file changed

+48
-19
lines changed

howto/perf_profiling.po

+48-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# SOME DESCRIPTIVE TITLE.
21
# Copyright (C) 2001-2023, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
53
#
6-
#, fuzzy
4+
# Translators:
5+
# Matt Wang <mattwang44@gmail.com>, 2023
76
msgid ""
87
msgstr ""
98
"Project-Id-Version: Python 3.12\n"
109
"Report-Msgid-Bugs-To: \n"
1110
"POT-Creation-Date: 2023-11-16 00:03+0000\n"
12-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14-
"Language-Team: LANGUAGE <LL@li.org>\n"
11+
"PO-Revision-Date: 2023-12-09 17:39+0800\n"
12+
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
13+
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
14+
"tw)\n"
1515
"Language: zh_TW\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919

2020
#: ../../howto/perf_profiling.rst:7
2121
msgid "Python support for the Linux ``perf`` profiler"
22-
msgstr ""
22+
msgstr "Python 對 Linux ``perf`` 分析器的支援"
2323

2424
#: ../../howto/perf_profiling.rst:0
2525
msgid "author"
26-
msgstr ""
26+
msgstr "作者"
2727

2828
#: ../../howto/perf_profiling.rst:9
2929
msgid "Pablo Galindo"
30-
msgstr ""
30+
msgstr "Pablo Galindo"
3131

3232
#: ../../howto/perf_profiling.rst:11
3333
msgid ""
@@ -36,6 +36,9 @@ msgid ""
3636
"of your application. ``perf`` also has a very vibrant ecosystem of tools "
3737
"that aid with the analysis of the data that it produces."
3838
msgstr ""
39+
"`Linux 性能分析器 (Linux perf profiler) <https://perf.wiki.kernel.org>`_ 是一"
40+
"個非常強大的工具,可讓你分析並獲取有關應用程式的性能資訊。``perf`` 還擁有一個"
41+
"非常活躍的工具生態系統,有助於分析其生成的資料。"
3942

4043
#: ../../howto/perf_profiling.rst:17
4144
msgid ""
@@ -45,6 +48,9 @@ msgid ""
4548
"and file names of Python functions in your code will not appear in the "
4649
"output of ``perf``."
4750
msgstr ""
51+
"在 Python 應用程式中使用 ``perf`` 分析器的主要問題是 ``perf`` 僅獲取有關原生"
52+
"符號的資訊,即用 C 編寫的函式和程式的名稱。這表示程式碼中的 Python 函式名"
53+
"稱和檔案名稱不會出現在 ``perf`` 的輸出中。"
4854

4955
#: ../../howto/perf_profiling.rst:22
5056
msgid ""
@@ -55,6 +61,10 @@ msgid ""
5561
"will teach ``perf`` the relationship between this piece of code and the "
5662
"associated Python function using :doc:`perf map files <../c-api/perfmaps>`."
5763
msgstr ""
64+
"從 Python 3.12 開始,直譯器可以在特殊模式下執行,該模式允許 Python 函式出現"
65+
"在 ``perf`` 分析器的輸出中。啟用此模式後,直譯器將在執行每個 Python 函式之前"
66+
"插入 (interpose) 一小段動態編譯的程式碼,並使用 :doc:`perf map 檔案 <../c-"
67+
"api/perfmaps>`\\ 來告訴 ``perf`` 這段程式碼與相關聯的 Python 函式間的關係。"
5868

5969
#: ../../howto/perf_profiling.rst:31
6070
msgid ""
@@ -63,18 +73,21 @@ msgid ""
6373
"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to "
6474
"see if your system is supported."
6575
msgstr ""
76+
"目前對 ``perf`` 分析器的支援僅適用於 Linux 的特定架構上。檢查 "
77+
"``configure`` 建構步驟的輸出或檢查 ``python -m sysconfig | grep "
78+
"HAVE_PERF_TRAMPOLINE`` 的輸出來查看你的系統是否支援。"
6679

6780
#: ../../howto/perf_profiling.rst:36
6881
msgid "For example, consider the following script:"
69-
msgstr ""
82+
msgstr "例如,參考以下腳本:"
7083

7184
#: ../../howto/perf_profiling.rst:55
7285
msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::"
73-
msgstr ""
86+
msgstr "我們可以執行 ``perf`` 以 9999 赫茲採樣 CPU 堆疊追蹤 (stack trace): ::"
7487

7588
#: ../../howto/perf_profiling.rst:59
7689
msgid "Then we can use ``perf report`` to analyze the data:"
77-
msgstr ""
90+
msgstr "然後我們可以使用 ``perf report`` 來分析資料:"
7891

7992
#: ../../howto/perf_profiling.rst:100
8093
msgid ""
@@ -84,15 +97,20 @@ msgid ""
8497
"functions use the same C function to evaluate bytecode so we cannot know "
8598
"which Python function corresponds to which bytecode-evaluating function."
8699
msgstr ""
100+
"如你所見,Python 函式未顯示在輸出中,僅顯示 ``_Py_Eval_EvalFrameDefault`` "
101+
"(為 Python 位元組碼 (bytecode) 求值的函式)。不幸的是,這不是很有用,因為所有 "
102+
"Python 函式都使用相同的 C 函式來替位元組碼求值,因此我們無法知道哪個 Python 函"
103+
"式是對應於哪個位元組碼計算函式。"
87104

88105
#: ../../howto/perf_profiling.rst:105
89106
msgid ""
90107
"Instead, if we run the same experiment with ``perf`` support enabled we get:"
91108
msgstr ""
109+
"作為替代,如果我們在啟用 ``perf`` 支援的情況下執行相同的實驗,我們會得到:"
92110

93111
#: ../../howto/perf_profiling.rst:152
94112
msgid "How to enable ``perf`` profiling support"
95-
msgstr ""
113+
msgstr "如何啟用 ``perf`` 分析支援"
96114

97115
#: ../../howto/perf_profiling.rst:154
98116
msgid ""
@@ -101,32 +119,37 @@ msgid ""
101119
"X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :"
102120
"func:`sys.deactivate_stack_trampoline`."
103121
msgstr ""
122+
"要啟用 ``perf`` 分析支援,可以在一開始就使用環境變數 :envvar:"
123+
"`PYTHONPERFSUPPORT` 或使用 :option:`-X perf <-X>` 選項,也可以使用 :func:"
124+
"`sys.activate_stack_trampoline` 和 :func:`sys.deactivate_stack_trampoline` 來"
125+
"動態啟用。"
104126

105127
#: ../../howto/perf_profiling.rst:160
106128
msgid ""
107129
"The :mod:`!sys` functions take precedence over the :option:`!-X` option, "
108130
"the :option:`!-X` option takes precedence over the environment variable."
109131
msgstr ""
132+
":mod:`!sys` 函式優先於 :option:`!-X` 選項、:option:`!-X` 選項優先於環境變數。"
110133

111134
#: ../../howto/perf_profiling.rst:163
112135
msgid "Example, using the environment variable::"
113-
msgstr ""
136+
msgstr "例如,使用環境變數: ::"
114137

115138
#: ../../howto/perf_profiling.rst:168
116139
msgid "Example, using the :option:`!-X` option::"
117-
msgstr ""
140+
msgstr "例如,使用 :option:`!-X` 選項: ::"
118141

119142
#: ../../howto/perf_profiling.rst:173
120143
msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:"
121-
msgstr ""
144+
msgstr "例如,在 :file:`example.py` 檔案中使用 :mod:`sys` API:"
122145

123146
#: ../../howto/perf_profiling.rst:185
124147
msgid "...then::"
125-
msgstr ""
148+
msgstr "...然後: ::"
126149

127150
#: ../../howto/perf_profiling.rst:192
128151
msgid "How to obtain the best results"
129-
msgstr ""
152+
msgstr "如何獲得最佳結果"
130153

131154
#: ../../howto/perf_profiling.rst:194
132155
msgid ""
@@ -137,15 +160,21 @@ msgid ""
137160
"dynamically generated it doesn't have any DWARF debugging information "
138161
"available."
139162
msgstr ""
163+
"為了獲得最佳結果,應使用 ``CFLAGS=\"-fno-omit-frame-pointer -mno-omit-leaf-"
164+
"frame-pointer\"`` 來進行 Python 編譯,因為這能允許分析器僅使用 frame 指標而不"
165+
"是 DWARF 除錯資訊來解析 (unwind)。這是因為,由於插入以允許 ``perf`` 支援的程式碼是動"
166+
"態生成的,因此它沒有任何可用的 DWARF 除錯資訊。"
140167

141168
#: ../../howto/perf_profiling.rst:201
142169
msgid ""
143170
"You can check if your system has been compiled with this flag by running::"
144-
msgstr ""
171+
msgstr "你可以透過執行以下指令來檢查你的系統是否已使用此旗標進行編譯: ::"
145172

146173
#: ../../howto/perf_profiling.rst:205
147174
msgid ""
148175
"If you don't see any output it means that your interpreter has not been "
149176
"compiled with frame pointers and therefore it may not be able to show Python "
150177
"functions in the output of ``perf``."
151178
msgstr ""
179+
"如果你沒有看到任何輸出,則表示你的直譯器尚未使用 frame 指標進行編譯,因此它"
180+
"可能無法在 ``perf`` 的輸出中顯示 Python 函式。"

0 commit comments

Comments
 (0)