lttng-tools:cygwin-2.0-experimental

Last commit made on 2013-01-07
Get this branch:
git clone -b cygwin-2.0-experimental https://git.launchpad.net/lttng-tools

Branch merges

Branch information

Name:
cygwin-2.0-experimental
Repository:
lp:lttng-tools

Recent commits

55924ad... by Christian Babeux <email address hidden>

Add a README.cygwin for Cygwin specific build/install instructions

Signed-off-by: Christian Babeux <email address hidden>
Signed-off-by: David Goulet <email address hidden>

f3ff15d... by Christian Babeux <email address hidden>

Cygwin: Force run_as_noclone on Cygwin

Since clone(2) is not available on Cygwin, force the use of run_as_noclone().

bcccc1b... by Christian Babeux <email address hidden>

Cygwin: Fix racy read to detect applications sockets close

The mechanism to detect the applications sockets close is racy and
could potentially discard data. A read(3) is performed on the application
socket and the returned len is compared to 0 to detect the case where an
application closed the socket. If a read(3) occur in the thread_manage_apps
*before* the consumption of the data in the consumer, one byte of data would
be discarded.

To fix this race, perform a recv(3) on the socket with the MSG_PEEK flag.
This has no impact on the data delivery to the consumer and can successfully
detect the applications sockets close.

268ec04... by Christian Babeux <email address hidden>

Cygwin: Fix fd hangup in thread_manage_apps of sessiond

The fd hangup is not properly detected in the thread that manage
applications in the sessiond.

A read is done on the fd and if we encounter EOF, we force the
removal of the fd from the set.

Signed-off-by: Christian Babeux <email address hidden>

3b1ddb0... by Christian Babeux <email address hidden>

Cygwin: Fixup of wait pipe hangup commit

The condition in lttng_ustconsumer_check_pipe was wrong.

Signed-off-by: Christian Babeux <email address hidden>

060a32b... by Christian Babeux <email address hidden>

Cygwin: Fix handling of wait pipe hangup by properly detecting EOF

On Linux, the POLLHUP poll(3) event is used to signal that the other end
of a pipe has been disconnected. Due to poor wording in the Single UNIX
Specification, differents UNIX implementation signal the EOF with
conflicting poll events [1].

This is the case on Cygwin. A pipe close sends the POLLIN poll(3) event.
The actual consumer implementation sees this has a wakeup for data
ready to be consumed. The current hangup handling leads to infinite looping
in the consumer because the hangup is never detected and the POLLIN event
is never cleared.

To fix this issue, the consumer must read on the pipe, check for EOF
(read(3) shall return 0 to indicate EOF) and proceed to force the POLLHUP
poll(3) event if this is indeed the case.

[1] - http://www.greenend.org.uk/rjk/tech/poll.html

Signed-off-by: Christian Babeux <email address hidden>

840a733... by Christian Babeux <email address hidden>

Cygwin: Introduce new LTTNG_UST_STREAM_PIPE command to open wakeup pipe

Normally, the userspace tracer open the wakeup pipe, and the resulting
fd is passed to the consumer via the session daemon. Since we can't pass
fds via UNIX socket, the pipe need to be opened separately in the tracer
and in the consumer. The only way to open the write side of a named pipe
*before* the read side without blocking is to open it in read/write mode.
This is supported on Linux, but POSIX leave this behavior undefined [1].

The Cygwin named pipe implementation doesn't seem to allow multiple
readers/writers on a named pipe. Opening a pipe in RW mode in the tracer
and then opening the read side in the consumer won't work because the
consumer will get a "Device or ressource busy" error. Thus arise the need
to open the named pipe read side *before* the write side.

In order to accomplish this task, a new command must be introduced to signal
to the tracer that a specific named pipe should be opened in write mode.

Proper care must be taken to issue this command *after* the named pipe paths
have been sent to the consumer or else the sessiond or tracer will block
indefinitely.

Signed-off-by: Christian Babeux <email address hidden>

6684bfa... by Christian Babeux <email address hidden>

Cygwin: Pass file paths instead of file descriptors over UNIX sockets

Cygwin doesn't support file descriptors passing over UNIX sockets [1].
LTTng-ust and LTTng-tools make extensive use of this feature to pass
the shm and the wakeup pipe file descriptor from the userspace tracer
to the session daemon. The sessiond then pass those file descriptors
to the consumer.

To workaround this limitation, we pass the file paths of the shm and the
named wakeup pipe. These paths are relayed by the sessiond to the
consumer. The consumer then needs to open these paths.

The files are created in /tmp/lttng-fds and have the following format:

SHM : ust-shm-<pid>-<uuid>
Wakeup pipe : ust-wait-<pid>-<uuid>

[1] - http://cygwin.com/ml/cygwin/2009-10/msg00403.html

Signed-off-by: Christian Babeux <email address hidden>

387bdf2... by Christian Babeux <email address hidden>

Force the ld "no-undefined" flag on Cygwin

In order to build shared libraries on Cygwin/MinGW/Windows, all
symbols must be defined at link time. Activating the "-no-undefined"
flag will fail the build if it's not the case.

Signed-off-by: Christian Babeux <email address hidden>

993016f... by Simon Marchi

Use the new functions for default subbuf sizes

commit 3e230f922d67f7a47b66631f7a8cf458002b3727 upstream.

Use the functions added by the previous commit. All the occurences of
the previous defines were replaced.

[ Edit by Christian Babeux: Changes to tests/tools/Makefile.am were
  not applied because this file is not present in the stable 2.0 branch.
  Also added the relevant *_LDADD = $(top_builddir)/src/common/libcommon.la
  to the differents Makefile.am where the new functions are used. ]

Signed-off-by: Simon Marchi <email address hidden>
Signed-off-by: David Goulet <email address hidden>
Signed-off-by: Christian Babeux <email address hidden>