Skip to content

Commit 2e69e25

Browse files
Darrien Glassermeta-codesync[bot]
authored andcommitted
Capture Python stacks for cpp_pz2_events
Summary: Automatically capture Python function, file, and line frames for `cpp_pz2_events`. The weak-linked CPython 3.12/3.14 path uses the current attached interpreter state when the GIL is already held and conditionally calls `PyGILState_Ensure()` when the same Python-associated OS thread temporarily released it. Unrelated native threads retain the native C++ fallback without creating a Python thread state. The false-by-default `pai/cpp_zones:enable_cpp_pz_events_stacktrace_logging` knob gates all stack capture, non-Python binaries retain weak-link compatibility, and `zone_events` is unchanged. Reviewed By: AndrewPardoe Differential Revision: D116512939 fbshipit-source-id: c119557b651ab65aefd3c63e463c65a7935e3f47
1 parent d84aa7e commit 2e69e25

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • third-party/folly/src/folly/python

third-party/folly/src/folly/python/Weak.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Py_Weak(void) PyErr_Fetch(PyObject**, PyObject**, PyObject**);
4545

4646
// Object Handling
4747
Py_Weak(PyObject*) PyObject_Repr(PyObject*);
48+
Py_Weak(PyObject*) PyObject_GetAttrString(PyObject*, const char*);
4849

4950
// Unicode && Bytes Handling
5051
Py_Weak(char*) PyBytes_AsString(PyObject*);

0 commit comments

Comments
 (0)