Re: [lttng-dev] [PATCH babeltrace stable-1.5] Fix: ctf writer test on Cygwin

2017-04-11 Thread Michael Jeanson
On 2017-04-10 18:18, Michael Jeanson wrote:
> 
> You can hold on merging this patch for now, I think it's only useful for
> a very specific environment which might not be worth supporting.
> 

Scratch that, it's needed after all, sorry for the noise.

Michael

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] [PATCH babeltrace v5] Build Python bindings with distutils for consistent installs

2017-04-11 Thread Francis Deslauriers
v5: Manually load shared objects used by the Babeltrace Python module

This patch changes the build system used to compile and install the
Python Bindings. Distutils is used to find the right install directory.
When the install directory generated from the install prefix is not in
the Python search path (PYTHONPATH), we print a warning explaining what
can be done to include it.
It uses Distutils which is part of the Python standard library.

Signed-off-by: Francis Deslauriers 
---
 .gitignore| 10 +++-
 bindings/python/Makefile.am   | 57 +-
 bindings/python/babeltrace/Makefile.am| 30 ++
 bindings/python/babeltrace/__init__.py.in | 25 
 bindings/python/setup.py.in   | 84 +++
 configure.ac  | 14 +++--
 m4/python_modules.m4  | 23 
 tests/bin/intersection/bt_python_helper.py.in | 17 +++---
 8 files changed, 195 insertions(+), 65 deletions(-)
 create mode 100644 bindings/python/babeltrace/__init__.py.in
 create mode 100644 bindings/python/setup.py.in
 delete mode 100644 m4/python_modules.m4

diff --git a/.gitignore b/.gitignore
index a7c9e3c..9259b6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,8 +47,12 @@ converter/babeltrace-log
 core
 formats/ctf/metadata/ctf-parser.output
 stamp-h1
-bindings/python/babeltrace.i
-bindings/python/babeltrace.py
-bindings/python/babeltrace_wrap.c
+bindings/python/setup.py
+bindings/python/installed_files.txt
+bindings/python/build
+bindings/python/babeltrace/__init__.py
+bindings/python/babeltrace/babeltrace.i
+bindings/python/babeltrace/babeltrace.py
+bindings/python/babeltrace/babeltrace_wrap.c
 babeltrace.pc
 babeltrace-ctf.pc
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index d6b3648..9e44127 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -1,3 +1,58 @@
 if USE_PYTHON
-SUBDIRS = babeltrace
+SUBDIRS = babeltrace .
+
+INSTALLED_FILES=$(builddir)/installed_files.txt
+
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include -I$(srcdir)/babeltrace/
+
+# Since the shared object used by the python bindings is not built with libtool
+# we need to manually set the `rpath` during linkage
+AM_LDFLAGS=-L$(top_builddir)/formats/ctf/.libs -L$(top_builddir)/lib/.libs
+all-local: build-python-bindings.stamp
+
+$(builddir)/babeltrace/__init__.py: $(srcdir)/babeltrace/__init__.py.in
+   cd babeltrace && $(MAKE) __init__.py
+
+$(builddir)/babeltrace/babeltrace.i: $(srcdir)/babeltrace/babeltrace.i.in
+   cd babeltrace && $(MAKE) babeltrace.i
+
+BINDINGS_DEPS=setup.py \
+   babeltrace/__init__.py \
+   babeltrace/babeltrace.i \
+   babeltrace/python-complements.c \
+   babeltrace/python-complements.h
+
+BUILD_FLAGS=CC="$(CC)" \
+   CFLAGS="$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(GLIB_CFLAGS) 
$(AM_CFLAGS)" \
+   CPPFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS)" \
+   LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS)"
+
+build-python-bindings.stamp: $(BINDINGS_DEPS)
+   $(BUILD_FLAGS) $(PYTHON) $(builddir)/setup.py build_ext
+   $(BUILD_FLAGS) $(PYTHON) $(builddir)/setup.py build
+   touch $@
+
+install-exec-local: build-python-bindings.stamp
+   @opts="--prefix=$(prefix) --record $(INSTALLED_FILES) --verbose 
--no-compile $(DISTSETUPOPTS)"; \
+   if [ "$(DESTDIR)" != "" ]; then \
+   opts="$$opts --root=$(DESTDIR)"; \
+   fi; \
+   $(PYTHON) $(builddir)/setup.py install $$opts;
+
+clean-local:
+   rm -rf $(builddir)/build
+
+# Distutils' setup.py does not include an uninstall target, we thus need to do
+# it manually. We save the path of the files that were installed during the 
install target
+# and delete them during the uninstallation.
+uninstall-local:
+   if [ "$(DESTDIR)" != "" ]; then \
+   $(SED) -i "s|^|$(DESTDIR)/|g" $(INSTALLED_FILES); \
+   fi
+   cat $(INSTALLED_FILES) | xargs rm -rf || true
+   $(GREP) "__init__.py" $(INSTALLED_FILES) | xargs dirname | xargs rm -rf 
|| true
+   rm -f $(INSTALLED_FILES)
+
+CLEANFILES = babeltrace/babeltrace_wrap.c babeltrace/babeltrace.py 
build-python-bindings.stamp
+DISTCLEANFILES = setup.py
 endif
diff --git a/bindings/python/babeltrace/Makefile.am 
b/bindings/python/babeltrace/Makefile.am
index 11dcdf0..f612aa6 100644
--- a/bindings/python/babeltrace/Makefile.am
+++ b/bindings/python/babeltrace/Makefile.am
@@ -1,31 +1,9 @@
+if USE_PYTHON
 babeltrace.i: babeltrace.i.in
sed "s/BABELTRACE_VERSION_STR/Babeltrace $(PACKAGE_VERSION)/g" < \
$(top_srcdir)/bindings/python/babeltrace/babeltrace.i.in > \
$(top_builddir)/bindings/python/babeltrace/babeltrace.i
 
-AM_CFLAGS = $(PYTHON_INCLUDE) -I$(top_srcdir)/include/ \
-   -I$(top_srcdir)/bindings/python/babeltrace
-
-EXTRA_DIST 

Re: [lttng-dev] LTTng on Docker

2017-04-11 Thread Jeffrey Chen
I just tried it a few more times. It is the --subbuf-size that's causing the 
issue. The --tracefile-sze is fine. Thanks.



From: jeremie.galarn...@gmail.com  on behalf of 
Jérémie Galarneau 
Sent: Monday, April 10, 2017 12:26 PM
To: Jeffrey Chen
Cc: lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] LTTng on Docker



On 10 April 2017 at 14:06, Jeffrey Chen > 
wrote:

I have attached the logs from the lttng daemon. I could see errors like below.


Error: Error creating UST channel "channel0" on the consumer daemon


My commands to create a session are:

lttng create test
lttng enable-channel --session test --userspace --tracefile-size 8388608 
--subbuf-size 8388608 channel0
lttng enable-event --channel channel0 --userspace "service:*"
lttng add-context -u -t vtid
lttng add-context -u -t vpid
lttng start

Thanks for the info. Can you try to create the channel with the default values 
and see if it works?

$ lttng enable-channel --session test --userspace channel0

Also, can you re-capture the session daemon logs launching it with the "-vvv 
--verbose-consumer" option since the problem appears to occur on the consumer's 
end.

Thanks,
Jérémie


Installed:
apt-get -y install lttng-tools lttng-modules-dkms liblttng-ust0 liblttng-ust-dev


Thanks.


From: jeremie.galarn...@gmail.com 
> on behalf of 
Jérémie Galarneau 
>
Sent: Sunday, April 9, 2017 2:06 PM
To: Jeffrey Chen
Cc: lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] LTTng on Docker

On 7 April 2017 at 18:35, Jeffrey Chen > 
wrote:
> Hi:
>
>
> I am trying to have LTTng UST tracing inside a docker container. I wasn't
> able to get the UST tracing working. LTTng would not write any UST trace
> files in the directory, even though it printed it would. Has it been tested
> before? Is there any known problem?

Tracing inside a container (not Docker), where the LTTng daemons and
the applications are running in the same container, is known to work
as this is how most of the LTTng CI works.

As far as Docker is concerned, I tested it a number of times and it
worked. Can you provide the versions of LTTng and Docker you're using
and the session daemon's logs (launching it with the -vvv option)?

Thanks,
Jérémie

>
>
> $ lttng enable-channel --session test --userspace channel0
>
> Error: Channel channel0: UST create channel failed (session ServiceFabric_0)
> Error: Command error
>
>
> Thanks.
>
>
>
> ___
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
lttng-dev Info Page
lists.lttng.org
To see the collection of prior postings to the list, visit the lttng-dev 
Archives. Using lttng-dev: To post a message to all the list members, send ...


>



--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
EfficiOS
www.efficios.com
At EfficiOS, our main goal is diminishing the amount of time our clients spend 
identifying faults. We also enable our clients' applications to scale on 
massive multi ...





--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] LTTng on Docker

2017-04-11 Thread Jeffrey Chen
You are correct, using the default values works fine.

The problem is only when I specify trace-size and subbuf-size.


I attached the output when I have those parameters specified, and the daemon 
with "--verbose-consumer".


Thanks.



From: jeremie.galarn...@gmail.com  on behalf of 
Jérémie Galarneau 
Sent: Monday, April 10, 2017 12:26 PM
To: Jeffrey Chen
Cc: lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] LTTng on Docker



On 10 April 2017 at 14:06, Jeffrey Chen > 
wrote:

I have attached the logs from the lttng daemon. I could see errors like below.


Error: Error creating UST channel "channel0" on the consumer daemon


My commands to create a session are:

lttng create test
lttng enable-channel --session test --userspace --tracefile-size 8388608 
--subbuf-size 8388608 channel0
lttng enable-event --channel channel0 --userspace "service:*"
lttng add-context -u -t vtid
lttng add-context -u -t vpid
lttng start

Thanks for the info. Can you try to create the channel with the default values 
and see if it works?

$ lttng enable-channel --session test --userspace channel0

Also, can you re-capture the session daemon logs launching it with the "-vvv 
--verbose-consumer" option since the problem appears to occur on the consumer's 
end.

Thanks,
Jérémie


Installed:
apt-get -y install lttng-tools lttng-modules-dkms liblttng-ust0 liblttng-ust-dev


Thanks.


From: jeremie.galarn...@gmail.com 
> on behalf of 
Jérémie Galarneau 
>
Sent: Sunday, April 9, 2017 2:06 PM
To: Jeffrey Chen
Cc: lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] LTTng on Docker

On 7 April 2017 at 18:35, Jeffrey Chen > 
wrote:
> Hi:
>
>
> I am trying to have LTTng UST tracing inside a docker container. I wasn't
> able to get the UST tracing working. LTTng would not write any UST trace
> files in the directory, even though it printed it would. Has it been tested
> before? Is there any known problem?

Tracing inside a container (not Docker), where the LTTng daemons and
the applications are running in the same container, is known to work
as this is how most of the LTTng CI works.

As far as Docker is concerned, I tested it a number of times and it
worked. Can you provide the versions of LTTng and Docker you're using
and the session daemon's logs (launching it with the -vvv option)?

Thanks,
Jérémie

>
>
> $ lttng enable-channel --session test --userspace channel0
>
> Error: Channel channel0: UST create channel failed (session ServiceFabric_0)
> Error: Command error
>
>
> Thanks.
>
>
>
> ___
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
lttng-dev Info Page
lists.lttng.org
To see the collection of prior postings to the list, visit the lttng-dev 
Archives. Using lttng-dev: To post a message to all the list members, send ...


>



--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
EfficiOS
www.efficios.com
At EfficiOS, our main goal is diminishing the amount of time our clients spend 
identifying faults. We also enable our clients' applications to scale on 
massive multi ...





--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com


output2
Description: output2
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] LTTng on Docker

2017-04-11 Thread Jeffrey Chen
I have attached the logs from the lttng daemon. I could see errors like below.


Error: Error creating UST channel "channel0" on the consumer daemon


My commands to create a session are:

lttng create test
lttng enable-channel --session test --userspace --tracefile-size 8388608 
--subbuf-size 8388608 channel0
lttng enable-event --channel channel0 --userspace "service:*"
lttng add-context -u -t vtid
lttng add-context -u -t vpid
lttng start

Installed:
apt-get -y install lttng-tools lttng-modules-dkms liblttng-ust0 liblttng-ust-dev


Thanks.


From: jeremie.galarn...@gmail.com  on behalf of 
Jérémie Galarneau 
Sent: Sunday, April 9, 2017 2:06 PM
To: Jeffrey Chen
Cc: lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] LTTng on Docker

On 7 April 2017 at 18:35, Jeffrey Chen  wrote:
> Hi:
>
>
> I am trying to have LTTng UST tracing inside a docker container. I wasn't
> able to get the UST tracing working. LTTng would not write any UST trace
> files in the directory, even though it printed it would. Has it been tested
> before? Is there any known problem?

Tracing inside a container (not Docker), where the LTTng daemons and
the applications are running in the same container, is known to work
as this is how most of the LTTng CI works.

As far as Docker is concerned, I tested it a number of times and it
worked. Can you provide the versions of LTTng and Docker you're using
and the session daemon's logs (launching it with the -vvv option)?

Thanks,
Jérémie

>
>
> $ lttng enable-channel --session test --userspace channel0
>
> Error: Channel channel0: UST create channel failed (session ServiceFabric_0)
> Error: Command error
>
>
> Thanks.
>
>
>
> ___
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
lttng-dev Info Page
lists.lttng.org
To see the collection of prior postings to the list, visit the lttng-dev 
Archives. Using lttng-dev: To post a message to all the list members, send ...


>



--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
EfficiOS
www.efficios.com
At EfficiOS, our main goal is diminishing the amount of time our clients spend 
identifying faults. We also enable our clients' applications to scale on 
massive multi ...




output
Description: output
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev