diff --git a/howto/instrumentation.po b/howto/instrumentation.po index d5e62b6a96..29a7b4d68f 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -1,12 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. +# +# Translators: +# Matt Wang msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-24 00:03+0000\n" -"PO-Revision-Date: 2018-07-15 18:56+0800\n" +"PO-Revision-Date: 2023-08-17 22:17+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -14,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../howto/instrumentation.rst:7 msgid "Instrumenting CPython with DTrace and SystemTap" -msgstr "" +msgstr "使用 DTrace 和 SystemTap 檢測 CPython" #: ../../howto/instrumentation.rst:0 msgid "author" @@ -37,18 +41,21 @@ msgid "" "what the processes on a computer system are doing. They both use domain-" "specific languages allowing a user to write scripts which:" msgstr "" +"DTrace 和 SystemTap 都是監測工具,各自都提供了一種檢查電腦系統之行程 " +"(process) 正在執行什麼操作的方法。它們都使用了領域限定 (domain-specific) 的語" +"言,允許使用者編寫以下腳本:" #: ../../howto/instrumentation.rst:16 msgid "filter which processes are to be observed" -msgstr "" +msgstr "過濾要觀察的行程" #: ../../howto/instrumentation.rst:17 msgid "gather data from the processes of interest" -msgstr "" +msgstr "收集來自感興趣之行程的資料" #: ../../howto/instrumentation.rst:18 msgid "generate reports on the data" -msgstr "" +msgstr "以這些資料產生報告" #: ../../howto/instrumentation.rst:20 msgid "" @@ -56,6 +63,9 @@ msgid "" "as \"probes\", that can be observed by a DTrace or SystemTap script, making " "it easier to monitor what the CPython processes on a system are doing." msgstr "" +"從 Python 3.6 開始,CPython 可以使用嵌入式「標記 (marker)」(也稱為「探針 " +"(probe)」)建置,可以透過 DTrace 或 SystemTap 腳本進行觀察,從而更輕鬆地監視" +"系統之 CPython 行程正在執行的操作。" #: ../../howto/instrumentation.rst:27 msgid "" @@ -64,10 +74,12 @@ msgid "" "DTrace scripts can stop working or work incorrectly without warning when " "changing CPython versions." msgstr "" +"DTrace 標記是 CPython 直譯器的實作細節。不保證 CPython 版本之間的探針相容性。" +"更改 CPython 版本時,DTrace 腳本可能會停止運作或錯誤地運作,而不會發出警告。" #: ../../howto/instrumentation.rst:34 msgid "Enabling the static markers" -msgstr "" +msgstr "啟用靜態標記" #: ../../howto/instrumentation.rst:36 msgid "" @@ -75,23 +87,23 @@ msgid "" "CPython with the embedded markers for SystemTap, the SystemTap development " "tools must be installed." msgstr "" +"macOS 內建了對 DTrace 的支援。在 Linux 上,為了建置帶有 SystemTap 嵌入標記的 " +"CPython,必須安裝 SystemTap 開發工具。" #: ../../howto/instrumentation.rst:40 msgid "On a Linux machine, this can be done via::" -msgstr "" +msgstr "在 Linux 機器上,這可以透過以下方式完成: ::" #: ../../howto/instrumentation.rst:44 msgid "or::" -msgstr "" -"或是:\n" -"\n" -"::" +msgstr "或是: ::" #: ../../howto/instrumentation.rst:49 msgid "" "CPython must then be :option:`configured with the --with-dtrace option <--" "with-dtrace>`:" msgstr "" +"然後 CPython 必須使用\\ :option:`配置 --with-dtrace 選項 <--with-dtrace>`:" #: ../../howto/instrumentation.rst:56 msgid "" @@ -99,12 +111,16 @@ msgid "" "in the background and listing all probes made available by the Python " "provider::" msgstr "" +"在 macOS 上,你可以透過在後台運行 Python 行程並列出 Python 發布者 (provider) " +"所提供的所有可用探針,以列出可用的 DTrace 探針: ::" #: ../../howto/instrumentation.rst:73 msgid "" "On Linux, you can verify if the SystemTap static markers are present in the " "built binary by seeing if it contains a \".note.stapsdt\" section." msgstr "" +"在 Linux 上,你可以透過查看二進位建置檔案中是否包含 \".note.stapsdt\" 部分來" +"驗證 SystemTap 靜態標記是否存在。" #: ../../howto/instrumentation.rst:81 msgid "" @@ -112,10 +128,12 @@ msgid "" "shared` configure option), you need to look instead within the shared " "library. For example::" msgstr "" +"如果你已將 Python 建置為共享函式庫(使用 :option:`--enable-shared` 配置選" +"項),則需要在共享函式庫中查找。例如: ::" #: ../../howto/instrumentation.rst:88 msgid "Sufficiently modern readelf can print the metadata::" -msgstr "" +msgstr "足夠現代化的 readelf 可以印出元資料 (metadata): ::" #: ../../howto/instrumentation.rst:125 msgid "" @@ -123,10 +141,12 @@ msgid "" "patch strategically placed machine code instructions to enable the tracing " "hooks used by a SystemTap script." msgstr "" +"上述元資料包含 SystemTap 的資訊,描述了它如何修補策略性放置的機器碼指令以啟" +"用 SystemTap 腳本使用的追蹤 hook。" #: ../../howto/instrumentation.rst:131 msgid "Static DTrace probes" -msgstr "" +msgstr "靜態 DTrace 探針" #: ../../howto/instrumentation.rst:133 msgid "" @@ -135,18 +155,20 @@ msgid "" "function called \"start\". In other words, import-time function invocations " "are not going to be listed:" msgstr "" +"以下範例示範 DTrace 腳本可用於顯示 Python 腳本的呼叫/回傳階層結構,僅在名為 " +"\"start\" 的函式的呼叫內進行追蹤。換句話說,引入時的函式呼叫不會被列出:" #: ../../howto/instrumentation.rst:172 ../../howto/instrumentation.rst:230 msgid "It can be invoked like this::" -msgstr "" +msgstr "可以這樣呼叫: ::" #: ../../howto/instrumentation.rst:176 ../../howto/instrumentation.rst:236 msgid "The output looks like this:" -msgstr "" +msgstr "輸出如下所示:" #: ../../howto/instrumentation.rst:201 msgid "Static SystemTap markers" -msgstr "" +msgstr "靜態 SystemTap 標記" #: ../../howto/instrumentation.rst:203 msgid "" @@ -154,33 +176,35 @@ msgid "" "markers directly. This requires you to explicitly state the binary file " "containing them." msgstr "" +"使用 SystemTap 整合的低階方法是直接使用靜態標記。這會需要你明確聲明包含它們的" +"二進位檔案。" #: ../../howto/instrumentation.rst:207 msgid "" "For example, this SystemTap script can be used to show the call/return " "hierarchy of a Python script:" -msgstr "" +msgstr "例如,此 SystemTap 腳本可用於顯示 Python 腳本的呼叫/回傳階層結構:" #: ../../howto/instrumentation.rst:247 msgid "where the columns are:" -msgstr "" +msgstr "其中的行 (column) 是:" #: ../../howto/instrumentation.rst:249 msgid "time in microseconds since start of script" -msgstr "" +msgstr "自腳本開始以來的時間(以微秒為單位)" #: ../../howto/instrumentation.rst:251 msgid "name of executable" -msgstr "" +msgstr "可執行檔案的名稱" #: ../../howto/instrumentation.rst:253 msgid "PID of process" -msgstr "" +msgstr "行程的 PID" #: ../../howto/instrumentation.rst:255 msgid "" "and the remainder indicates the call/return hierarchy as the script executes." -msgstr "" +msgstr "其餘部分表示腳本執行時的呼叫/回傳階層結構。" #: ../../howto/instrumentation.rst:257 msgid "" @@ -188,24 +212,28 @@ msgid "" "within the libpython shared library, and the probe's dotted path needs to " "reflect this. For example, this line from the above example:" msgstr "" +"對於以 :option:`--enable-shared` 建置的 CPython,標記被包含在 libpython 共享" +"函式庫中,並且探針的帶點路徑 (dotted path) 需要反映這一點。例如,上面範例中的" +"這一列:" #: ../../howto/instrumentation.rst:265 msgid "should instead read:" -msgstr "" +msgstr "應該改為讀取:" #: ../../howto/instrumentation.rst:271 msgid "(assuming a :ref:`debug build ` of CPython 3.6)" -msgstr "" +msgstr "(假設 CPython 3.6 的\\ :ref:`除錯建置版本 `)" #: ../../howto/instrumentation.rst:275 msgid "Available static markers" -msgstr "" +msgstr "可用的靜態標記" #: ../../howto/instrumentation.rst:279 msgid "" "This marker indicates that execution of a Python function has begun. It is " "only triggered for pure-Python (bytecode) functions." msgstr "" +"該標記表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸發。" #: ../../howto/instrumentation.rst:282 msgid "" @@ -213,22 +241,26 @@ msgid "" "tracing script as positional arguments, which must be accessed using " "``$arg1``, ``$arg2``, ``$arg3``:" msgstr "" +"檔案名稱、函式名稱和列號作為位置引數提供給追蹤腳本,必須使用 ``$arg1``、" +"``$arg2``、``$arg3`` 來存取:" #: ../../howto/instrumentation.rst:286 msgid "" "``$arg1`` : ``(const char *)`` filename, accessible using " "``user_string($arg1)``" msgstr "" +"``$arg1`` : ``(const char *)`` 檔案名稱,可使用 ``user_string($arg1)`` 存取" #: ../../howto/instrumentation.rst:288 msgid "" "``$arg2`` : ``(const char *)`` function name, accessible using " "``user_string($arg2)``" msgstr "" +"``$arg2`` :``(const char *)`` 函式名稱,可使用 ``user_string($arg2)`` 存取" #: ../../howto/instrumentation.rst:291 msgid "``$arg3`` : ``int`` line number" -msgstr "" +msgstr "``$arg3`` : ``int`` 列號" #: ../../howto/instrumentation.rst:295 msgid "" @@ -236,10 +268,12 @@ msgid "" "that execution of a Python function has ended (either via ``return``, or via " "an exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" +"該標記與 :c:func:`!function__entry` 相反,表示 Python 函式的執行已結束(透過 " +"``return`` 或透過例外)。它僅針對純 Python(位元組碼)函式觸發。" #: ../../howto/instrumentation.rst:299 msgid "The arguments are the same as for :c:func:`!function__entry`" -msgstr "" +msgstr "引數與 :c:func:`!function__entry` 相同" #: ../../howto/instrumentation.rst:303 msgid "" @@ -247,34 +281,40 @@ msgid "" "equivalent of line-by-line tracing with a Python profiler. It is not " "triggered within C functions." msgstr "" +"該標記表示一列 Python 即將被執行。它相當於使用 Python 分析器來逐行追蹤。它不" +"在 C 函式內觸發。" #: ../../howto/instrumentation.rst:307 msgid "The arguments are the same as for :c:func:`!function__entry`." -msgstr "" +msgstr "引數與 :c:func:`!function__entry` 相同。" #: ../../howto/instrumentation.rst:311 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " "``arg0`` is the generation to scan, like :func:`gc.collect()`." msgstr "" +"當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃" +"描的一代 (generation),如 :func:`gc.collect()`。" #: ../../howto/instrumentation.rst:316 msgid "" "Fires when the Python interpreter finishes a garbage collection cycle. " "``arg0`` is the number of collected objects." -msgstr "" +msgstr "當 Python 直譯器完成垃圾回收週期時觸發。``arg0`` 是收集到的物件數量。" #: ../../howto/instrumentation.rst:321 msgid "" "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " "is the module name." -msgstr "" +msgstr "在 :mod:`importlib` 嘗試查找並載入模組之前觸發。``arg0`` 是模組名稱。" #: ../../howto/instrumentation.rst:328 msgid "" "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " "the module name, ``arg1`` indicates if module was successfully loaded." msgstr "" +"在呼叫 :mod:`importlib` 的 find_and_load 函式後觸發。 ``arg0`` 是模組名稱," +"``arg1`` 代表模組是否已成功載入。" #: ../../howto/instrumentation.rst:337 msgid "" @@ -282,10 +322,12 @@ msgid "" "the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " "tuple object." msgstr "" +"當呼叫 :func:`sys.audit` 或 :c:func:`PySys_Audit` 時觸發。``arg0`` 是 C 字串" +"形式的事件名稱,``arg1`` 是指向元組 (tuple) 物件的 :c:type:`PyObject` 指標。" #: ../../howto/instrumentation.rst:345 msgid "SystemTap Tapsets" -msgstr "" +msgstr "SystemTap Tapsets" #: ../../howto/instrumentation.rst:347 msgid "" @@ -293,22 +335,28 @@ msgid "" "\"tapset\": SystemTap's equivalent of a library, which hides some of the " "lower-level details of the static markers." msgstr "" +"使用 SystemTap 整合的高階方法是使用 \"tapset\":SystemTap 相當於一個函式庫," +"它隱藏了靜態標記的一些低階詳細資訊。" #: ../../howto/instrumentation.rst:351 msgid "Here is a tapset file, based on a non-shared build of CPython:" -msgstr "" +msgstr "這是一個 tapset 檔案,是基於 CPython 的非共享建置版本:" #: ../../howto/instrumentation.rst:374 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" "systemtap/tapset``), then these additional probepoints become available:" msgstr "" +"如果此檔案是安裝在 SystemTap 的 tapset 目錄中(例如 ``/usr/share/systemtap/" +"tapset``),則這些額外的探測點將可被使用:" #: ../../howto/instrumentation.rst:380 msgid "" "This probe point indicates that execution of a Python function has begun. It " "is only triggered for pure-Python (bytecode) functions." msgstr "" +"該探測點表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸" +"發。" #: ../../howto/instrumentation.rst:385 msgid "" @@ -317,6 +365,8 @@ msgid "" "``return``, or via an exception). It is only triggered for pure-Python " "(bytecode) functions." msgstr "" +"這個探測點與 ``python.function.return`` 相反,表示 Python 函式的執行已經結束" +"(透過 ``return`` 或者透過例外)。它僅針對純 Python(位元組碼)函式觸發。" #: ../../howto/instrumentation.rst:392 msgid "Examples" @@ -328,6 +378,8 @@ msgid "" "example given above of tracing the Python function-call hierarchy, without " "needing to directly name the static markers:" msgstr "" +"此 SystemTap 腳本使用上面的 tapset 來更清晰地實作上面給出的追蹤 Python 函式呼" +"叫階層結構的範例,而無需直接命名靜態標記:" #: ../../howto/instrumentation.rst:412 msgid "" @@ -335,3 +387,5 @@ msgid "" "running CPython code, showing the top 20 most frequently entered bytecode " "frames, each second, across the whole system:" msgstr "" +"以下腳本使用上面的 tapset 來提供所有正在運行之 CPython 程式碼的近乎最高層視" +"角,顯示整個系統中每秒最常被進入的 20 個位元組碼幀 (bytecode frame):"