@@ -79,9 +79,17 @@ Events
7979
8080The following events are supported:
8181
82- .. monitoring-event :: BRANCH
82+ .. monitoring-event :: BRANCH_LEFT
8383
84- A conditional branch is taken (or not).
84+ A conditional branch goes left.
85+
86+ It is up to the tool to determine how to present "left" and "right" branches.
87+ There is no guarantee which branch is "left" and which is "right", except
88+ that it will be consistent for the duration of the program.
89+
90+ .. monitoring-event :: BRANCH_RIGHT
91+
92+ A conditional branch goes right.
8593
8694.. monitoring-event :: CALL
8795
@@ -180,9 +188,20 @@ The local events are:
180188* :monitoring-event: `LINE `
181189* :monitoring-event: `INSTRUCTION `
182190* :monitoring-event: `JUMP `
183- * :monitoring-event: `BRANCH `
191+ * :monitoring-event: `BRANCH_LEFT `
192+ * :monitoring-event: `BRANCH_RIGHT `
184193* :monitoring-event: `STOP_ITERATION `
185194
195+ Deprecated event
196+ ''''''''''''''''
197+
198+ * ``BRANCH ``
199+
200+ The ``BRANCH `` event is deprecated in 3.14.
201+ Using :monitoring-event: `BRANCH_LEFT ` and :monitoring-event: `BRANCH_RIGHT `
202+ events will give much better performance as they can be disabled
203+ independently.
204+
186205Ancillary events
187206''''''''''''''''
188207
@@ -357,13 +376,11 @@ Different events will provide the callback function with different arguments, as
357376
358377 func(code: CodeType, line_number: int) -> DISABLE | Any
359378
360- * :monitoring-event: `BRANCH ` and :monitoring-event: `JUMP `::
379+ * :monitoring-event: `BRANCH_LEFT `, :monitoring-event: ` BRANCH_RIGHT ` and :monitoring-event: `JUMP `::
361380
362381 func(code: CodeType, instruction_offset: int, destination_offset: int) -> DISABLE | Any
363382
364383 Note that the *destination_offset* is where the code will next execute.
365- For an untaken branch this will be the offset of the instruction following
366- the branch.
367384
368385* :monitoring-event: `INSTRUCTION `::
369386
0 commit comments