summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-17 14:02:23 (GMT)
committerGitHub <noreply@github.com>2023-10-17 14:02:23 (GMT)
commit232465204edb070751f4794c67dd31cd9b7c8c53 (patch)
tree05d9deff96dd8c8ef03c16c48e5146e572d60838 /Include/cpython
parent6db6b30ac2734b94f66166cee320028c4ba1d30e (diff)
downloadcpython-232465204edb070751f4794c67dd31cd9b7c8c53.zip
cpython-232465204edb070751f4794c67dd31cd9b7c8c53.tar.gz
cpython-232465204edb070751f4794c67dd31cd9b7c8c53.tar.bz2
gh-85283: Add PySys_Audit() to the limited C API (#108571)
The PySys_Audit() function was added in Python 3.8 by the PEP 578 "Python Runtime Audit Hooks". Add also PySys_AuditTuple() to the limited C API, function added to Python 3.13. Move non-limited "PerfMap" C API from Include/sysmodule.h to Include/cpython/sysmodule.h.
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/sysmodule.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/Include/cpython/sysmodule.h b/Include/cpython/sysmodule.h
index 36c4f89..df12ae4 100644
--- a/Include/cpython/sysmodule.h
+++ b/Include/cpython/sysmodule.h
@@ -10,6 +10,14 @@ PyAPI_FUNC(int) PySys_Audit(
...);
PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);
-PyAPI_FUNC(int) PySys_AuditTuple(
- const char *event,
- PyObject *args);
+typedef struct {
+ FILE* perf_map;
+ PyThread_type_lock map_lock;
+} PerfMapState;
+
+PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void);
+PyAPI_FUNC(int) PyUnstable_WritePerfMapEntry(
+ const void *code_addr,
+ unsigned int code_size,
+ const char *entry_name);
+PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void);