@@ -137,7 +137,7 @@ is_instrumented(int opcode)
137137static inline bool
138138monitors_equals (_Py_Monitors a , _Py_Monitors b )
139139{
140- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
140+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
141141 if (a .tools [i ] != b .tools [i ]) {
142142 return false;
143143 }
@@ -150,7 +150,7 @@ static inline _Py_Monitors
150150monitors_sub (_Py_Monitors a , _Py_Monitors b )
151151{
152152 _Py_Monitors res ;
153- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
153+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
154154 res .tools [i ] = a .tools [i ] & ~b .tools [i ];
155155 }
156156 return res ;
@@ -161,7 +161,7 @@ static inline _Py_Monitors
161161monitors_and (_Py_Monitors a , _Py_Monitors b )
162162{
163163 _Py_Monitors res ;
164- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
164+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
165165 res .tools [i ] = a .tools [i ] & b .tools [i ];
166166 }
167167 return res ;
@@ -172,7 +172,7 @@ static inline _Py_Monitors
172172monitors_or (_Py_Monitors a , _Py_Monitors b )
173173{
174174 _Py_Monitors res ;
175- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
175+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
176176 res .tools [i ] = a .tools [i ] | b .tools [i ];
177177 }
178178 return res ;
@@ -181,7 +181,7 @@ monitors_or(_Py_Monitors a, _Py_Monitors b)
181181static inline bool
182182monitors_are_empty (_Py_Monitors m )
183183{
184- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
184+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
185185 if (m .tools [i ]) {
186186 return false;
187187 }
@@ -192,7 +192,7 @@ monitors_are_empty(_Py_Monitors m)
192192static inline bool
193193multiple_tools (_Py_Monitors * m )
194194{
195- for (int i = 0 ; i < PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
195+ for (int i = 0 ; i < _PY_MONITORING_UNGROUPED_EVENTS ; i ++ ) {
196196 if (_Py_popcount32 (m -> tools [i ]) > 1 ) {
197197 return true;
198198 }
@@ -204,7 +204,7 @@ static inline _PyMonitoringEventSet
204204get_events (_Py_Monitors * m , int tool_id )
205205{
206206 _PyMonitoringEventSet result = 0 ;
207- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
207+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
208208 if ((m -> tools [e ] >> tool_id ) & 1 ) {
209209 result |= (1 << e );
210210 }
@@ -339,7 +339,7 @@ static void
339339dump_monitors (const char * prefix , _Py_Monitors monitors , FILE * out )
340340{
341341 fprintf (out , "%s monitors:\n" , prefix );
342- for (int event = 0 ; event < PY_MONITORING_UNGROUPED_EVENTS ; event ++ ) {
342+ for (int event = 0 ; event < _PY_MONITORING_UNGROUPED_EVENTS ; event ++ ) {
343343 fprintf (out , " Event %d: Tools %x\n" , event , monitors .tools [event ]);
344344 }
345345}
@@ -907,7 +907,7 @@ get_tools_for_instruction(PyCodeObject *code, PyInterpreterState *interp, int i,
907907 uint8_t tools ;
908908 assert (event != PY_MONITORING_EVENT_LINE );
909909 assert (event != PY_MONITORING_EVENT_INSTRUCTION );
910- if (event >= PY_MONITORING_UNGROUPED_EVENTS ) {
910+ if (event >= _PY_MONITORING_UNGROUPED_EVENTS ) {
911911 assert (event == PY_MONITORING_EVENT_C_RAISE ||
912912 event == PY_MONITORING_EVENT_C_RETURN );
913913 event = PY_MONITORING_EVENT_CALL ;
@@ -1220,7 +1220,7 @@ _PyMonitoring_RegisterCallback(int tool_id, int event_id, PyObject *obj)
12201220{
12211221 PyInterpreterState * is = _PyInterpreterState_GET ();
12221222 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
1223- assert (0 <= event_id && event_id < PY_MONITORING_EVENTS );
1223+ assert (0 <= event_id && event_id < _PY_MONITORING_EVENTS );
12241224 PyObject * callback = is -> monitoring_callables [tool_id ][event_id ];
12251225 is -> monitoring_callables [tool_id ][event_id ] = Py_XNewRef (obj );
12261226 return callback ;
@@ -1653,7 +1653,7 @@ static void
16531653set_events (_Py_Monitors * m , int tool_id , _PyMonitoringEventSet events )
16541654{
16551655 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
1656- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
1656+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
16571657 uint8_t * tools = & m -> tools [e ];
16581658 int val = (events >> e ) & 1 ;
16591659 * tools &= ~(1 << tool_id );
@@ -1678,7 +1678,7 @@ _PyMonitoring_SetEvents(int tool_id, _PyMonitoringEventSet events)
16781678{
16791679 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
16801680 PyInterpreterState * interp = _PyInterpreterState_GET ();
1681- assert (events < (1 << PY_MONITORING_UNGROUPED_EVENTS ));
1681+ assert (events < (1 << _PY_MONITORING_UNGROUPED_EVENTS ));
16821682 if (check_tool (interp , tool_id )) {
16831683 return -1 ;
16841684 }
@@ -1696,7 +1696,7 @@ _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEvent
16961696{
16971697 assert (0 <= tool_id && tool_id < PY_MONITORING_TOOL_IDS );
16981698 PyInterpreterState * interp = _PyInterpreterState_GET ();
1699- assert (events < (1 << PY_MONITORING_UNGROUPED_EVENTS ));
1699+ assert (events < (1 << _PY_MONITORING_UNGROUPED_EVENTS ));
17001700 if (check_tool (interp , tool_id )) {
17011701 return -1 ;
17021702 }
@@ -1835,7 +1835,7 @@ monitoring_register_callback_impl(PyObject *module, int tool_id, int event,
18351835 return NULL ;
18361836 }
18371837 int event_id = _Py_bit_length (event )- 1 ;
1838- if (event_id < 0 || event_id >= PY_MONITORING_EVENTS ) {
1838+ if (event_id < 0 || event_id >= _PY_MONITORING_EVENTS ) {
18391839 PyErr_Format (PyExc_ValueError , "invalid event %d" , event );
18401840 return NULL ;
18411841 }
@@ -1885,7 +1885,7 @@ monitoring_set_events_impl(PyObject *module, int tool_id, int event_set)
18851885 if (check_valid_tool (tool_id )) {
18861886 return NULL ;
18871887 }
1888- if (event_set < 0 || event_set >= (1 << PY_MONITORING_EVENTS )) {
1888+ if (event_set < 0 || event_set >= (1 << _PY_MONITORING_EVENTS )) {
18891889 PyErr_Format (PyExc_ValueError , "invalid event set 0x%x" , event_set );
18901890 return NULL ;
18911891 }
@@ -1927,7 +1927,7 @@ monitoring_get_local_events_impl(PyObject *module, int tool_id,
19271927 _PyMonitoringEventSet event_set = 0 ;
19281928 _PyCoMonitoringData * data = ((PyCodeObject * )code )-> _co_monitoring ;
19291929 if (data != NULL ) {
1930- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
1930+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
19311931 if ((data -> local_monitors .tools [e ] >> tool_id ) & 1 ) {
19321932 event_set |= (1 << e );
19331933 }
@@ -1961,7 +1961,7 @@ monitoring_set_local_events_impl(PyObject *module, int tool_id,
19611961 if (check_valid_tool (tool_id )) {
19621962 return NULL ;
19631963 }
1964- if (event_set < 0 || event_set >= (1 << PY_MONITORING_EVENTS )) {
1964+ if (event_set < 0 || event_set >= (1 << _PY_MONITORING_EVENTS )) {
19651965 PyErr_Format (PyExc_ValueError , "invalid event set 0x%x" , event_set );
19661966 return NULL ;
19671967 }
@@ -2042,7 +2042,7 @@ monitoring__all_events_impl(PyObject *module)
20422042 if (res == NULL ) {
20432043 return NULL ;
20442044 }
2045- for (int e = 0 ; e < PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
2045+ for (int e = 0 ; e < _PY_MONITORING_UNGROUPED_EVENTS ; e ++ ) {
20462046 uint8_t tools = interp -> monitors .tools [e ];
20472047 if (tools == 0 ) {
20482048 continue ;
@@ -2101,7 +2101,7 @@ PyObject *_Py_CreateMonitoringObject(void)
21012101 if (err ) {
21022102 goto error ;
21032103 }
2104- for (int i = 0 ; i < PY_MONITORING_EVENTS ; i ++ ) {
2104+ for (int i = 0 ; i < _PY_MONITORING_EVENTS ; i ++ ) {
21052105 if (add_power2_constant (events , event_names [i ], i )) {
21062106 goto error ;
21072107 }
0 commit comments