/src/cpython/Python/clinic/instrumentation.c.h
Line | Count | Source (jump to first uncovered line) |
1 | | /*[clinic input] |
2 | | preserve |
3 | | [clinic start generated code]*/ |
4 | | |
5 | | #include "pycore_modsupport.h" // _PyArg_CheckPositional() |
6 | | |
7 | | PyDoc_STRVAR(monitoring_use_tool_id__doc__, |
8 | | "use_tool_id($module, tool_id, name, /)\n" |
9 | | "--\n" |
10 | | "\n"); |
11 | | |
12 | | #define MONITORING_USE_TOOL_ID_METHODDEF \ |
13 | | {"use_tool_id", _PyCFunction_CAST(monitoring_use_tool_id), METH_FASTCALL, monitoring_use_tool_id__doc__}, |
14 | | |
15 | | static PyObject * |
16 | | monitoring_use_tool_id_impl(PyObject *module, int tool_id, PyObject *name); |
17 | | |
18 | | static PyObject * |
19 | | monitoring_use_tool_id(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
20 | 0 | { |
21 | 0 | PyObject *return_value = NULL; |
22 | 0 | int tool_id; |
23 | 0 | PyObject *name; |
24 | |
|
25 | 0 | if (!_PyArg_CheckPositional("use_tool_id", nargs, 2, 2)) { |
26 | 0 | goto exit; |
27 | 0 | } |
28 | 0 | tool_id = PyLong_AsInt(args[0]); |
29 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
30 | 0 | goto exit; |
31 | 0 | } |
32 | 0 | name = args[1]; |
33 | 0 | return_value = monitoring_use_tool_id_impl(module, tool_id, name); |
34 | |
|
35 | 0 | exit: |
36 | 0 | return return_value; |
37 | 0 | } |
38 | | |
39 | | PyDoc_STRVAR(monitoring_clear_tool_id__doc__, |
40 | | "clear_tool_id($module, tool_id, /)\n" |
41 | | "--\n" |
42 | | "\n"); |
43 | | |
44 | | #define MONITORING_CLEAR_TOOL_ID_METHODDEF \ |
45 | | {"clear_tool_id", (PyCFunction)monitoring_clear_tool_id, METH_O, monitoring_clear_tool_id__doc__}, |
46 | | |
47 | | static PyObject * |
48 | | monitoring_clear_tool_id_impl(PyObject *module, int tool_id); |
49 | | |
50 | | static PyObject * |
51 | | monitoring_clear_tool_id(PyObject *module, PyObject *arg) |
52 | 0 | { |
53 | 0 | PyObject *return_value = NULL; |
54 | 0 | int tool_id; |
55 | |
|
56 | 0 | tool_id = PyLong_AsInt(arg); |
57 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
58 | 0 | goto exit; |
59 | 0 | } |
60 | 0 | return_value = monitoring_clear_tool_id_impl(module, tool_id); |
61 | |
|
62 | 0 | exit: |
63 | 0 | return return_value; |
64 | 0 | } |
65 | | |
66 | | PyDoc_STRVAR(monitoring_free_tool_id__doc__, |
67 | | "free_tool_id($module, tool_id, /)\n" |
68 | | "--\n" |
69 | | "\n"); |
70 | | |
71 | | #define MONITORING_FREE_TOOL_ID_METHODDEF \ |
72 | | {"free_tool_id", (PyCFunction)monitoring_free_tool_id, METH_O, monitoring_free_tool_id__doc__}, |
73 | | |
74 | | static PyObject * |
75 | | monitoring_free_tool_id_impl(PyObject *module, int tool_id); |
76 | | |
77 | | static PyObject * |
78 | | monitoring_free_tool_id(PyObject *module, PyObject *arg) |
79 | 0 | { |
80 | 0 | PyObject *return_value = NULL; |
81 | 0 | int tool_id; |
82 | |
|
83 | 0 | tool_id = PyLong_AsInt(arg); |
84 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
85 | 0 | goto exit; |
86 | 0 | } |
87 | 0 | return_value = monitoring_free_tool_id_impl(module, tool_id); |
88 | |
|
89 | 0 | exit: |
90 | 0 | return return_value; |
91 | 0 | } |
92 | | |
93 | | PyDoc_STRVAR(monitoring_get_tool__doc__, |
94 | | "get_tool($module, tool_id, /)\n" |
95 | | "--\n" |
96 | | "\n"); |
97 | | |
98 | | #define MONITORING_GET_TOOL_METHODDEF \ |
99 | | {"get_tool", (PyCFunction)monitoring_get_tool, METH_O, monitoring_get_tool__doc__}, |
100 | | |
101 | | static PyObject * |
102 | | monitoring_get_tool_impl(PyObject *module, int tool_id); |
103 | | |
104 | | static PyObject * |
105 | | monitoring_get_tool(PyObject *module, PyObject *arg) |
106 | 0 | { |
107 | 0 | PyObject *return_value = NULL; |
108 | 0 | int tool_id; |
109 | |
|
110 | 0 | tool_id = PyLong_AsInt(arg); |
111 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
112 | 0 | goto exit; |
113 | 0 | } |
114 | 0 | return_value = monitoring_get_tool_impl(module, tool_id); |
115 | |
|
116 | 0 | exit: |
117 | 0 | return return_value; |
118 | 0 | } |
119 | | |
120 | | PyDoc_STRVAR(monitoring_register_callback__doc__, |
121 | | "register_callback($module, tool_id, event, func, /)\n" |
122 | | "--\n" |
123 | | "\n"); |
124 | | |
125 | | #define MONITORING_REGISTER_CALLBACK_METHODDEF \ |
126 | | {"register_callback", _PyCFunction_CAST(monitoring_register_callback), METH_FASTCALL, monitoring_register_callback__doc__}, |
127 | | |
128 | | static PyObject * |
129 | | monitoring_register_callback_impl(PyObject *module, int tool_id, int event, |
130 | | PyObject *func); |
131 | | |
132 | | static PyObject * |
133 | | monitoring_register_callback(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
134 | 0 | { |
135 | 0 | PyObject *return_value = NULL; |
136 | 0 | int tool_id; |
137 | 0 | int event; |
138 | 0 | PyObject *func; |
139 | |
|
140 | 0 | if (!_PyArg_CheckPositional("register_callback", nargs, 3, 3)) { |
141 | 0 | goto exit; |
142 | 0 | } |
143 | 0 | tool_id = PyLong_AsInt(args[0]); |
144 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
145 | 0 | goto exit; |
146 | 0 | } |
147 | 0 | event = PyLong_AsInt(args[1]); |
148 | 0 | if (event == -1 && PyErr_Occurred()) { |
149 | 0 | goto exit; |
150 | 0 | } |
151 | 0 | func = args[2]; |
152 | 0 | return_value = monitoring_register_callback_impl(module, tool_id, event, func); |
153 | |
|
154 | 0 | exit: |
155 | 0 | return return_value; |
156 | 0 | } |
157 | | |
158 | | PyDoc_STRVAR(monitoring_get_events__doc__, |
159 | | "get_events($module, tool_id, /)\n" |
160 | | "--\n" |
161 | | "\n"); |
162 | | |
163 | | #define MONITORING_GET_EVENTS_METHODDEF \ |
164 | | {"get_events", (PyCFunction)monitoring_get_events, METH_O, monitoring_get_events__doc__}, |
165 | | |
166 | | static int |
167 | | monitoring_get_events_impl(PyObject *module, int tool_id); |
168 | | |
169 | | static PyObject * |
170 | | monitoring_get_events(PyObject *module, PyObject *arg) |
171 | 0 | { |
172 | 0 | PyObject *return_value = NULL; |
173 | 0 | int tool_id; |
174 | 0 | int _return_value; |
175 | |
|
176 | 0 | tool_id = PyLong_AsInt(arg); |
177 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
178 | 0 | goto exit; |
179 | 0 | } |
180 | 0 | _return_value = monitoring_get_events_impl(module, tool_id); |
181 | 0 | if ((_return_value == -1) && PyErr_Occurred()) { |
182 | 0 | goto exit; |
183 | 0 | } |
184 | 0 | return_value = PyLong_FromLong((long)_return_value); |
185 | |
|
186 | 0 | exit: |
187 | 0 | return return_value; |
188 | 0 | } |
189 | | |
190 | | PyDoc_STRVAR(monitoring_set_events__doc__, |
191 | | "set_events($module, tool_id, event_set, /)\n" |
192 | | "--\n" |
193 | | "\n"); |
194 | | |
195 | | #define MONITORING_SET_EVENTS_METHODDEF \ |
196 | | {"set_events", _PyCFunction_CAST(monitoring_set_events), METH_FASTCALL, monitoring_set_events__doc__}, |
197 | | |
198 | | static PyObject * |
199 | | monitoring_set_events_impl(PyObject *module, int tool_id, int event_set); |
200 | | |
201 | | static PyObject * |
202 | | monitoring_set_events(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
203 | 0 | { |
204 | 0 | PyObject *return_value = NULL; |
205 | 0 | int tool_id; |
206 | 0 | int event_set; |
207 | |
|
208 | 0 | if (!_PyArg_CheckPositional("set_events", nargs, 2, 2)) { |
209 | 0 | goto exit; |
210 | 0 | } |
211 | 0 | tool_id = PyLong_AsInt(args[0]); |
212 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
213 | 0 | goto exit; |
214 | 0 | } |
215 | 0 | event_set = PyLong_AsInt(args[1]); |
216 | 0 | if (event_set == -1 && PyErr_Occurred()) { |
217 | 0 | goto exit; |
218 | 0 | } |
219 | 0 | return_value = monitoring_set_events_impl(module, tool_id, event_set); |
220 | |
|
221 | 0 | exit: |
222 | 0 | return return_value; |
223 | 0 | } |
224 | | |
225 | | PyDoc_STRVAR(monitoring_get_local_events__doc__, |
226 | | "get_local_events($module, tool_id, code, /)\n" |
227 | | "--\n" |
228 | | "\n"); |
229 | | |
230 | | #define MONITORING_GET_LOCAL_EVENTS_METHODDEF \ |
231 | | {"get_local_events", _PyCFunction_CAST(monitoring_get_local_events), METH_FASTCALL, monitoring_get_local_events__doc__}, |
232 | | |
233 | | static int |
234 | | monitoring_get_local_events_impl(PyObject *module, int tool_id, |
235 | | PyObject *code); |
236 | | |
237 | | static PyObject * |
238 | | monitoring_get_local_events(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
239 | 0 | { |
240 | 0 | PyObject *return_value = NULL; |
241 | 0 | int tool_id; |
242 | 0 | PyObject *code; |
243 | 0 | int _return_value; |
244 | |
|
245 | 0 | if (!_PyArg_CheckPositional("get_local_events", nargs, 2, 2)) { |
246 | 0 | goto exit; |
247 | 0 | } |
248 | 0 | tool_id = PyLong_AsInt(args[0]); |
249 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
250 | 0 | goto exit; |
251 | 0 | } |
252 | 0 | code = args[1]; |
253 | 0 | _return_value = monitoring_get_local_events_impl(module, tool_id, code); |
254 | 0 | if ((_return_value == -1) && PyErr_Occurred()) { |
255 | 0 | goto exit; |
256 | 0 | } |
257 | 0 | return_value = PyLong_FromLong((long)_return_value); |
258 | |
|
259 | 0 | exit: |
260 | 0 | return return_value; |
261 | 0 | } |
262 | | |
263 | | PyDoc_STRVAR(monitoring_set_local_events__doc__, |
264 | | "set_local_events($module, tool_id, code, event_set, /)\n" |
265 | | "--\n" |
266 | | "\n"); |
267 | | |
268 | | #define MONITORING_SET_LOCAL_EVENTS_METHODDEF \ |
269 | | {"set_local_events", _PyCFunction_CAST(monitoring_set_local_events), METH_FASTCALL, monitoring_set_local_events__doc__}, |
270 | | |
271 | | static PyObject * |
272 | | monitoring_set_local_events_impl(PyObject *module, int tool_id, |
273 | | PyObject *code, int event_set); |
274 | | |
275 | | static PyObject * |
276 | | monitoring_set_local_events(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
277 | 0 | { |
278 | 0 | PyObject *return_value = NULL; |
279 | 0 | int tool_id; |
280 | 0 | PyObject *code; |
281 | 0 | int event_set; |
282 | |
|
283 | 0 | if (!_PyArg_CheckPositional("set_local_events", nargs, 3, 3)) { |
284 | 0 | goto exit; |
285 | 0 | } |
286 | 0 | tool_id = PyLong_AsInt(args[0]); |
287 | 0 | if (tool_id == -1 && PyErr_Occurred()) { |
288 | 0 | goto exit; |
289 | 0 | } |
290 | 0 | code = args[1]; |
291 | 0 | event_set = PyLong_AsInt(args[2]); |
292 | 0 | if (event_set == -1 && PyErr_Occurred()) { |
293 | 0 | goto exit; |
294 | 0 | } |
295 | 0 | return_value = monitoring_set_local_events_impl(module, tool_id, code, event_set); |
296 | |
|
297 | 0 | exit: |
298 | 0 | return return_value; |
299 | 0 | } |
300 | | |
301 | | PyDoc_STRVAR(monitoring_restart_events__doc__, |
302 | | "restart_events($module, /)\n" |
303 | | "--\n" |
304 | | "\n"); |
305 | | |
306 | | #define MONITORING_RESTART_EVENTS_METHODDEF \ |
307 | | {"restart_events", (PyCFunction)monitoring_restart_events, METH_NOARGS, monitoring_restart_events__doc__}, |
308 | | |
309 | | static PyObject * |
310 | | monitoring_restart_events_impl(PyObject *module); |
311 | | |
312 | | static PyObject * |
313 | | monitoring_restart_events(PyObject *module, PyObject *Py_UNUSED(ignored)) |
314 | 0 | { |
315 | 0 | return monitoring_restart_events_impl(module); |
316 | 0 | } |
317 | | |
318 | | PyDoc_STRVAR(monitoring__all_events__doc__, |
319 | | "_all_events($module, /)\n" |
320 | | "--\n" |
321 | | "\n"); |
322 | | |
323 | | #define MONITORING__ALL_EVENTS_METHODDEF \ |
324 | | {"_all_events", (PyCFunction)monitoring__all_events, METH_NOARGS, monitoring__all_events__doc__}, |
325 | | |
326 | | static PyObject * |
327 | | monitoring__all_events_impl(PyObject *module); |
328 | | |
329 | | static PyObject * |
330 | | monitoring__all_events(PyObject *module, PyObject *Py_UNUSED(ignored)) |
331 | 0 | { |
332 | 0 | return monitoring__all_events_impl(module); |
333 | 0 | } |
334 | | /*[clinic end generated code: output=8f81876c6aba9be8 input=a9049054013a1b77]*/ |