|
8 | 8 | extern "C" { |
9 | 9 | #endif |
10 | 10 |
|
11 | | -/* Total tool ids available */ |
12 | | -#define _PY_MONITORING_TOOL_IDS 8 |
13 | | -/* Count of all local monitoring events */ |
14 | | -#define _PY_MONITORING_LOCAL_EVENTS 11 |
15 | | -/* Count of all "real" monitoring events (not derived from other events) */ |
16 | | -#define _PY_MONITORING_UNGROUPED_EVENTS 16 |
17 | | -/* Count of all monitoring events */ |
18 | | -#define _PY_MONITORING_EVENTS 19 |
19 | | - |
20 | | -/* Tables of which tools are active for each monitored event. */ |
21 | | -typedef struct _Py_LocalMonitors { |
22 | | - uint8_t tools[_PY_MONITORING_LOCAL_EVENTS]; |
23 | | -} _Py_LocalMonitors; |
24 | | - |
25 | | -typedef struct _Py_GlobalMonitors { |
26 | | - uint8_t tools[_PY_MONITORING_UNGROUPED_EVENTS]; |
27 | | -} _Py_GlobalMonitors; |
28 | | - |
29 | | - |
30 | 11 | typedef struct { |
31 | 12 | PyObject *_co_code; |
32 | 13 | PyObject *_co_varnames; |
33 | 14 | PyObject *_co_cellvars; |
34 | 15 | PyObject *_co_freevars; |
35 | 16 | } _PyCoCached; |
36 | 17 |
|
37 | | -/* Ancillary data structure used for instrumentation. |
38 | | - Line instrumentation creates this with sufficient |
39 | | - space for one entry per code unit. The total size |
40 | | - of the data will be `bytes_per_entry * Py_SIZE(code)` */ |
41 | | -typedef struct { |
42 | | - uint8_t bytes_per_entry; |
43 | | - uint8_t data[1]; |
44 | | -} _PyCoLineInstrumentationData; |
45 | | - |
46 | | - |
47 | 18 | typedef struct { |
48 | 19 | int size; |
49 | 20 | int capacity; |
50 | 21 | struct _PyExecutorObject *executors[1]; |
51 | 22 | } _PyExecutorArray; |
52 | 23 |
|
53 | | -/* Main data structure used for instrumentation. |
54 | | - * This is allocated when needed for instrumentation |
55 | | - */ |
56 | | -typedef struct { |
57 | | - /* Monitoring specific to this code object */ |
58 | | - _Py_LocalMonitors local_monitors; |
59 | | - /* Monitoring that is active on this code object */ |
60 | | - _Py_LocalMonitors active_monitors; |
61 | | - /* The tools that are to be notified for events for the matching code unit */ |
62 | | - uint8_t *tools; |
63 | | - /* The version of tools when they instrument the code */ |
64 | | - uintptr_t tool_versions[_PY_MONITORING_TOOL_IDS]; |
65 | | - /* Information to support line events */ |
66 | | - _PyCoLineInstrumentationData *lines; |
67 | | - /* The tools that are to be notified for line events for the matching code unit */ |
68 | | - uint8_t *line_tools; |
69 | | - /* Information to support instruction events */ |
70 | | - /* The underlying instructions, which can themselves be instrumented */ |
71 | | - uint8_t *per_instruction_opcodes; |
72 | | - /* The tools that are to be notified for instruction events for the matching code unit */ |
73 | | - uint8_t *per_instruction_tools; |
74 | | -} _PyCoMonitoringData; |
75 | 24 |
|
76 | 25 | #ifdef Py_GIL_DISABLED |
77 | 26 |
|
@@ -151,7 +100,7 @@ typedef struct { |
151 | 100 | _PyExecutorArray *co_executors; /* executors from optimizer */ \ |
152 | 101 | _PyCoCached *_co_cached; /* cached co_* attributes */ \ |
153 | 102 | uintptr_t _co_instrumentation_version; /* current instrumentation version */ \ |
154 | | - _PyCoMonitoringData *_co_monitoring; /* Monitoring data */ \ |
| 103 | + struct _PyCoMonitoringData *_co_monitoring; /* Monitoring data */ \ |
155 | 104 | Py_ssize_t _co_unique_id; /* ID used for per-thread refcounting */ \ |
156 | 105 | int _co_firsttraceable; /* index of first traceable instruction */ \ |
157 | 106 | /* Scratch space for extra data relating to the code object. \ |
|
0 commit comments