@@ -138,7 +138,7 @@ is_instrumented(int opcode)
138138static inline bool
139139monitors_equals (_Py_Monitors a , _Py_Monitors b )
140140{
141- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
141+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
142142 if (a .tools [i ] != b .tools [i ]) {
143143 return false;
144144 }
@@ -151,7 +151,7 @@ static inline _Py_Monitors
151151monitors_sub (_Py_Monitors a , _Py_Monitors b )
152152{
153153 _Py_Monitors res ;
154- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
154+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
155155 res .tools [i ] = a .tools [i ] & ~b .tools [i ];
156156 }
157157 return res ;
@@ -162,7 +162,7 @@ static inline _Py_Monitors
162162monitors_and (_Py_Monitors a , _Py_Monitors b )
163163{
164164 _Py_Monitors res ;
165- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
165+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
166166 res .tools [i ] = a .tools [i ] & b .tools [i ];
167167 }
168168 return res ;
@@ -173,7 +173,7 @@ static inline _Py_Monitors
173173monitors_or (_Py_Monitors a , _Py_Monitors b )
174174{
175175 _Py_Monitors res ;
176- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
176+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
177177 res .tools [i ] = a .tools [i ] | b .tools [i ];
178178 }
179179 return res ;
@@ -182,7 +182,7 @@ monitors_or(_Py_Monitors a, _Py_Monitors b)
182182static inline bool
183183monitors_are_empty (_Py_Monitors m )
184184{
185- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
185+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
186186 if (m .tools [i ]) {
187187 return false;
188188 }
@@ -193,7 +193,7 @@ monitors_are_empty(_Py_Monitors m)
193193static inline bool
194194multiple_tools (_Py_Monitors * m )
195195{
196- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
196+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
197197 if (_Py_popcount32 (m -> tools [i ]) > 1 ) {
198198 return true;
199199 }
@@ -205,7 +205,7 @@ static inline _PyMonitoringEventSet
205205get_events (_Py_Monitors * m , int tool_id )
206206{
207207 _PyMonitoringEventSet result = 0 ;
208- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
208+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
209209 if ((m -> tools [e ] >> tool_id ) & 1 ) {
210210 result |= (1 << e );
211211 }
@@ -340,7 +340,7 @@ static void
340340dump_monitors (const char * prefix , _Py_Monitors monitors , FILE * out )
341341{
342342 fprintf (out , "%s monitors:\n" , prefix );
343- for (int event = 0 ; event < PY_MONITORING_UNGROUPED_EVENTS ; event ++ ) {
343+ for (int event = 0 ; event < _PY_MONITORING_UNGROUPED_EVENTS ; event ++ ) {
344344 fprintf (out , " Event %d: Tools %x\n" , event , monitors .tools [event ]);
345345 }
346346}
@@ -910,7 +910,7 @@ get_tools_for_instruction(PyCodeObject * code, int i, int event)
910910 assert (event != PY_MONITORING_EVENT_INSTRUCTION );
911911 assert (instrumentation_cross_checks (PyThreadState_GET ()-> interp , code ));
912912 _PyCoMonitoringData * monitoring = code -> _co_monitoring ;
913- if (event >= PY_MONITORING_UNGROUPED_EVENTS ) {
913+ if (event >= _PY_MONITORING_UNGROUPED_EVENTS ) {
914914 assert (event == PY_MONITORING_EVENT_C_RAISE ||
915915 event == PY_MONITORING_EVENT_C_RETURN );
916916 event = PY_MONITORING_EVENT_CALL ;
@@ -1216,7 +1216,7 @@ _PyMonitoring_RegisterCallback(int tool_id, int event_id, PyObject *obj)
12161216{
12171217 PyInterpreterState * is = _PyInterpreterState_Get ();
12181218 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
1219- assert (0 <= event_id && event_id < PY_MONITORING_EVENTS );
1219+ assert (0 <= event_id && event_id < _PY_MONITORING_EVENTS );
12201220 PyObject * callback = is -> monitoring_callables [tool_id ][event_id ];
12211221 is -> monitoring_callables [tool_id ][event_id ] = Py_XNewRef (obj );
12221222 return callback ;
@@ -1667,7 +1667,7 @@ static void
16671667set_events (_Py_Monitors * m , int tool_id , _PyMonitoringEventSet events )
16681668{
16691669 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
1670- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
1670+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
16711671 uint8_t * tools = & m -> tools [e ];
16721672 int val = (events >> e ) & 1 ;
16731673 * tools &= ~(1 << tool_id );
@@ -1692,7 +1692,7 @@ _PyMonitoring_SetEvents(int tool_id, _PyMonitoringEventSet events)
16921692{
16931693 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
16941694 PyInterpreterState * interp = _PyInterpreterState_Get ();
1695- assert (events < (1 << PY_MONITORING_UNGROUPED_EVENTS ));
1695+ assert (events < (1 << _PY_MONITORING_UNGROUPED_EVENTS ));
16961696 if (check_tool (interp , tool_id )) {
16971697 return -1 ;
16981698 }
@@ -1710,7 +1710,7 @@ _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEvent
17101710{
17111711 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
17121712 PyInterpreterState * interp = _PyInterpreterState_Get ();
1713- assert (events < (1 << PY_MONITORING_UNGROUPED_EVENTS ));
1713+ assert (events < (1 << _PY_MONITORING_UNGROUPED_EVENTS ));
17141714 if (check_tool (interp , tool_id )) {
17151715 return -1 ;
17161716 }
@@ -1849,7 +1849,7 @@ monitoring_register_callback_impl(PyObject *module, int tool_id, int event,
18491849 return NULL ;
18501850 }
18511851 int event_id = _Py_bit_length (event )- 1 ;
1852- if (event_id < 0 || event_id >= PY_MONITORING_EVENTS ) {
1852+ if (event_id < 0 || event_id >= _PY_MONITORING_EVENTS ) {
18531853 PyErr_Format (PyExc_ValueError , "invalid event %d" , event );
18541854 return NULL ;
18551855 }
@@ -1899,7 +1899,7 @@ monitoring_set_events_impl(PyObject *module, int tool_id, int event_set)
18991899 if (check_valid_tool (tool_id )) {
19001900 return NULL ;
19011901 }
1902- if (event_set < 0 || event_set >= (1 << PY_MONITORING_EVENTS )) {
1902+ if (event_set < 0 || event_set >= (1 << _PY_MONITORING_EVENTS )) {
19031903 PyErr_Format (PyExc_ValueError , "invalid event set 0x%x" , event_set );
19041904 return NULL ;
19051905 }
@@ -1941,7 +1941,7 @@ monitoring_get_local_events_impl(PyObject *module, int tool_id,
19411941 _PyMonitoringEventSet event_set = 0 ;
19421942 _PyCoMonitoringData * data = ((PyCodeObject * )code )-> _co_monitoring ;
19431943 if (data != NULL ) {
1944- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
1944+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
19451945 if ((data -> local_monitors .tools [e ] >> tool_id ) & 1 ) {
19461946 event_set |= (1 << e );
19471947 }
@@ -1975,7 +1975,7 @@ monitoring_set_local_events_impl(PyObject *module, int tool_id,
19751975 if (check_valid_tool (tool_id )) {
19761976 return NULL ;
19771977 }
1978- if (event_set < 0 || event_set >= (1 << PY_MONITORING_EVENTS )) {
1978+ if (event_set < 0 || event_set >= (1 << _PY_MONITORING_EVENTS )) {
19791979 PyErr_Format (PyExc_ValueError , "invalid event set 0x%x" , event_set );
19801980 return NULL ;
19811981 }
@@ -2056,7 +2056,7 @@ monitoring__all_events_impl(PyObject *module)
20562056 if (res == NULL ) {
20572057 return NULL ;
20582058 }
2059- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
2059+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
20602060 uint8_t tools = interp -> monitors .tools [e ];
20612061 if (tools == 0 ) {
20622062 continue ;
@@ -2115,7 +2115,7 @@ PyObject *_Py_CreateMonitoringObject(void)
21152115 if (err ) {
21162116 goto error ;
21172117 }
2118- for (int i = 0 ; i < PY_MONITORING_EVENTS ; i ++ ) {
2118+ for (int i = 0 ; i < _PY_MONITORING_EVENTS ; i ++ ) {
21192119 if (add_power2_constant (events , event_names [i ], i )) {
21202120 goto error ;
21212121 }
0 commit comments