diff options
author | gsallam <123525874+gsallam@users.noreply.github.com> | 2023-05-21 10:12:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-21 10:12:24 (GMT) |
commit | be0c106789322273f1f76d232c768c09880a14bd (patch) | |
tree | 5068f5a53ac893d612272fcff8dcaa0c28ee4d69 /Include | |
parent | 2e91c7e62609ef405901dd5c4cb9d5aa794591ab (diff) | |
download | cpython-be0c106789322273f1f76d232c768c09880a14bd.zip cpython-be0c106789322273f1f76d232c768c09880a14bd.tar.gz cpython-be0c106789322273f1f76d232c768c09880a14bd.tar.bz2 |
gh-103295: expose API for writing perf map files (#103546)
Co-authored-by: Aniket Panse <aniketpanse@fb.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Carl Meyer <carl@oddbird.net>
Diffstat (limited to 'Include')
-rw-r--r-- | Include/sysmodule.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Include/sysmodule.h b/Include/sysmodule.h index b508711..96f8838 100644 --- a/Include/sysmodule.h +++ b/Include/sysmodule.h @@ -29,6 +29,19 @@ Py_DEPRECATED(3.11) PyAPI_FUNC(int) PySys_HasWarnOptions(void); Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *); 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); +#endif + #ifndef Py_LIMITED_API # define Py_CPYTHON_SYSMODULE_H # include "cpython/sysmodule.h" |