Skip to content

Commit f341b51

Browse files
committed
Update C API
1 parent e6dde7c commit f341b51

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Include/cpython/monitoring.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ _PyMonitoring_FireBranchEvent(PyMonitoringState *state, PyObject *codelike, int3
8181
PyObject *target_offset);
8282

8383
PyAPI_FUNC(int)
84-
_PyMonitoring_FireBranchTakenEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
84+
_PyMonitoring_FireBranchRightEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
8585
PyObject *target_offset);
8686

8787
PyAPI_FUNC(int)
88-
_PyMonitoring_FireBranchNotTakenEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
88+
_PyMonitoring_FireBranchLeftEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
8989
PyObject *target_offset);
9090

9191
PyAPI_FUNC(int)
@@ -184,21 +184,21 @@ PyMonitoring_FireJumpEvent(PyMonitoringState *state, PyObject *codelike, int32_t
184184
}
185185

186186
static inline int
187-
PyMonitoring_FireBranchTakenEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
187+
PyMonitoring_FireBranchRightEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
188188
PyObject *target_offset)
189189
{
190190
_PYMONITORING_IF_ACTIVE(
191191
state,
192-
_PyMonitoring_FireBranchTakenEvent(state, codelike, offset, target_offset));
192+
_PyMonitoring_FireBranchRightEvent(state, codelike, offset, target_offset));
193193
}
194194

195195
static inline int
196-
PyMonitoring_FireBranchNotTakenEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
196+
PyMonitoring_FireBranchLeftEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
197197
PyObject *target_offset)
198198
{
199199
_PYMONITORING_IF_ACTIVE(
200200
state,
201-
_PyMonitoring_FireBranchNotTakenEvent(state, codelike, offset, target_offset));
201+
_PyMonitoring_FireBranchLeftEvent(state, codelike, offset, target_offset));
202202
}
203203

204204
static inline int

Lib/test/test_monitoring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,8 +2069,8 @@ def setUp(self):
20692069
( 1, E.PY_RETURN, capi.fire_event_py_return, 20),
20702070
( 2, E.CALL, capi.fire_event_call, callable, 40),
20712071
( 1, E.JUMP, capi.fire_event_jump, 60),
2072-
( 1, E.BRANCH_RIGHT, capi.fire_event_branch_taken, 70),
2073-
( 1, E.BRANCH_LEFT, capi.fire_event_branch_not_taken, 80),
2072+
( 1, E.BRANCH_RIGHT, capi.fire_event_branch_right, 70),
2073+
( 1, E.BRANCH_LEFT, capi.fire_event_branch_left, 80),
20742074
( 1, E.PY_THROW, capi.fire_event_py_throw, ValueError(1)),
20752075
( 1, E.RAISE, capi.fire_event_raise, ValueError(2)),
20762076
( 1, E.EXCEPTION_HANDLED, capi.fire_event_exception_handled, ValueError(5)),

Modules/_testcapi/monitoring.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ fire_event_jump(PyObject *self, PyObject *args)
286286
}
287287

288288
static PyObject *
289-
fire_event_branch_taken(PyObject *self, PyObject *args)
289+
fire_event_branch_right(PyObject *self, PyObject *args)
290290
{
291291
PyObject *codelike;
292292
int offset;
@@ -299,12 +299,12 @@ fire_event_branch_taken(PyObject *self, PyObject *args)
299299
if (state == NULL) {
300300
return NULL;
301301
}
302-
int res = PyMonitoring_FireBranchTakenEvent(state, codelike, offset, target_offset);
302+
int res = PyMonitoring_FireBranchRightEvent(state, codelike, offset, target_offset);
303303
RETURN_INT(teardown_fire(res, state, exception));
304304
}
305305

306306
static PyObject *
307-
fire_event_branch_not_taken(PyObject *self, PyObject *args)
307+
fire_event_branch_left(PyObject *self, PyObject *args)
308308
{
309309
PyObject *codelike;
310310
int offset;
@@ -317,7 +317,7 @@ fire_event_branch_not_taken(PyObject *self, PyObject *args)
317317
if (state == NULL) {
318318
return NULL;
319319
}
320-
int res = PyMonitoring_FireBranchNotTakenEvent(state, codelike, offset, target_offset);
320+
int res = PyMonitoring_FireBranchLeftEvent(state, codelike, offset, target_offset);
321321
RETURN_INT(teardown_fire(res, state, exception));
322322
}
323323

@@ -496,8 +496,8 @@ static PyMethodDef TestMethods[] = {
496496
{"fire_event_call", fire_event_call, METH_VARARGS},
497497
{"fire_event_line", fire_event_line, METH_VARARGS},
498498
{"fire_event_jump", fire_event_jump, METH_VARARGS},
499-
{"fire_event_branch_taken", fire_event_branch_taken, METH_VARARGS},
500-
{"fire_event_branch_not_taken", fire_event_branch_not_taken, METH_VARARGS},
499+
{"fire_event_branch_left", fire_event_branch_left, METH_VARARGS},
500+
{"fire_event_branch_right", fire_event_branch_right, METH_VARARGS},
501501
{"fire_event_py_throw", fire_event_py_throw, METH_VARARGS},
502502
{"fire_event_raise", fire_event_raise, METH_VARARGS},
503503
{"fire_event_c_raise", fire_event_c_raise, METH_VARARGS},

Python/instrumentation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,7 +2605,7 @@ _PyMonitoring_FireBranchEvent(PyMonitoringState *state, PyObject *codelike, int3
26052605
}
26062606

26072607
int
2608-
_PyMonitoring_FireBranchTakenEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
2608+
_PyMonitoring_FireBranchRightEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
26092609
PyObject *target_offset)
26102610
{
26112611
assert(state->active);
@@ -2615,7 +2615,7 @@ _PyMonitoring_FireBranchTakenEvent(PyMonitoringState *state, PyObject *codelike,
26152615
}
26162616

26172617
int
2618-
_PyMonitoring_FireBranchNotTakenEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
2618+
_PyMonitoring_FireBranchLeftEvent(PyMonitoringState *state, PyObject *codelike, int32_t offset,
26192619
PyObject *target_offset)
26202620
{
26212621
assert(state->active);

0 commit comments

Comments
 (0)