|
13 | 13 | #define PY_MONITORING_EVENT_LINE 5 |
14 | 14 | #define PY_MONITORING_EVENT_INSTRUCTION 6 |
15 | 15 | #define PY_MONITORING_EVENT_JUMP 7 |
16 | | -#define PY_MONITORING_EVENT_BRANCH 8 |
17 | | -#define PY_MONITORING_EVENT_STOP_ITERATION 9 |
| 16 | +#define PY_MONITORING_EVENT_BRANCH_LEFT 8 |
| 17 | +#define PY_MONITORING_EVENT_BRANCH_RIGHT 9 |
| 18 | +#define PY_MONITORING_EVENT_STOP_ITERATION 10 |
18 | 19 |
|
19 | 20 | #define PY_MONITORING_IS_INSTRUMENTED_EVENT(ev) \ |
20 | 21 | ((ev) < _PY_MONITORING_LOCAL_EVENTS) |
21 | 22 |
|
22 | 23 | /* Other events, mainly exceptions */ |
23 | 24 |
|
24 | | -#define PY_MONITORING_EVENT_RAISE 10 |
25 | | -#define PY_MONITORING_EVENT_EXCEPTION_HANDLED 11 |
26 | | -#define PY_MONITORING_EVENT_PY_UNWIND 12 |
27 | | -#define PY_MONITORING_EVENT_PY_THROW 13 |
28 | | -#define PY_MONITORING_EVENT_RERAISE 14 |
| 25 | +#define PY_MONITORING_EVENT_RAISE 11 |
| 26 | +#define PY_MONITORING_EVENT_EXCEPTION_HANDLED 12 |
| 27 | +#define PY_MONITORING_EVENT_PY_UNWIND 13 |
| 28 | +#define PY_MONITORING_EVENT_PY_THROW 14 |
| 29 | +#define PY_MONITORING_EVENT_RERAISE 15 |
29 | 30 |
|
30 | 31 |
|
31 | 32 | /* Ancillary events */ |
32 | 33 |
|
33 | | -#define PY_MONITORING_EVENT_C_RETURN 15 |
34 | | -#define PY_MONITORING_EVENT_C_RAISE 16 |
| 34 | +#define PY_MONITORING_EVENT_C_RETURN 16 |
| 35 | +#define PY_MONITORING_EVENT_C_RAISE 17 |
| 36 | +#define PY_MONITORING_EVENT_BRANCH 18 |
35 | 37 |
|
36 | 38 |
|
37 | 39 | typedef struct _PyMonitoringState { |
@@ -74,10 +76,18 @@ PyAPI_FUNC(int) |
74 | 76 | _PyMonitoring_FireJumpEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
75 | 77 | PyObject *target_offset); |
76 | 78 |
|
77 | | -PyAPI_FUNC(int) |
| 79 | +Py_DEPRECATED(3.14) PyAPI_FUNC(int) |
78 | 80 | _PyMonitoring_FireBranchEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
79 | 81 | PyObject *target_offset); |
80 | 82 |
|
| 83 | +PyAPI_FUNC(int) |
| 84 | +_PyMonitoring_FireBranchRightEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
| 85 | + PyObject *target_offset); |
| 86 | + |
| 87 | +PyAPI_FUNC(int) |
| 88 | +_PyMonitoring_FireBranchLeftEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
| 89 | + PyObject *target_offset); |
| 90 | + |
81 | 91 | PyAPI_FUNC(int) |
82 | 92 | _PyMonitoring_FireCReturnEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
83 | 93 | PyObject *retval); |
@@ -174,12 +184,21 @@ PyMonitoring_FireJumpEvent(PyMonitoringState *state, PyObject *codelike, int32_t |
174 | 184 | } |
175 | 185 |
|
176 | 186 | static inline int |
177 | | -PyMonitoring_FireBranchEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
| 187 | +PyMonitoring_FireBranchRightEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
| 188 | + PyObject *target_offset) |
| 189 | +{ |
| 190 | + _PYMONITORING_IF_ACTIVE( |
| 191 | + state, |
| 192 | + _PyMonitoring_FireBranchRightEvent(state, codelike, offset, target_offset)); |
| 193 | +} |
| 194 | + |
| 195 | +static inline int |
| 196 | +PyMonitoring_FireBranchLeftEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset, |
178 | 197 | PyObject *target_offset) |
179 | 198 | { |
180 | 199 | _PYMONITORING_IF_ACTIVE( |
181 | 200 | state, |
182 | | - _PyMonitoring_FireBranchEvent(state, codelike, offset, target_offset)); |
| 201 | + _PyMonitoring_FireBranchLeftEvent(state, codelike, offset, target_offset)); |
183 | 202 | } |
184 | 203 |
|
185 | 204 | static inline int |
|
0 commit comments