diff options
author | Victor Stinner <vstinner@python.org> | 2023-10-17 14:02:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-17 14:02:23 (GMT) |
commit | 232465204edb070751f4794c67dd31cd9b7c8c53 (patch) | |
tree | 05d9deff96dd8c8ef03c16c48e5146e572d60838 /Include | |
parent | 6db6b30ac2734b94f66166cee320028c4ba1d30e (diff) | |
download | cpython-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')
-rw-r--r-- | Include/cpython/sysmodule.h | 14 | ||||
-rw-r--r-- | Include/sysmodule.h | 20 |
2 files changed, 20 insertions, 14 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); diff --git a/Include/sysmodule.h b/Include/sysmodule.h index 225e060..7406513 100644 --- a/Include/sysmodule.h +++ b/Include/sysmodule.h @@ -21,17 +21,15 @@ Py_DEPRECATED(3.13) PyAPI_FUNC(void) PySys_ResetWarnOptions(void); PyAPI_FUNC(PyObject *) PySys_GetXOptions(void); -#if !defined(Py_LIMITED_API) -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); +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +PyAPI_FUNC(int) PySys_Audit( + const char *event, + const char *argFormat, + ...); + +PyAPI_FUNC(int) PySys_AuditTuple( + const char *event, + PyObject *args); #endif #ifndef Py_LIMITED_API |