Skip to content

Commit bd7eb99

Browse files
committed
fix 2 perfmaps
1 parent 5e050f1 commit bd7eb99

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Doc/c-api/perfmaps.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Tools/check-c-api-docs/ignored_c_api.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ PyStdPrinter_Type
6868
Py_UniversalNewlineFgets
6969
# cpython/setobject.h
7070
PySet_MINSIZE
71-
# cpython/ceval.h
72-
PyUnstable_CopyPerfMapFile
73-
PyUnstable_PerfTrampoline_CompileCode
74-
PyUnstable_PerfTrampoline_SetPersistAfterFork
7571
# cpython/genobject.h
7672
PyAsyncGenASend_CheckExact
7773
# cpython/longintrepr.h

0 commit comments

Comments
 (0)