From: "Ziqian SUN (Zamir)" <sztsian@xxxxxxxxx> With ab37762ba9ad06a4f3902ad53ac2e9104bfd651f the gtk stuff was removed from kernel-shark. This patch removes the python-gui which depends on the trace-view from the gtk stuff. Signed-off-by: Ziqian SUN (Zamir) <sztsian@xxxxxxxxx> --- Makefile | 6 --- python/Makefile | 14 +------ python/ctracecmdgui.i | 88 ------------------------------------------- 3 files changed, 2 insertions(+), 106 deletions(-) delete mode 100644 python/ctracecmdgui.i diff --git a/Makefile b/Makefile index 1aca807..75bf1ef 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,6 @@ endif ifndef NO_PYTHON PYTHON := ctracecmd.so -PYTHON_GUI := ctracecmd.so ctracecmdgui.so PYTHON_VERS ?= python PYTHON_PKGCONFIG_VERS ?= $(PYTHON_VERS) @@ -473,14 +472,9 @@ export PYGTK_CFLAGS ctracecmd.so: force $(LIBTRACECMD_STATIC) $(Q)$(MAKE) -C $(src)/python $@ -ctracecmdgui.so: force $(LIBTRACECMD_STATIC) trace-view - $(Q)$(MAKE) -C $(src)/python $@ - PHONY += python python: $(PYTHON) -PHONY += python-gui -python-gui: $(PYTHON_GUI) dist: git archive --format=tar --prefix=trace-cmd-$(TRACECMD_VERSION)/ HEAD \ diff --git a/python/Makefile b/python/Makefile index 85224af..deaa83e 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,13 +1,9 @@ include $(src)/scripts/utils.mk -TRACE_VIEW_OBJS = -TRACE_VIEW_OBJS += $(obj)/kernel-shark/trace-view.o -TRACE_VIEW_OBJS += $(obj)/kernel-shark/trace-view-store.o - ifdef BUILD_PYTHON_WORKS PYTHON_SO_INSTALL := ctracecmd.install PYTHON_PY_PROGS := event-viewer.install -PYTHON_PY_LIBS := tracecmd.install tracecmdgui.install +PYTHON_PY_LIBS := tracecmd.install endif ctracecmd.so: ctracecmd.i $(LIBTRACECMD_STATIC) @@ -15,12 +11,6 @@ ctracecmd.so: ctracecmd.i $(LIBTRACECMD_STATIC) $(CC) -fpic -c $(CPPFLAGS) $(CFLAGS) $(PYTHON_INCLUDES) ctracecmd_wrap.c $(CC) --shared $(LIBTRACECMD_STATIC) $(LDFLAGS) ctracecmd_wrap.o -o ctracecmd.so $(TRACE_LIBS) -ctracecmdgui.so: ctracecmdgui.i $(LIBTRACECMD_STATIC) $(TRACE_VIEW_OBJS) - swig -Wall -python -noproxy -I$(src)/kernel-shark/include ctracecmdgui.i - $(CC) -fpic -c $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(PYTHON_INCLUDES) $(PYGTK_CFLAGS) ctracecmdgui_wrap.c - $(CC) --shared $(TRACE_VIEW_OBJS) $(LIBTRACECMD_STATIC) $(LDFLAGS) $(LIBS) $(CONFIG_LIBS) ctracecmdgui_wrap.o -o ctracecmdgui.so $(TRACE_LIBS) - - $(PYTHON_SO_INSTALL): %.install : %.so force $(Q)$(call do_install_data,$<,$(python_dir_SQ)) @@ -34,7 +24,7 @@ install_python: $(PYTHON_SO_INSTALL) $(PYTHON_PY_PROGS) $(PYTHON_PY_LIBS) clean: - $(RM) *.a *.so *.o .*.d ctracecmd_wrap.* ctracecmdgui_wrap.* + $(RM) *.a *.so *.o .*.d ctracecmd_wrap.* force: .PHONY: clean force diff --git a/python/ctracecmdgui.i b/python/ctracecmdgui.i deleted file mode 100644 index 4a7c6ac..0000000 --- a/python/ctracecmdgui.i +++ /dev/null @@ -1,88 +0,0 @@ -// ctracecmdgui.i -%module ctracecmdgui -%include typemaps.i - -%{ -#include "trace-view-store.h" -#include <pygobject.h> -#include <pyglib.h> -#include <Python.h> -#include <memoryobject.h> - -extern GtkTreeModel *trace_view_store_as_gtk_tree_model(struct trace_view_store *store); - -PyObject * -pytype_from_gtype(GType gtype) -{ - PyTypeObject *pt = NULL; - switch (gtype) { - case G_TYPE_INT: - case G_TYPE_UINT: - pt = &PyLong_Type; - break; - case G_TYPE_STRING: - pt = &PyUnicode_Type; - break; - default: - return Py_None; - } - return (PyObject *)pt; -} -%} - - -/* return python longs from unsigned long long functions */ -%typemap(out) unsigned long long { - $result = PyLong_FromUnsignedLongLong((unsigned long long) $1); -} - -/* help swig cope with g* types */ -#if PY_MAJOR_VERSION >= 3 -%typemap(in) gint { - $1 = PyLong_AsLong($input); -} -%typemap(out) gint { - $result = PyLong_FromLong($1); -} -#else -%typemap(in) gint { - $1 = PyInt_AsLong($input); -} -%typemap(out) gint { - $result = PyInt_FromLong($1); -} -#endif -%typemap(in) guint { - $1 = PyLong_AsUnsignedLong($input); -} -%typemap(out) guint { - $result = PyLong_FromUnsignedLong($1); -} -%typemap(in) guint64 { - $1 = PyLong_AsUnsignedLongLong($input); -} -%typemap(out) guint64 { - $result = PyLong_FromUnsignedLongLong($1); -} -%typemap(out) GType { - $result = pytype_from_gtype($1); -} -%typemap(out) GtkTreeModelFlags { - $result = PyLong_FromLong($1); -} - - -%inline %{ -GtkTreeModel *trace_view_store_as_gtk_tree_model(struct trace_view_store *store) -{ - return GTK_TREE_MODEL(store); -} -%} - - -/* SWIG can't grok these, define them to nothing */ -#define __trace -#define __attribute__(x) -#define __thread - -%include "trace-view-store.h" -- 2.24.1