@@ -50,6 +50,11 @@ Note that holding an :term:`attached thread state` is not required for these API
5050 general, there shouldn't be a reason to explicitly call this, except to
5151 handle specific scenarios such as forking.
5252
53+ These unstable functions let you access and set perf map information
54+ about the current frame from C code.
55+
56+ Note: Appends the content of the parent frame to the current one in perf maps.
57+ Just like in frameobject.h.
5358
5459.. c:function:: int PyUnstable_CopyPerfMapFile(const char *parent_filename)
5560
@@ -66,6 +71,11 @@ Note that holding an :term:`attached thread state` is not required for these API
6671
6772 Compile the given code object using the current perf trampoline.
6873
74+ The "current" trampoline is the one set by the runtime or the most recent
75+ :c:func: `PyUnstable_PerfTrampoline_SetPersistAfterFork ` call.
76+
77+ If no trampoline is set, falls back to normal compilation (no perf map entry).
78+
6979 :param code: The code object to compile.
7080 :return: 0 on success, -1 on failure.
7181
@@ -76,6 +86,13 @@ Note that holding an :term:`attached thread state` is not required for these API
7686
7787 Set whether the perf trampoline should persist after a fork.
7888
89+ * If ``enable`` is true (non-zero): perf map file remains open/valid post-fork.
90+ Child process inherits all existing perf map entries.
91+ * If ``enable`` is false (zero): perf map closes post-fork.
92+ Child process gets empty perf map.
93+
94+ Default: false (clears on fork).
95+
7996 :param enable: 1 to enable, 0 to disable.
8097 :return: 0 on success, -1 on failure.
8198
0 commit comments