aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/Perf-Trace-Util/Context.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/Context.c')
-rw-r--r--tools/perf/scripts/python/Perf-Trace-Util/Context.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Context.c b/tools/perf/scripts/python/Perf-Trace-Util/Context.c
index 7cef02d75bc7..26a45ae78be4 100644
--- a/tools/perf/scripts/python/Perf-Trace-Util/Context.c
+++ b/tools/perf/scripts/python/Perf-Trace-Util/Context.c
@@ -91,6 +91,12 @@ PyMODINIT_FUNC PyInit_perf_trace_context(void)
NULL, /* m_clear */
NULL, /* m_free */
};
- return PyModule_Create(&moduledef);
+ PyObject *mod;
+
+ mod = PyModule_Create(&moduledef);
+ /* Add perf_script_context to the module so it can be imported */
+ PyObject_SetAttrString(mod, "perf_script_context", Py_None);
+
+ return mod;
}
#endif