-
-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathperf_profiling.po
More file actions
151 lines (128 loc) · 5.12 KB
/
perf_profiling.po
File metadata and controls
151 lines (128 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2023, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../howto/perf_profiling.rst:7
msgid "Python support for the Linux ``perf`` profiler"
msgstr ""
#: ../../howto/perf_profiling.rst:0
msgid "author"
msgstr ""
#: ../../howto/perf_profiling.rst:9
msgid "Pablo Galindo"
msgstr ""
#: ../../howto/perf_profiling.rst:11
msgid ""
"`The Linux perf profiler <https://perf.wiki.kernel.org>`_ is a very powerful "
"tool that allows you to profile and obtain information about the performance "
"of your application. ``perf`` also has a very vibrant ecosystem of tools "
"that aid with the analysis of the data that it produces."
msgstr ""
#: ../../howto/perf_profiling.rst:17
msgid ""
"The main problem with using the ``perf`` profiler with Python applications "
"is that ``perf`` only gets information about native symbols, that is, the "
"names of functions and procedures written in C. This means that the names "
"and file names of Python functions in your code will not appear in the "
"output of ``perf``."
msgstr ""
#: ../../howto/perf_profiling.rst:22
msgid ""
"Since Python 3.12, the interpreter can run in a special mode that allows "
"Python functions to appear in the output of the ``perf`` profiler. When this "
"mode is enabled, the interpreter will interpose a small piece of code "
"compiled on the fly before the execution of every Python function and it "
"will teach ``perf`` the relationship between this piece of code and the "
"associated Python function using :doc:`perf map files <../c-api/perfmaps>`."
msgstr ""
#: ../../howto/perf_profiling.rst:31
msgid ""
"Support for the ``perf`` profiler is currently only available for Linux on "
"select architectures. Check the output of the ``configure`` build step or "
"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to "
"see if your system is supported."
msgstr ""
#: ../../howto/perf_profiling.rst:36
msgid "For example, consider the following script:"
msgstr ""
#: ../../howto/perf_profiling.rst:55
msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::"
msgstr ""
#: ../../howto/perf_profiling.rst:59
msgid "Then we can use ``perf report`` to analyze the data:"
msgstr ""
#: ../../howto/perf_profiling.rst:100
msgid ""
"As you can see, the Python functions are not shown in the output, only "
"``_Py_Eval_EvalFrameDefault`` (the function that evaluates the Python "
"bytecode) shows up. Unfortunately that's not very useful because all Python "
"functions use the same C function to evaluate bytecode so we cannot know "
"which Python function corresponds to which bytecode-evaluating function."
msgstr ""
#: ../../howto/perf_profiling.rst:105
msgid ""
"Instead, if we run the same experiment with ``perf`` support enabled we get:"
msgstr ""
#: ../../howto/perf_profiling.rst:152
msgid "How to enable ``perf`` profiling support"
msgstr ""
#: ../../howto/perf_profiling.rst:154
msgid ""
"``perf`` profiling support can be enabled either from the start using the "
"environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-"
"X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :"
"func:`sys.deactivate_stack_trampoline`."
msgstr ""
#: ../../howto/perf_profiling.rst:160
msgid ""
"The :mod:`!sys` functions take precedence over the :option:`!-X` option, "
"the :option:`!-X` option takes precedence over the environment variable."
msgstr ""
#: ../../howto/perf_profiling.rst:163
msgid "Example, using the environment variable::"
msgstr ""
#: ../../howto/perf_profiling.rst:169
msgid "Example, using the :option:`!-X` option::"
msgstr ""
#: ../../howto/perf_profiling.rst:174
msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:"
msgstr ""
#: ../../howto/perf_profiling.rst:186
msgid "...then::"
msgstr ""
#: ../../howto/perf_profiling.rst:193
msgid "How to obtain the best results"
msgstr ""
#: ../../howto/perf_profiling.rst:195
msgid ""
"For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-"
"pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind "
"using only the frame pointer and not on DWARF debug information. This is "
"because as the code that is interposed to allow ``perf`` support is "
"dynamically generated it doesn't have any DWARF debugging information "
"available."
msgstr ""
#: ../../howto/perf_profiling.rst:202
msgid ""
"You can check if your system has been compiled with this flag by running::"
msgstr ""
#: ../../howto/perf_profiling.rst:206
msgid ""
"If you don't see any output it means that your interpreter has not been "
"compiled with frame pointers and therefore it may not be able to show Python "
"functions in the output of ``perf``."
msgstr ""