lttng-tools.git
11 years agoAdd unit tests for URIs
David Goulet [Wed, 25 Jul 2012 14:21:09 +0000 (10:21 -0400)] 
Add unit tests for URIs

Tests uri_parse() using multiple URI strings where some are bad and some
are well formed.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd UST and kernel streaming tests
David Goulet [Tue, 24 Jul 2012 22:31:58 +0000 (18:31 -0400)] 
Add UST and kernel streaming tests

Add four tests for network streaming. For user space, we have two tests
where tracing is started before and after the applications.

For kernel tests, we enable an event before and after the start command.

At this stage, some tests fails which indicates a bug.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: some error in uri.c were still using printf()
David Goulet [Wed, 25 Jul 2012 14:18:41 +0000 (10:18 -0400)] 
Fix: some error in uri.c were still using printf()

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: don't install the filter grammar test
David Goulet [Tue, 24 Jul 2012 19:55:32 +0000 (15:55 -0400)] 
Fix: don't install the filter grammar test

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd health counter to ust-app.c
David Goulet [Tue, 24 Jul 2012 17:34:37 +0000 (13:34 -0400)] 
Add health counter to ust-app.c

Any UST command can take an unknown amount of time to complete
especially with multiple applications and/or sessions even though it's
the correct behavior, the health check must not flag a bad health so
this patch adds a series of health code update to each ustctl actions in
ust-app.c.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: typo in time_diff() with nsec difference
David Goulet [Tue, 24 Jul 2012 17:37:10 +0000 (13:37 -0400)] 
Fix: typo in time_diff() with nsec difference

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd time validation to health check
Mathieu Desnoyers [Tue, 24 Jul 2012 15:52:36 +0000 (11:52 -0400)] 
Add time validation to health check

The health check code does not have a notion of "time flow": therefore,
two consecutive calls to lttng_health_check() might end up returning a
bad state (0) just because there was too little time between the
invocations.

Add some time information to the "last" snapshot, so we can do a time
delta between the current and last snapshot to figure out if we need to
report the thread as stalled or not.

At this point, a thread is considered stalled with a wait time of over
20 seconds.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: Multiple health monitoring fixes
Mathieu Desnoyers [Mon, 23 Jul 2012 18:00:42 +0000 (14:00 -0400)] 
Fix: Multiple health monitoring fixes

* Fix modulo operation bug on
  #define HEALTH_IS_IN_CODE(x) (x % HEALTH_POLL_VALUE) which is causing
  the check to think it is never within code.  (x % 1 always equals 0).
  Simplify this by using a simple & on the poll value, and remove the
  IS_IN_CODE, using ! on IS_IN_POLL instead (which removes nothing to
  clarity).

* Atomic operations should apply to at most "unsigned long" (32-bit on
  32-bit arch) rather than uint64_t.

* Separate the "error" condition from the counters. We clearly cannot
  use the "0" value as an error on 32-bit counters anymore, because they
  can easily wrap.

* Introduce "exit" condition, will be useful for state tracking in the
  future. Error and exit conditions implemented as flags.

* Add "APP_MANAGE" in addition to "APP_REG" health check, to monitor the
  app registration thread (which was missing, only the app manager
  thread was checked, under the name "APP_REG", which was misleading).

* Remove bogus usage of uatomic_xchg() in health_check_state():
  It is not needed to update the "last" value, since the last value is
  read and written to by a single thread. Moreover, this specific use of
  xchg was not exchanging anything: it was just setting the last value
  to the "current" one, and doing nothing with the return value.
  Whatever was expected to be achieved by using uatomic_xchg() clearly
  wasn't.

* Because the health check thread could still be answering a request
  concurrently sessiond teardown, we need to ensure that all threads
  only set the "error" condition if they reach teardown paths due to an
  actual error, not on "normal" teardown condition (thread quit pipe
  being closed). Flagging threads as being in error condition upon all
  exit paths would lead to false "errors" sent to the client, which we
  want to avoid, since the client could then think it needs to kill a
  sessiond when the sessiond might be in the process of gracefully
  restarting.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: relayd typo: lock -> unlock
Mathieu Desnoyers [Tue, 24 Jul 2012 15:39:19 +0000 (11:39 -0400)] 
Fix: relayd typo: lock -> unlock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agofix: lttng-relayd: use appropriate RCU locking with hash tables
Mathieu Desnoyers [Tue, 24 Jul 2012 13:08:15 +0000 (09:08 -0400)] 
fix: lttng-relayd: use appropriate RCU locking with hash tables

RCU hash tables used in lttng-relayd use the auto-resize feature, which
is performed by concurrent call rcu worker threads. Therefore, we need
to protect the calls to the hash table with appropriate RCU read-side
locking, and use call_rcu to defer memory reclaim.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agolttng-relayd: memory management fixes, with cleanups
Mathieu Desnoyers [Tue, 24 Jul 2012 03:11:48 +0000 (23:11 -0400)] 
lttng-relayd: memory management fixes, with cleanups

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: relayd and sessiond: dispatch thread exit is shared across threads
Mathieu Desnoyers [Mon, 23 Jul 2012 15:31:34 +0000 (11:31 -0400)] 
Fix: relayd and sessiond: dispatch thread exit is shared across threads

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agofix: write EINTR handling
Mathieu Desnoyers [Mon, 23 Jul 2012 15:13:40 +0000 (11:13 -0400)] 
fix: write EINTR handling

Ensure that we always test for ret < 0 && errno == EINTR for each
write() call.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agorelayd: cleanup
Mathieu Desnoyers [Mon, 23 Jul 2012 15:03:12 +0000 (11:03 -0400)] 
relayd: cleanup

Make structure/array definition easier to extend by already placing
comma at the end of lists (this is much more regexp-friendly).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCode cleanup in the ust/kernel consumer file
David Goulet [Mon, 23 Jul 2012 15:03:08 +0000 (11:03 -0400)] 
Code cleanup in the ust/kernel consumer file

Generalize the send relayd socket function call for both UST and kernel.

Refactor code in ust-consumer.c which only moves code around and bring
no changes to the behavior.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agolttng-relayd.h: review update
Mathieu Desnoyers [Mon, 23 Jul 2012 14:48:45 +0000 (10:48 -0400)] 
lttng-relayd.h: review update

- Change field order to minimize padding.
- ifdef should follow lttng coding style. No _ prefix, because it is
  reserved to compiler.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate README, TODO and CodingStyle
David Goulet [Mon, 23 Jul 2012 14:07:46 +0000 (10:07 -0400)] 
Update README, TODO and CodingStyle

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix and update content of doc/ directory
David Goulet [Mon, 23 Jul 2012 13:42:13 +0000 (09:42 -0400)] 
Fix and update content of doc/ directory

Add lttng-relayd.8 to the Makefile.am

Create the proposals/ directory which contains pas and current proposals
(RFC) for any features/changes in lttng-tools code tree.

Add the streaming-howto.txt to the dist data.

Rename and update old RFCs and move them to proposals/ directory.
Incidently, remove the dev/ directory.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd enable/disable consumer command to bash completion
David Goulet [Mon, 23 Jul 2012 12:45:34 +0000 (08:45 -0400)] 
Add enable/disable consumer command to bash completion

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: relayd pipes should be closed on exit/error
Christian Babeux [Fri, 20 Jul 2012 19:26:47 +0000 (15:26 -0400)] 
Fix: relayd pipes should be closed on exit/error

Use the utils functions found in common/utils.h on pipes operations
(open/close).

Acked-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd missing options in help
Julien Desfossez [Fri, 20 Jul 2012 16:19:18 +0000 (12:19 -0400)] 
Add missing options in help

Patch from Christian to support the --help option and update to the
usage message to show we support -o,--output option.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoCreate utils.c/.h in libcommon
David Goulet [Fri, 20 Jul 2012 15:37:24 +0000 (11:37 -0400)] 
Create utils.c/.h in libcommon

Move function from lttng/utils.h and lttng-session/utils.h in libcommon
so they can be used at large.

Simply link with libcommon and include common/utils.h.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoman page for lttng-relayd
Julien Desfossez [Fri, 20 Jul 2012 13:43:42 +0000 (09:43 -0400)] 
man page for lttng-relayd

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
11 years agosmall fixes on streaming-howto
Julien Desfossez [Fri, 20 Jul 2012 12:16:07 +0000 (08:16 -0400)] 
small fixes on streaming-howto

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
11 years agoSession daemon health check support
David Goulet [Wed, 18 Jul 2012 16:00:03 +0000 (12:00 -0400)] 
Session daemon health check support

This is the first commit for the health check feature of the session
daemon.

Add a lttng_health_check(...) call to the public API and return 0 if
everything is fine or 1 if some health problem for a component was
detected.

Using this API call, you can either choose to test a specific component
such as the client command thread, the consumer thread(s), kernel
thread, application registration thread or all of them at the same time.

This feature is NOT implemented with the lttng command line UI and it is
intended to be like so until a stable version is accepted by the
community.

NOTE: The API could change so be aware of possible changes up to the
2.1-stable release.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoCleanup: rename session list count to "next_uuid"
Mathieu Desnoyers [Tue, 17 Jul 2012 23:34:37 +0000 (19:34 -0400)] 
Cleanup: rename session list count to "next_uuid"

Clearly explain that this is not a counter, but rather a unique
identifier.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix typo: utils.sh
Mathieu Desnoyers [Tue, 17 Jul 2012 23:29:29 +0000 (19:29 -0400)] 
Fix typo: utils.sh

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: test: session list count cannot use "count" unique id
Mathieu Desnoyers [Tue, 17 Jul 2012 23:27:34 +0000 (19:27 -0400)] 
Fix: test: session list count cannot use "count" unique id

Fixes #305

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: specialize double-s64 binary comparators
Mathieu Desnoyers [Tue, 17 Jul 2012 19:08:04 +0000 (15:08 -0400)] 
Filter: specialize double-s64 binary comparators

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd streaming howto
David Goulet [Tue, 17 Jul 2012 18:03:28 +0000 (14:03 -0400)] 
Add streaming howto

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFilter: add merge point test
Mathieu Desnoyers [Tue, 17 Jul 2012 17:49:08 +0000 (13:49 -0400)] 
Filter: add merge point test

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate README and add files to gitignore
David Goulet [Tue, 17 Jul 2012 17:20:35 +0000 (13:20 -0400)] 
Update README and add files to gitignore

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoDocument filter (help and manpage)
Mathieu Desnoyers [Tue, 17 Jul 2012 15:26:54 +0000 (11:26 -0400)] 
Document filter (help and manpage)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: filter: remove dependency on UST bug.h
Mathieu Desnoyers [Tue, 17 Jul 2012 05:49:45 +0000 (01:49 -0400)] 
Fix: filter: remove dependency on UST bug.h

Fixes #308

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter bytecode: Implement stack-based interpreter
Mathieu Desnoyers [Mon, 16 Jul 2012 21:56:59 +0000 (17:56 -0400)] 
Filter bytecode: Implement stack-based interpreter

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: cast double directly to s64
Mathieu Desnoyers [Sat, 14 Jul 2012 03:33:09 +0000 (23:33 -0400)] 
Filter: cast double directly to s64

When we know that the child is a double we can cast it directly without
letting the specializer do it.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: ensure logical operator merge is always s64
Mathieu Desnoyers [Sat, 14 Jul 2012 03:24:42 +0000 (23:24 -0400)] 
Filter: ensure logical operator merge is always s64

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: specialize 'and' and 'or' ops
Mathieu Desnoyers [Fri, 13 Jul 2012 23:00:36 +0000 (19:00 -0400)] 
Filter: specialize 'and' and 'or' ops

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: specialize comparators
Mathieu Desnoyers [Fri, 13 Jul 2012 21:15:55 +0000 (17:15 -0400)] 
Filter: specialize comparators

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: Specialize unary ops
Mathieu Desnoyers [Fri, 13 Jul 2012 20:45:46 +0000 (16:45 -0400)] 
Filter: Specialize unary ops

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: opcode for ref load
Mathieu Desnoyers [Fri, 13 Jul 2012 20:05:56 +0000 (16:05 -0400)] 
Filter: opcode for ref load

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoShow that filter is enabled when listing session events
Mathieu Desnoyers [Fri, 13 Jul 2012 18:36:39 +0000 (14:36 -0400)] 
Show that filter is enabled when listing session events

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoDocument filter usage
Mathieu Desnoyers [Fri, 13 Jul 2012 18:27:03 +0000 (14:27 -0400)] 
Document filter usage

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFilter: add floating point support
Mathieu Desnoyers [Fri, 13 Jul 2012 17:05:59 +0000 (13:05 -0400)] 
Filter: add floating point support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement filter bytecode support in lttng-session, and parse filter string
Mathieu Desnoyers [Thu, 12 Jul 2012 17:01:14 +0000 (13:01 -0400)] 
Implement filter bytecode support in lttng-session, and parse filter string

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement filter expression to bytecode compiler in liblttng-ctl
Mathieu Desnoyers [Tue, 10 Jul 2012 19:15:04 +0000 (15:15 -0400)] 
Implement filter expression to bytecode compiler in liblttng-ctl

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: The session list count should provide unique identifiers
Mathieu Desnoyers [Wed, 11 Jul 2012 22:23:12 +0000 (18:23 -0400)] 
Fix: The session list count should provide unique identifiers

Never decrement it.

Reported-by: Amer Alhalabi <amer.alhalabi@ericsson.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoNetwork streaming support
David Goulet [Wed, 11 Jul 2012 17:20:39 +0000 (13:20 -0400)] 
Network streaming support

This is a huge commit integrating a lot of new feature for network
streaming support with the lttng-relayd previously merged.

Please note that this commit is the initial import of the network
streaming feature meaning that this is NOT stable and SHOULD be
considered experimental hence not suited for production deployment.

API Changes:

lttng_create_session_uri(), lttng_enable_consumer(),
lttng_set_consumer_uri() and lttng_disable_consumer() calls are added.
The lttng command line now supports these new calls by introducing two
new commands and one modified. (Please look at the --help option for
more details).

$ lttng enable-consumer
$ lttng disable-consumer

The "lttng create" command can now take new arguments to specify the
destination URI for network streaming. There is also a new flag which
allows the user to disable the consumer for the session.

At this point, the now old deprecated lttng_create_session() call is
still supported but SHOULD be replaced by lttng_create_session_uri().
More calls will be added to the API in order to facilitate the creation
of lttng URI.

Network streaming:

Both kernel and user space tracing are supported for network streaming.
For now, only IPv4 and IPv6 protocol over TCP is supported. Two network
socket are used where one is for control commands and the second one is
for data transmission. The port are respectively 5342 and 5343.

BUGS: Streaming high throughput traces (e.g lttng enable-event -a -k)
with low bandwitdh available to the relayd, the tracer does not behave
well when the metadata are not emptied enough quickly so data are
missing on the remote target and the tracing is simply not stoppable.
This is a known bug and future iterations will try to fix it.

WARNING: At this stage, there is _NO_ security features meaning no
remote authentication on the relayd, no transport layer encryption or
network secure handshake of some sort. So, uses only for in-vitro
experiment or on _trusted_ networks.

Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoInitial import of the new binary lttng-relayd
Julien Desfossez [Tue, 10 Jul 2012 21:40:27 +0000 (17:40 -0400)] 
Initial import of the new binary lttng-relayd

The lttng-relayd listens on the network and receives traces streamed by
the consumer.

At this first commit, the relayd supports IPv4 and IPv6 over TCP.

The following commits will add the support to use it with the lttng
command line interface, control library, consumer and session daemon.

Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd and change lttcomm socket API
David Goulet [Tue, 10 Jul 2012 21:30:37 +0000 (17:30 -0400)] 
Add and change lttcomm socket API

Add lttcomm_alloc_sock_from_uri(), lttcomm_destroy_sock(),
lttcomm_alloc_copy_sock() and lttcomm_copy_sock(). Also add the relayd
command and lttcomm error message.

Change the create and alloc sock call API arguments.

Fix the fd leak in accept() function.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: mmap write() for large subbuffers and handle EINTR (v2)
Mathieu Desnoyers [Fri, 6 Jul 2012 14:13:05 +0000 (10:13 -0400)] 
Fix: mmap write() for large subbuffers and handle EINTR (v2)

With large subbuffer (packet) size, if write() returns before copying the
entire packet for mmap buffers, the consumerd restarts the write
infinitely, which is not good at all.

This affects both lttng-ust (in default mmap mode) and lttng-kernel (but
only for mmap buffers, which is not the default).

This issue would show up with large subbuffer size.

We need to handle this case, as well as EINTR errors (which need to restart
write).

Also fixing the return value of mmap read functions, which were returning
the amount of data written by the last invocation of write() rather than
the total number of bytes written. splice use had the same issue.

Also now consider a write() that returns more bytes than requested as an
error.

Moreover, assigning error = ret after failed splice and write was a
mistake: error is holding the actual error value. ret just holds -1.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix inet return value in the close() fct
David Goulet [Tue, 3 Jul 2012 20:28:05 +0000 (16:28 -0400)] 
Fix inet return value in the close() fct

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: add missing consumer.h to sessiond Makefile.am
Mathieu Desnoyers [Fri, 29 Jun 2012 10:49:21 +0000 (12:49 +0200)] 
Fix: add missing consumer.h to sessiond Makefile.am

Fix make dist.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: test make dist Makefile.am missing files
Mathieu Desnoyers [Fri, 29 Jun 2012 10:43:14 +0000 (12:43 +0200)] 
Fix: test make dist Makefile.am missing files

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: support large files on 32-bit systems
Mathieu Desnoyers [Fri, 29 Jun 2012 10:40:30 +0000 (12:40 +0200)] 
Fix: support large files on 32-bit systems

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: enable event loglevel match function
David Goulet [Fri, 22 Jun 2012 15:02:51 +0000 (11:02 -0400)] 
Fix: enable event loglevel match function

For the loglevel type ALL, the value set in an event inside the session
daemon is -1 where the value received from the client is 0. For this
loglevel type, the loglevel does not matter.

This fixes the commit c0657016bbb98e1769edbaba8c00221f964c7402 done
before version 2.0.2.

(Closes #283 #287)

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoRemove useless arg from kernel consumer send stream
David Goulet [Tue, 19 Jun 2012 19:13:16 +0000 (15:13 -0400)] 
Remove useless arg from kernel consumer send stream

The consumer_data structure was not used when sending kernel channel
streams to the consumer. Now the function uses the consumer_data
structure to get the consumer socket and the sock argument was removed.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: unchecked pointer from getenv() for lttng create
David Goulet [Tue, 19 Jun 2012 15:15:38 +0000 (11:15 -0400)] 
Fix: unchecked pointer from getenv() for lttng create

The lttng create command was not handling the return pointer from
getenv("HOME") and was passing it to a strdup() call.

(close #271)

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: problem in port assignment in uri_parse()
David Goulet [Tue, 19 Jun 2012 14:49:01 +0000 (10:49 -0400)] 
Fix: problem in port assignment in uri_parse()

The functions now puts 0 in the port field of the lttng_uri structure if
NO port are specified. It's now the caller's job to assign a default
port for that case.

Since the uri_parse() function does not know the URI context, a default
port can not be assigned correctly.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd pipe creation to utils facility
David Goulet [Fri, 15 Jun 2012 15:00:11 +0000 (11:00 -0400)] 
Add pipe creation to utils facility

Three new functions are added to create a pipe, create a pipe with
CLOEXEC flag and close a pipe.

Those functions are now used in the session daemon for all pipes and
cleanup.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd network transport layer to sessiond-comm
David Goulet [Thu, 14 Jun 2012 18:48:49 +0000 (14:48 -0400)] 
Add network transport layer to sessiond-comm

Only import the library files in sessiond-comm/ directory for network
communication supporting both TCP and UDP protocols with IPv4 and IPv6.

First layer needed for network streaming and communication with the
upcoming lttng-relayd daemon.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: enable event with different loglevel error
Mathieu Desnoyers [Thu, 14 Jun 2012 14:43:04 +0000 (10:43 -0400)] 
Fix: enable event with different loglevel error

This following example was NOT returning a correct error message.
"event1" is set with a loglevel "TRACE_CRIT". The normal behavior here
is that once enabled, you can not change the loglevel of the enable
event on the tracer side with a second command. It now returns a new
error message like so:

$ lttng enable-event event1 --loglevel-only TRACE-CRIT -u
$ lttng enable-event event1 --loglevel-only TRACE-WARNING -u
[...] Event already enabled with different loglevel

This commit makes the session daemon verify if _both_ the name and
loglevel are the same when enabling an event or else an error is
returned.

Also, the session daemon will continue enabling events and not return an
error is the loglevel does not match event for ust app on the tracer
which returns an EPERM at that stage. This is to address the case where
two applications have the same event name but with different loglevel.

Reported-by: Tan Dung Le Tran <tan.dung.le.tran@ericsson.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd lttng URI support and default network ports
David Goulet [Wed, 13 Jun 2012 21:08:05 +0000 (17:08 -0400)] 
Add lttng URI support and default network ports

This commit simply adds the lttng_uri API/ABI to the upstream branch.
Three functions are provided by common/uri.h and are usable by linking
with libcommon.

The default network ports are also added for network streaming for both
control and data stream.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: Change the type of enabled in lttng_event to a signed int
Danny Serres [Fri, 8 Jun 2012 14:19:08 +0000 (10:19 -0400)] 
Fix: Change the type of enabled in lttng_event to a signed int

Signed-off-by: Danny Serres <danny.serres@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoCreate kernel-consumer.c/.h and consumer.h
David Goulet [Thu, 7 Jun 2012 17:16:09 +0000 (13:16 -0400)] 
Create kernel-consumer.c/.h and consumer.h

Contains function call to send data to the kernel consumer (for now
session and channel streams).

Nothing new, code has just been moved to simplify main.c and partition
portion of code for clearer and easier understanding.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: move memset in channel_set_attr after NULL check
Danny Serres [Wed, 6 Jun 2012 18:54:30 +0000 (14:54 -0400)] 
Fix: move memset in channel_set_attr after NULL check

Signed-off-by: Danny Serres <danny.serres@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoCreate unix.c/.h for UNIX socket communication
David Goulet [Thu, 7 Jun 2012 16:57:51 +0000 (12:57 -0400)] 
Create unix.c/.h for UNIX socket communication

Simply split some content of sessiond-comm.c/.h to those two files for a
clearer code.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoFix: close all file descriptors when executed as daemon
Mathieu Desnoyers [Mon, 4 Jun 2012 22:08:24 +0000 (18:08 -0400)] 
Fix: close all file descriptors when executed as daemon

Both sessiond and consumerd support the option "-d" to run as daemon. In
some specific cases, e.g. when launched from dpkg installation scripts,
file descriptors 3, 4, 5 are left open and don't seem to have O_CLOEXEC
flag set, so the install script hangs because the sessiond still holds a
reference to them. daemon(3) only closes standard FD 0, 1, 2.

Fix this issue by closing all file descriptors after calling daemon(3).
Note: we make sure no file descriptor is opened before calling daemon(3)
by moving the init_thread_quit_pipe() call after the FD close.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate lttng-ust header copy for disabled UST compilation
Mathieu Desnoyers [Fri, 1 Jun 2012 21:05:01 +0000 (17:05 -0400)] 
Update lttng-ust header copy for disabled UST compilation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: ust_app_list_events should return -ENOSYS when no UST
Mathieu Desnoyers [Fri, 1 Jun 2012 21:01:13 +0000 (17:01 -0400)] 
Fix: ust_app_list_events should return -ENOSYS when no UST

Caller thinks that memory is allocated, and incorrectly dereferences a
NULL pointer if we return 0 rather than -ENOSYS.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agocleanup output indentation for field listing
Mathieu Desnoyers [Thu, 31 May 2012 20:14:45 +0000 (16:14 -0400)] 
cleanup output indentation for field listing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement event fields listing
Mathieu Desnoyers [Wed, 30 May 2012 20:27:39 +0000 (16:27 -0400)] 
Implement event fields listing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate lttng-ust-abi.h for event field listing
Mathieu Desnoyers [Fri, 25 May 2012 18:20:35 +0000 (14:20 -0400)] 
Update lttng-ust-abi.h for event field listing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix comments formating in conf.c
Francis Giraldeau [Wed, 30 May 2012 23:50:07 +0000 (01:50 +0200)] 
Fix comments formating in conf.c

Comments should be indented with one space only.

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoUpdate documentation for destroy all option
Francis Giraldeau [Wed, 30 May 2012 23:50:06 +0000 (01:50 +0200)] 
Update documentation for destroy all option

Document the new option -a, --all of lttng destroy

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
11 years agoAdd destroy all session option
Francis Giraldeau [Wed, 30 May 2012 23:50:05 +0000 (01:50 +0200)] 
Add destroy all session option

Destroy was limited to one session at a time. The option -a, --all destroys all
registered sessions at once.

* fixed braces

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
11 years agoImprove delete of configuration
Francis Giraldeau [Wed, 30 May 2012 23:50:04 +0000 (01:50 +0200)] 
Improve delete of configuration

Adding functions to encapsulate the configuration delete. Test if path to
configuration exists before attempting to remove it.

* fixed braces and goto name

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
11 years agoFix: clang llvm warnings
David Goulet [Thu, 31 May 2012 16:21:27 +0000 (12:21 -0400)] 
Fix: clang llvm warnings

Mostly fix unsigned expression and implicit conversion.

URCU still shows warnings but irrelevant.

Signed-off-by: David Goulet <dgoulet@efficios.com>
11 years agoAdd CodingStyle to tarball
Mathieu Desnoyers [Wed, 30 May 2012 13:53:42 +0000 (09:53 -0400)] 
Add CodingStyle to tarball

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd coding style document
Mathieu Desnoyers [Wed, 30 May 2012 13:10:57 +0000 (09:10 -0400)] 
Add coding style document

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agocompat mman.h: add cygwin support
Mathieu Desnoyers [Thu, 24 May 2012 17:46:40 +0000 (13:46 -0400)] 
compat mman.h: add cygwin support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agocompat socket.h: add cygwin support
Mathieu Desnoyers [Thu, 24 May 2012 17:46:21 +0000 (13:46 -0400)] 
compat socket.h: add cygwin support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agokernel-ctl: cygwin compatibility compile fix
Mathieu Desnoyers [Thu, 24 May 2012 16:07:21 +0000 (12:07 -0400)] 
kernel-ctl: cygwin compatibility compile fix

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agopoll compat wrapper: add cygwin support
Mathieu Desnoyers [Thu, 24 May 2012 16:01:47 +0000 (12:01 -0400)] 
poll compat wrapper: add cygwin support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate fcntl cygwin support
Mathieu Desnoyers [Thu, 24 May 2012 15:59:38 +0000 (11:59 -0400)] 
Update fcntl cygwin support

cygwin has posix_fadvise

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agocygwin support: only freebsd needs to typedef loff_t
Mathieu Desnoyers [Thu, 24 May 2012 15:49:55 +0000 (11:49 -0400)] 
cygwin support: only freebsd needs to typedef loff_t

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agofix: add missing parenthesis
Mathieu Desnoyers [Thu, 24 May 2012 15:01:03 +0000 (11:01 -0400)] 
fix: add missing parenthesis

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agocompat fcntl.h: add cygwin support
Mathieu Desnoyers [Thu, 24 May 2012 15:00:11 +0000 (11:00 -0400)] 
compat fcntl.h: add cygwin support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoMove futex.c/.h to libcommon
David Goulet [Tue, 8 May 2012 19:47:53 +0000 (15:47 -0400)] 
Move futex.c/.h to libcommon

This is done so the future lttng-relayd and other possible binaries
could use it.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate version to 2.0.1 stable
David Goulet [Thu, 19 Apr 2012 15:12:09 +0000 (11:12 -0400)] 
Update version to 2.0.1 stable

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix: test script for kernel module validation
David Goulet [Thu, 19 Apr 2012 15:03:38 +0000 (11:03 -0400)] 
Fix: test script for kernel module validation

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix: report error to client on consumerd error
David Goulet [Thu, 19 Apr 2012 14:58:42 +0000 (10:58 -0400)] 
Fix: report error to client on consumerd error

Adds a consumer daemon state flag that allows us to know the state of
the consumer during client command processing.

Please refer to the comment in lttng-sessiond/main.c above the
definition of those flags for more information and a possible race
condition issue.

This is a quick fix for bug #137 that will be merged in 2.0-stable
branch.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix: replace 'modprobe -l' by lsmod in kernel test
David Goulet [Mon, 16 Apr 2012 15:37:49 +0000 (11:37 -0400)] 
Fix: replace 'modprobe -l' by lsmod in kernel test

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix: add missing ht_destroy at consumer teardown
Mathieu Desnoyers [Thu, 12 Apr 2012 15:45:36 +0000 (11:45 -0400)] 
Fix: add missing ht_destroy at consumer teardown

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRemove useless test and fix message output
David Goulet [Mon, 16 Apr 2012 15:19:15 +0000 (11:19 -0400)] 
Remove useless test and fix message output

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoWait for all apps in high-throughput test
David Goulet [Thu, 12 Apr 2012 18:54:28 +0000 (14:54 -0400)] 
Wait for all apps in high-throughput test

Don't wait an arbitrary amount of time for application to end.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd multi-session test for UST
David Goulet [Thu, 12 Apr 2012 18:22:55 +0000 (14:22 -0400)] 
Add multi-session test for UST

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix: consumer fd recv thread should write into non-blocking pipe
Mathieu Desnoyers [Thu, 12 Apr 2012 01:57:31 +0000 (21:57 -0400)] 
Fix: consumer fd recv thread should write into non-blocking pipe

Writing into a blocking pipe will cause the writer thread to block on
the poll fds thread when the pipe is full. Given that we would like to
batch stream array reallocation as much as possible, this wakeup should
not block.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: work-around glibc __nptl_setxid vs clone hang
Mathieu Desnoyers [Thu, 12 Apr 2012 01:07:13 +0000 (21:07 -0400)] 
Fix: work-around glibc __nptl_setxid vs clone hang

hash table resize threads exit end up setting a "locked" state within
libc pthread, which deadlocks with seteuid/setegid called from the
cloned process in runas.c when runas() is called exactly when a resize
thread exits.

Temporarily fix this issue by adding a mutex cross this resize
operation, which holds mutual exclusion with runas() usage.

We should investigate whether we want to properly call exec() from the
runas.c clone child before touching any non-async-signal-safe libc call.
However, given that this change is more intrusive, let's first use this
mutex-based work-around.

Before this fix, running 1000 instances of "demo-trace 300" with
sessiond running as root, and:

lttng create
lttng enable-event -u -a
lttng start

would sometimes lead to consumerd hang with the following clone child
backtrace:

setxid_mark_thread (cmdp=<optimized out>, t=0x7f52dd47c700)
    at allocatestack.c:995
995 allocatestack.c: No such file or directory.
(gdb) bt full
    at allocatestack.c:995
        ch = <optimized out>
    at allocatestack.c:1088
        t = 0x80
        signalled = <optimized out>
        result = <optimized out>
        runp = 0x7f52dd47c9c0
    at ../sysdeps/unix/sysv/linux/setegid.c:44
        __p = 0xfffffffffffffe00
        __cmd = {syscall_no = 119, id = {-1, 1000, -1}, cntr = 0}
        result = <optimized out>
        data = 0x7f52e66e1930
        writelen = <optimized out>
        writeleft = <optimized out>
        index = <optimized out>
        sendret = {i = 0, c = "\000\000\000"}
        ret = <optimized out>
        __func__ = "child_run_as"
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locals.
No symbol table info available.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: consumer fd recv poll should be sensitive to POLLPRI too
Mathieu Desnoyers [Wed, 11 Apr 2012 22:15:24 +0000 (18:15 -0400)] 
Fix: consumer fd recv poll should be sensitive to POLLPRI too

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.042818 seconds and 4 git commands to generate.