23 #include "../../../perf.h"
24 #include "../../../util/trace-event.h"
28 static PyObject *perf_trace_context_common_pc(PyObject *
self, PyObject *args)
34 if (!PyArg_ParseTuple(args,
"O", &context))
37 scripting_context = PyCObject_AsVoidPtr(context);
40 return Py_BuildValue(
"i", retval);
43 static PyObject *perf_trace_context_common_flags(PyObject *
self,
50 if (!PyArg_ParseTuple(args,
"O", &context))
53 scripting_context = PyCObject_AsVoidPtr(context);
56 return Py_BuildValue(
"i", retval);
59 static PyObject *perf_trace_context_common_lock_depth(PyObject *
self,
66 if (!PyArg_ParseTuple(args,
"O", &context))
69 scripting_context = PyCObject_AsVoidPtr(context);
72 return Py_BuildValue(
"i", retval);
75 static PyMethodDef ContextMethods[] = {
76 {
"common_pc", perf_trace_context_common_pc, METH_VARARGS,
77 "Get the common preempt count event field value."},
78 {
"common_flags", perf_trace_context_common_flags, METH_VARARGS,
79 "Get the common flags event field value."},
80 {
"common_lock_depth", perf_trace_context_common_lock_depth,
81 METH_VARARGS,
"Get the common lock depth event field value."},
87 (
void) Py_InitModule(
"perf_trace_context", ContextMethods);