* [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile.
@ 2013-01-14 16:45 Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 2/4] Extras: Fix the undefined reference to md build error Jérémie Galarneau
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Jérémie Galarneau @ 2013-01-14 16:45 UTC (permalink / raw)
Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am
index a3557b8..d592ded 100644
--- a/extras/bindings/swig/python/Makefile.am
+++ b/extras/bindings/swig/python/Makefile.am
@@ -24,4 +24,4 @@ lttng_wrap.c: lttng.i
sed -i "s/md = d/d/g" lttng_wrap.c
sed -i "s/(void)public_symbol;/(void)public_symbol;\n md = d;/g" lttng_wrap.c
-CLEANFILES = lttng.i lttng.py lttng_wrap.c
+CLEANFILES = lttng.i lttng.py lttng_wrap.c lttng.pyc
--
1.8.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [lttng-dev] [PATCH lttng-tools 2/4] Extras: Fix the undefined reference to md build error.
2013-01-14 16:45 [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile Jérémie Galarneau
@ 2013-01-14 16:45 ` Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 3/4] Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t Jérémie Galarneau
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jérémie Galarneau @ 2013-01-14 16:45 UTC (permalink / raw)
Removed scripted modifications to lttng_wrap.c during Python binding generation.
Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
| 4 ----
1 file changed, 4 deletions(-)
--git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am
index d592ded..c6a6901 100644
--- a/extras/bindings/swig/python/Makefile.am
+++ b/extras/bindings/swig/python/Makefile.am
@@ -17,11 +17,7 @@ _lttng_la_LDFLAGS = -module
_lttng_la_LIBADD = $(top_srcdir)/src/lib/lttng-ctl/liblttng-ctl.la \
$(top_srcdir)/src/common/sessiond-comm/libsessiond-comm.la
-# SWIG 'warning md variable unused' fixed after SWIG build:
lttng_wrap.c: lttng.i
$(SWIG) -python -I. -I$(top_srcdir)/src/common/sessiond-comm lttng.i
- sed -i "s/PyObject \*m, \*d, \*md;/PyObject \*m, \*d;\n#if defined(SWIGPYTHON_BUILTIN)\nPyObject *md;\n#endif/g" lttng_wrap.c
- sed -i "s/md = d/d/g" lttng_wrap.c
- sed -i "s/(void)public_symbol;/(void)public_symbol;\n md = d;/g" lttng_wrap.c
CLEANFILES = lttng.i lttng.py lttng_wrap.c lttng.pyc
--
1.8.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [lttng-dev] [PATCH lttng-tools 3/4] Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t.
2013-01-14 16:45 [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 2/4] Extras: Fix the undefined reference to md build error Jérémie Galarneau
@ 2013-01-14 16:45 ` Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 4/4] Extras: Fixed inconsistent use of space and tabs in lttng.i.in Jérémie Galarneau
2013-01-17 15:58 ` [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile David Goulet
3 siblings, 0 replies; 5+ messages in thread
From: Jérémie Galarneau @ 2013-01-14 16:45 UTC (permalink / raw)
Python 3 merges PyInt and PyLong types. This fixes the
undefined symbol error encountered when using the bindings
with Python 3.
Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
| 8 ++++++++
1 file changed, 8 insertions(+)
--git a/extras/bindings/swig/python/lttng.i.in b/extras/bindings/swig/python/lttng.i.in
index 0d6d1e9..244bc22 100644
--- a/extras/bindings/swig/python/lttng.i.in
+++ b/extras/bindings/swig/python/lttng.i.in
@@ -15,6 +15,14 @@ multiple concurrent processes and threads. Tracing across multiple systems is al
#include <lttng/lttng.h>
%}
+%{
+#if PY_MAJOR_VERSION >= 3
+// The PyInt and PyLong types were unified as of Python 3
+// This makes the typemap code useable with both Python 2 and 3.
+#define PyInt_AsSsize_t PyLong_AsSsize_t
+#endif
+%}
+
typedef unsigned int uint32_t;
typedef int int32_t;
typedef unsigned long long uint64_t;
--
1.8.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [lttng-dev] [PATCH lttng-tools 4/4] Extras: Fixed inconsistent use of space and tabs in lttng.i.in.
2013-01-14 16:45 [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 2/4] Extras: Fix the undefined reference to md build error Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 3/4] Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t Jérémie Galarneau
@ 2013-01-14 16:45 ` Jérémie Galarneau
2013-01-17 15:58 ` [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile David Goulet
3 siblings, 0 replies; 5+ messages in thread
From: Jérémie Galarneau @ 2013-01-14 16:45 UTC (permalink / raw)
Python 3 does not allow mixing spaces and tabs. This eliminates
the error encountered when importing the lttng module in a
Python 3 interpreter.
Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/extras/bindings/swig/python/lttng.i.in b/extras/bindings/swig/python/lttng.i.in
index 244bc22..c947ce3 100644
--- a/extras/bindings/swig/python/lttng.i.in
+++ b/extras/bindings/swig/python/lttng.i.in
@@ -715,7 +715,7 @@ def calibrate(handle, calibrate):
%pythoncode %{
class Handle:
- """
+ """
Manages a handle.
Takes two arguments: (str session_name, Domain domain)
"""
--
1.8.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile.
2013-01-14 16:45 [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile Jérémie Galarneau
` (2 preceding siblings ...)
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 4/4] Extras: Fixed inconsistent use of space and tabs in lttng.i.in Jérémie Galarneau
@ 2013-01-17 15:58 ` David Goulet
3 siblings, 0 replies; 5+ messages in thread
From: David Goulet @ 2013-01-17 15:58 UTC (permalink / raw)
All four patches have been merged!
Thanks!
David
J?r?mie Galarneau:
>
> Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
> ---
> extras/bindings/swig/python/Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am
> index a3557b8..d592ded 100644
> --- a/extras/bindings/swig/python/Makefile.am
> +++ b/extras/bindings/swig/python/Makefile.am
> @@ -24,4 +24,4 @@ lttng_wrap.c: lttng.i
> sed -i "s/md = d/d/g" lttng_wrap.c
> sed -i "s/(void)public_symbol;/(void)public_symbol;\n md = d;/g" lttng_wrap.c
>
> -CLEANFILES = lttng.i lttng.py lttng_wrap.c
> +CLEANFILES = lttng.i lttng.py lttng_wrap.c lttng.pyc
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-17 15:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 16:45 [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 2/4] Extras: Fix the undefined reference to md build error Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 3/4] Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 4/4] Extras: Fixed inconsistent use of space and tabs in lttng.i.in Jérémie Galarneau
2013-01-17 15:58 ` [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile David Goulet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox