1
- # SOME DESCRIPTIVE TITLE.
2
1
# Copyright (C) 2001-2023, Python Software Foundation
3
2
# This file is distributed under the same license as the Python package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
3
#
6
- #, fuzzy
4
+ # Translators:
5
+ # Matt Wang <mattwang44@gmail.com>, 2023
7
6
msgid ""
8
7
msgstr ""
9
8
"Project-Id-Version : Python 3.12\n "
10
9
"Report-Msgid-Bugs-To : \n "
11
10
"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 "
15
15
"Language : zh_TW\n "
16
16
"MIME-Version : 1.0\n "
17
17
"Content-Type : text/plain; charset=UTF-8\n "
18
18
"Content-Transfer-Encoding : 8bit\n "
19
19
20
20
#: ../../howto/perf_profiling.rst:7
21
21
msgid "Python support for the Linux ``perf`` profiler"
22
- msgstr ""
22
+ msgstr "Python 對 Linux ``perf`` 分析器的支援 "
23
23
24
24
#: ../../howto/perf_profiling.rst:0
25
25
msgid "author"
26
- msgstr ""
26
+ msgstr "作者 "
27
27
28
28
#: ../../howto/perf_profiling.rst:9
29
29
msgid "Pablo Galindo"
30
- msgstr ""
30
+ msgstr "Pablo Galindo "
31
31
32
32
#: ../../howto/perf_profiling.rst:11
33
33
msgid ""
@@ -36,6 +36,9 @@ msgid ""
36
36
"of your application. ``perf`` also has a very vibrant ecosystem of tools "
37
37
"that aid with the analysis of the data that it produces."
38
38
msgstr ""
39
+ "`Linux 性能分析器 (Linux perf profiler) <https://perf.wiki.kernel.org>`_ 是一"
40
+ "個非常強大的工具,可讓你分析並獲取有關應用程式的性能資訊。``perf`` 還擁有一個"
41
+ "非常活躍的工具生態系統,有助於分析其生成的資料。"
39
42
40
43
#: ../../howto/perf_profiling.rst:17
41
44
msgid ""
@@ -45,6 +48,9 @@ msgid ""
45
48
"and file names of Python functions in your code will not appear in the "
46
49
"output of ``perf``."
47
50
msgstr ""
51
+ "在 Python 應用程式中使用 ``perf`` 分析器的主要問題是 ``perf`` 僅獲取有關原生"
52
+ "符號的資訊,即用 C 編寫的函式和程式的名稱。這表示程式碼中的 Python 函式名"
53
+ "稱和檔案名稱不會出現在 ``perf`` 的輸出中。"
48
54
49
55
#: ../../howto/perf_profiling.rst:22
50
56
msgid ""
@@ -55,6 +61,10 @@ msgid ""
55
61
"will teach ``perf`` the relationship between this piece of code and the "
56
62
"associated Python function using :doc:`perf map files <../c-api/perfmaps>`."
57
63
msgstr ""
64
+ "從 Python 3.12 開始,直譯器可以在特殊模式下執行,該模式允許 Python 函式出現"
65
+ "在 ``perf`` 分析器的輸出中。啟用此模式後,直譯器將在執行每個 Python 函式之前"
66
+ "插入 (interpose) 一小段動態編譯的程式碼,並使用 :doc:`perf map 檔案 <../c-"
67
+ "api/perfmaps>`\\ 來告訴 ``perf`` 這段程式碼與相關聯的 Python 函式間的關係。"
58
68
59
69
#: ../../howto/perf_profiling.rst:31
60
70
msgid ""
@@ -63,18 +73,21 @@ msgid ""
63
73
"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to "
64
74
"see if your system is supported."
65
75
msgstr ""
76
+ "目前對 ``perf`` 分析器的支援僅適用於 Linux 的特定架構上。檢查 "
77
+ "``configure`` 建構步驟的輸出或檢查 ``python -m sysconfig | grep "
78
+ "HAVE_PERF_TRAMPOLINE`` 的輸出來查看你的系統是否支援。"
66
79
67
80
#: ../../howto/perf_profiling.rst:36
68
81
msgid "For example, consider the following script:"
69
- msgstr ""
82
+ msgstr "例如,參考以下腳本: "
70
83
71
84
#: ../../howto/perf_profiling.rst:55
72
85
msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::"
73
- msgstr ""
86
+ msgstr "我們可以執行 ``perf`` 以 9999 赫茲採樣 CPU 堆疊追蹤 (stack trace): :: "
74
87
75
88
#: ../../howto/perf_profiling.rst:59
76
89
msgid "Then we can use ``perf report`` to analyze the data:"
77
- msgstr ""
90
+ msgstr "然後我們可以使用 ``perf report`` 來分析資料: "
78
91
79
92
#: ../../howto/perf_profiling.rst:100
80
93
msgid ""
@@ -84,15 +97,20 @@ msgid ""
84
97
"functions use the same C function to evaluate bytecode so we cannot know "
85
98
"which Python function corresponds to which bytecode-evaluating function."
86
99
msgstr ""
100
+ "如你所見,Python 函式未顯示在輸出中,僅顯示 ``_Py_Eval_EvalFrameDefault`` "
101
+ "(為 Python 位元組碼 (bytecode) 求值的函式)。不幸的是,這不是很有用,因為所有 "
102
+ "Python 函式都使用相同的 C 函式來替位元組碼求值,因此我們無法知道哪個 Python 函"
103
+ "式是對應於哪個位元組碼計算函式。"
87
104
88
105
#: ../../howto/perf_profiling.rst:105
89
106
msgid ""
90
107
"Instead, if we run the same experiment with ``perf`` support enabled we get:"
91
108
msgstr ""
109
+ "作為替代,如果我們在啟用 ``perf`` 支援的情況下執行相同的實驗,我們會得到:"
92
110
93
111
#: ../../howto/perf_profiling.rst:152
94
112
msgid "How to enable ``perf`` profiling support"
95
- msgstr ""
113
+ msgstr "如何啟用 ``perf`` 分析支援 "
96
114
97
115
#: ../../howto/perf_profiling.rst:154
98
116
msgid ""
@@ -101,32 +119,37 @@ msgid ""
101
119
"X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :"
102
120
"func:`sys.deactivate_stack_trampoline`."
103
121
msgstr ""
122
+ "要啟用 ``perf`` 分析支援,可以在一開始就使用環境變數 :envvar:"
123
+ "`PYTHONPERFSUPPORT` 或使用 :option:`-X perf <-X>` 選項,也可以使用 :func:"
124
+ "`sys.activate_stack_trampoline` 和 :func:`sys.deactivate_stack_trampoline` 來"
125
+ "動態啟用。"
104
126
105
127
#: ../../howto/perf_profiling.rst:160
106
128
msgid ""
107
129
"The :mod:`!sys` functions take precedence over the :option:`!-X` option, "
108
130
"the :option:`!-X` option takes precedence over the environment variable."
109
131
msgstr ""
132
+ ":mod:`!sys` 函式優先於 :option:`!-X` 選項、:option:`!-X` 選項優先於環境變數。"
110
133
111
134
#: ../../howto/perf_profiling.rst:163
112
135
msgid "Example, using the environment variable::"
113
- msgstr ""
136
+ msgstr "例如,使用環境變數: :: "
114
137
115
138
#: ../../howto/perf_profiling.rst:168
116
139
msgid "Example, using the :option:`!-X` option::"
117
- msgstr ""
140
+ msgstr "例如,使用 :option:`!-X` 選項: :: "
118
141
119
142
#: ../../howto/perf_profiling.rst:173
120
143
msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:"
121
- msgstr ""
144
+ msgstr "例如,在 :file:`example.py` 檔案中使用 :mod:`sys` API: "
122
145
123
146
#: ../../howto/perf_profiling.rst:185
124
147
msgid "...then::"
125
- msgstr ""
148
+ msgstr "...然後: :: "
126
149
127
150
#: ../../howto/perf_profiling.rst:192
128
151
msgid "How to obtain the best results"
129
- msgstr ""
152
+ msgstr "如何獲得最佳結果 "
130
153
131
154
#: ../../howto/perf_profiling.rst:194
132
155
msgid ""
@@ -137,15 +160,21 @@ msgid ""
137
160
"dynamically generated it doesn't have any DWARF debugging information "
138
161
"available."
139
162
msgstr ""
163
+ "為了獲得最佳結果,應使用 ``CFLAGS=\" -fno-omit-frame-pointer -mno-omit-leaf-"
164
+ "frame-pointer\" `` 來進行 Python 編譯,因為這能允許分析器僅使用 frame 指標而不"
165
+ "是 DWARF 除錯資訊來解析 (unwind)。這是因為,由於插入以允許 ``perf`` 支援的程式碼是動"
166
+ "態生成的,因此它沒有任何可用的 DWARF 除錯資訊。"
140
167
141
168
#: ../../howto/perf_profiling.rst:201
142
169
msgid ""
143
170
"You can check if your system has been compiled with this flag by running::"
144
- msgstr ""
171
+ msgstr "你可以透過執行以下指令來檢查你的系統是否已使用此旗標進行編譯: :: "
145
172
146
173
#: ../../howto/perf_profiling.rst:205
147
174
msgid ""
148
175
"If you don't see any output it means that your interpreter has not been "
149
176
"compiled with frame pointers and therefore it may not be able to show Python "
150
177
"functions in the output of ``perf``."
151
178
msgstr ""
179
+ "如果你沒有看到任何輸出,則表示你的直譯器尚未使用 frame 指標進行編譯,因此它"
180
+ "可能無法在 ``perf`` 的輸出中顯示 Python 函式。"
0 commit comments