lttng-tools.git
12 years agoIncrease sleep time for ust-nprocesses test
David Goulet [Wed, 8 Feb 2012 21:02:25 +0000 (16:02 -0500)] 
Increase sleep time for ust-nprocesses test

On slower system, the sleep time of ust-nprocesses can be too short
making the test fail. However, there is not much we can do to make sure
all app. registers to the session daemon and there is no time guarantee
also.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd trace directory option to lttng view
David Goulet [Wed, 8 Feb 2012 20:34:10 +0000 (15:34 -0500)] 
Add trace directory option to lttng view

With -t, --trace-path, you can specify a trace directory to be used by
the viewer. This option override the session name.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRemove fork() for the lttng view spawn viewer
David Goulet [Wed, 8 Feb 2012 20:22:39 +0000 (15:22 -0500)] 
Remove fork() for the lttng view spawn viewer

We can now ctrl+c the viewer :). The fork() is useless since the command
does nothing else after the exec().

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix unitilialized ret value (revisited)
Mathieu Desnoyers [Tue, 7 Feb 2012 22:46:54 +0000 (17:46 -0500)] 
Fix unitilialized ret value (revisited)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate hardcoded loglevels, allow shortcuts, add to lttng.h API
Mathieu Desnoyers [Tue, 7 Feb 2012 22:36:05 +0000 (17:36 -0500)] 
Update hardcoded loglevels, allow shortcuts, add to lttng.h API

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix uninitialized ret value
David Goulet [Tue, 7 Feb 2012 22:02:44 +0000 (17:02 -0500)] 
Fix uninitialized ret value

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoChange default options to lttng view
David Goulet [Tue, 7 Feb 2012 21:51:21 +0000 (16:51 -0500)] 
Change default options to lttng view

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRemove forgotten debug printf
David Goulet [Tue, 7 Feb 2012 21:48:38 +0000 (16:48 -0500)] 
Remove forgotten debug printf

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix session syscall listing
David Goulet [Tue, 7 Feb 2012 21:44:30 +0000 (16:44 -0500)] 
Fix session syscall listing

This problem occured because the "syscall" event was not added to the
event list since his kernel FD is not valid (fd=0). However, this fd is
only usefull if we want to add context or disable events. Those two
operations are not supported for now.

So, we can safely add the event to the list and add a hardcoded name in
the lttng cli list command.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd the lttng view command
David Goulet [Tue, 7 Feb 2012 19:13:20 +0000 (14:13 -0500)] 
Add the lttng view command

This adds "view" to the lttng command line interface. It's used to
visualize traces with a given viewers (default: babeltrace).

The -e, --viewer options is available to override the default viewer
settings or add arguments to the viewer.

For example:

$ lttng view -e "babeltrace -n scope --no-delta --clock-raw"

The trace directory path is automatically appended using the current
session or the given session name to lttng view.

The default behavior is to simply spawn babeltrace with "-n all".

$ lttng view
[...]

LTTv support is now disabled but is planned for the stable release.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix list command
Mathieu Desnoyers [Tue, 7 Feb 2012 18:28:19 +0000 (13:28 -0500)] 
Fix list command

Broken by commit 081311398b0deca05eebaac8672efbc9af272d36

Fix by only creating the handle if kernel or ust is specified (so it
still fixes the valgrind warning).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoZero-initialize struct msghdr
Mathieu Desnoyers [Tue, 7 Feb 2012 03:59:36 +0000 (22:59 -0500)] 
Zero-initialize struct msghdr

==27395== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to uninitialised byte(s)
==27395==    at 0x546C6A0: __sendmsg_nocancel (syscall-template.S:82)
==27395==    by 0x4E30880: lttcomm_send_creds_unix_sock (sessiond-comm.c:449)
==27395==    by 0x4E2F584: ask_sessiond (lttng-ctl.c:99)
==27395==    by 0x4E2FC85: lttng_list_tracepoints (lttng-ctl.c:667)
==27395==    by 0x4039C1: cmd_list (list.c:314)
==27395==    by 0x40217C: main (lttng.c:266)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix memleak in lttng list.c
Mathieu Desnoyers [Tue, 7 Feb 2012 03:49:20 +0000 (22:49 -0500)] 
Fix memleak in lttng list.c

==26825== 580 bytes in 1 blocks are definitely lost in loss record 13 of 13
==26825==    at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26825==    by 0x4E2F702: lttng_create_handle (lttng-ctl.c:385)
==26825==    by 0x403A5F: cmd_list (list.c:255)
==26825==    by 0x40217C: main (lttng.c:266)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agocompat poll: remove useless "void" and semicolons
Mathieu Desnoyers [Tue, 7 Feb 2012 03:26:21 +0000 (22:26 -0500)] 
compat poll: remove useless "void" and semicolons

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agotest session: tmp_name needs to be used twice
Mathieu Desnoyers [Tue, 7 Feb 2012 03:09:11 +0000 (22:09 -0500)] 
test session: tmp_name needs to be used twice

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoMake execution path with uninitialized domain fail
Mathieu Desnoyers [Tue, 7 Feb 2012 03:06:39 +0000 (22:06 -0500)] 
Make execution path with uninitialized domain fail

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agotests: ensure all get random string don't free
Mathieu Desnoyers [Tue, 7 Feb 2012 03:06:24 +0000 (22:06 -0500)] 
tests: ensure all get random string don't free

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCleanup tests coding style
Mathieu Desnoyers [Tue, 7 Feb 2012 02:59:42 +0000 (21:59 -0500)] 
Cleanup tests coding style

4 spaces -> tab

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix memory leak in get random string
Mathieu Desnoyers [Tue, 7 Feb 2012 02:59:29 +0000 (21:59 -0500)] 
Fix memory leak in get random string

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoInitialize all stack variables to zero, fix uninitialized loglevel variables
Mathieu Desnoyers [Tue, 7 Feb 2012 02:50:16 +0000 (21:50 -0500)] 
Initialize all stack variables to zero, fix uninitialized loglevel variables

If we want the padding behavior to be always the same (for future
extensibility), we need to set those variables to zero when they are
declared on the stack.

Also fix uninitialized loglevel variables in tests, which were failing
on x86_32 due to this.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoLoglevel fixes
Mathieu Desnoyers [Mon, 6 Feb 2012 22:18:22 +0000 (17:18 -0500)] 
Loglevel fixes

- fix event list bug due to loglevel error,
- enforce "-1" loglevel value in the sessiond when ALL loglevels are
  selected.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoInstall quickstart.txt and ChangeLog into system doc/
Mathieu Desnoyers [Sat, 4 Feb 2012 21:46:21 +0000 (16:46 -0500)] 
Install quickstart.txt and ChangeLog into system doc/

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCleanup list command printout for loglevel
Mathieu Desnoyers [Sat, 4 Feb 2012 17:42:19 +0000 (12:42 -0500)] 
Cleanup list command printout for loglevel

was:

(loglevel: TRACE_DEFAULT13)

should be:

(loglevel: TRACE_DEFAULT)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.0-pre19 v2.0-pre19
David Goulet [Thu, 2 Feb 2012 17:48:16 +0000 (12:48 -0500)] 
Update version to 2.0-pre19

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate lttng-kernel.h with padding
David Goulet [Thu, 2 Feb 2012 17:27:35 +0000 (12:27 -0500)] 
Update lttng-kernel.h with padding

Rename LTTNG_SYM_NAME_LEN to LTTNG_KERNEL_SYM_NAME_LEN. (following
lttng-modules ABI).

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate lttng.h with padding
David Goulet [Thu, 2 Feb 2012 17:27:28 +0000 (12:27 -0500)] 
Update lttng.h with padding

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoMerge branch 'master' of git://git.lttng.org/lttng-tools
David Goulet [Thu, 2 Feb 2012 16:55:22 +0000 (11:55 -0500)] 
Merge branch 'master' of git://git.lttng.org/lttng-tools

12 years agoShow error if kernel tracer version don't match
Mathieu Desnoyers [Thu, 2 Feb 2012 16:55:39 +0000 (11:55 -0500)] 
Show error if kernel tracer version don't match

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix EEXIST handling on epoll_ctl add
David Goulet [Thu, 2 Feb 2012 16:47:37 +0000 (11:47 -0500)] 
Fix EEXIST handling on epoll_ctl add

Creating a second channel on the kernel tracer triggers a
update_kernel_poll which iterates over all channels and add the file
descriptors to the epoll set. Collision occurs with the first previously
added channel so EEXIST is acceptable and we simply do not perror() to
keep the session daemon stderr clean.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix session listing msg when session name not found
David Goulet [Thu, 2 Feb 2012 16:47:31 +0000 (11:47 -0500)] 
Fix session listing msg when session name not found

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoVerify UST comm proto version
Mathieu Desnoyers [Thu, 2 Feb 2012 16:41:58 +0000 (11:41 -0500)] 
Verify UST comm proto version

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate local copy of UST ABI, for padding
Mathieu Desnoyers [Thu, 2 Feb 2012 16:19:49 +0000 (11:19 -0500)] 
Update local copy of UST ABI, for padding

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoMerge branch 'master' of git://git.lttng.org/lttng-tools
David Goulet [Thu, 2 Feb 2012 15:26:45 +0000 (10:26 -0500)] 
Merge branch 'master' of git://git.lttng.org/lttng-tools

12 years agoRevert "Simplify create_session of lttng create command"
David Goulet [Thu, 2 Feb 2012 15:19:04 +0000 (10:19 -0500)] 
Revert "Simplify create_session of lttng create command"

This reverts commit 318e4c832cc9a4209dcea885ef2a66cfd16f99d2.

The create_session function was changed making the session name not
having the date and time append to it anymore. This completely broke the
default behavior of automatic session creation. Only one possible
session name was 'auto'.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix return value of list command
David Goulet [Thu, 2 Feb 2012 15:17:16 +0000 (10:17 -0500)] 
Fix return value of list command

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix missing strncmp return value comparison
David Goulet [Thu, 2 Feb 2012 15:10:42 +0000 (10:10 -0500)] 
Fix missing strncmp return value comparison

Remove CMD_ERROR forced value in lttng cli list command.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate loglevel names
Mathieu Desnoyers [Thu, 2 Feb 2012 15:07:13 +0000 (10:07 -0500)] 
Update loglevel names

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix loglevel selection, implement loglevel help.
Mathieu Desnoyers [Thu, 2 Feb 2012 04:23:32 +0000 (23:23 -0500)] 
Fix loglevel selection, implement loglevel help.

Some loglevel information was not passed across the chain.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoABI update: only send loglevel value to UST: fixed loglevels
Mathieu Desnoyers [Thu, 2 Feb 2012 00:24:47 +0000 (19:24 -0500)] 
ABI update: only send loglevel value to UST: fixed loglevels

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix memory leak in lttng cli
David Goulet [Wed, 1 Feb 2012 23:38:13 +0000 (18:38 -0500)] 
Fix memory leak in lttng cli

Reported-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix wording in lttng cli usage
David Goulet [Wed, 1 Feb 2012 23:29:02 +0000 (18:29 -0500)] 
Fix wording in lttng cli usage

Fix cherry picked from Daniel U. Thibault
<daniel.thibault@drdc-rddc.gc.ca> patches.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix enable channel usage and add enable event error msg
David Goulet [Wed, 1 Feb 2012 23:19:20 +0000 (18:19 -0500)] 
Fix enable channel usage and add enable event error msg

Channel options were missing details to the usage text.

Also, add an error message if an event option is passed to user-space
that is not supported.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoImprove error handling of lttng cli
David Goulet [Wed, 1 Feb 2012 23:09:11 +0000 (18:09 -0500)] 
Improve error handling of lttng cli

Most of the commands were not returning a valid error code to the user.

Add "UST invalid context" lttcomm code and enforce "-t TYPE" for
add-context command.

Change error message for enable/disable event/channel in order to make
it standard for those commands and more meaningful to the user.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoDon't spawen session daemon on version command
David Goulet [Wed, 1 Feb 2012 20:56:31 +0000 (15:56 -0500)] 
Don't spawen session daemon on version command

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix return value and mem leak for all commands
Thibault, Daniel [Wed, 1 Feb 2012 18:59:50 +0000 (13:59 -0500)] 
Fix return value and mem leak for all commands

Add poptFreeContext(), send --help to stdout and default return value to
CMD_SUCCESS

Also fix some return values for list.c

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix loglevel handling in test case (API change) and lttng command
Mathieu Desnoyers [Wed, 1 Feb 2012 19:39:49 +0000 (14:39 -0500)] 
Fix loglevel handling in test case (API change) and lttng command

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRevert "Revert "Update loglevel ABI""
Mathieu Desnoyers [Wed, 1 Feb 2012 19:01:28 +0000 (14:01 -0500)] 
Revert "Revert "Update loglevel ABI""

This reverts commit 69892bbba677a6695b216046d586e58bfa0f82c9.

Revert of revert, need to go forward for ABI change.

Will fix problems in a following commit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRevert "Update loglevel ABI"
David Goulet [Wed, 1 Feb 2012 18:43:05 +0000 (13:43 -0500)] 
Revert "Update loglevel ABI"

Segfault on lttng enable-event when no loglevel is specified.

UST tests failed.

This implementation forces a loglevel to each event which is fine
however the default level is never set when no loglevel is specified.

The internal UST ABI/API (used when lttng-ust is disabled) was not
updated also making it fail when disablin the lttng-ust support.

This broke too much stuff in lttng-tools so the commit is reverted and
test must pass before commiting it again.

lttng-ust HEAD will *NOT* work with lttng-tools head so stay on commit
939950af98d044a3b0632cad5293f91cb1493ef8 for UST.

This reverts commit dad47fc4c65ec0acbfedc676895833b465d25cd6.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix memory leak in create command
Thibault, Daniel [Tue, 31 Jan 2012 19:32:56 +0000 (14:32 -0500)] 
Fix memory leak in create command

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoHarmonise lttng.h and lttng-ctl.c documentation
Thibault, Daniel [Tue, 31 Jan 2012 17:31:02 +0000 (12:31 -0500)] 
Harmonise lttng.h and lttng-ctl.c documentation

Fix comments alignment.

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate loglevel ABI
Mathieu Desnoyers [Tue, 31 Jan 2012 22:18:54 +0000 (17:18 -0500)] 
Update loglevel ABI

Loglevels are now an attribute part of an event, rather than an event
per se.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUse lttng-consumerd of the code tree for tests
David Goulet [Tue, 31 Jan 2012 15:47:54 +0000 (10:47 -0500)] 
Use lttng-consumerd of the code tree for tests

Better use the consumer daemon in tree that we just built and not the
one installed on the system that might be quite old ;)

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFixing memory leaks in add-context command
Thibault, Daniel [Mon, 30 Jan 2012 21:58:22 +0000 (16:58 -0500)] 
Fixing memory leaks in add-context command

Besides enforcing the return values and outputting --help to stdout, the
problem lay with the instances of struct ctx_type *type being created
but not assigned to the doubly-linked list under various error
conditions.

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRewrites lttng-ctl's set_session_daemon_path
Thibault, Daniel [Mon, 30 Jan 2012 21:26:34 +0000 (16:26 -0500)] 
Rewrites lttng-ctl's set_session_daemon_path

This fifth patch rewrites lttng-ctl's set_session_daemon_path() to avoid
duplicating snippets of code. It also fixes the snprintf return value
test so the code works with both GNU C < 2.1 and >= 2.1. With GNU C <
2.1, snprintf returns -1 if the target buffer is too small; with GNU C
>= 2.1, snprintf returns the required size (excluding the closing null)
under the same conditions.

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix lttng list usage
David Goulet [Mon, 30 Jan 2012 21:29:13 +0000 (16:29 -0500)] 
Fix lttng list usage

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoDocument and enforce return values
Thibault, Daniel [Fri, 27 Jan 2012 19:33:07 +0000 (14:33 -0500)] 
Document and enforce return values

In config_read_session_name(), moved the malloc to the beginning, to
avoid the fscanf() loop from trying to write to a NULL

In config_add_session_name(), dealt with another snprintf() occurrence

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoSimplify create_session of lttng create command
Thibault, Daniel [Mon, 30 Jan 2012 21:04:40 +0000 (16:04 -0500)] 
Simplify create_session of lttng create command

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoDocument return values
Thibault, Daniel [Mon, 30 Jan 2012 20:58:08 +0000 (15:58 -0500)] 
Document return values

Fix one return values that would return an -ENOMEM instead of a -1 on
error.

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoCatching up on misc. string and comment fixes
Thibault, Daniel [Mon, 30 Jan 2012 20:27:16 +0000 (15:27 -0500)] 
Catching up on misc. string and comment fixes

Signed-off-by: Daniel U. Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd GNU Gold requirement to README
David Goulet [Mon, 30 Jan 2012 18:27:11 +0000 (13:27 -0500)] 
Add GNU Gold requirement to README

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix tests Makefile options
David Goulet [Mon, 30 Jan 2012 18:16:47 +0000 (13:16 -0500)] 
Fix tests Makefile options

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRemove useless variable
David Goulet [Mon, 30 Jan 2012 18:13:36 +0000 (13:13 -0500)] 
Remove useless variable

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix UST add-context test
David Goulet [Mon, 30 Jan 2012 16:45:45 +0000 (11:45 -0500)] 
Fix UST add-context test

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoImprove lttng add-context message output
David Goulet [Mon, 30 Jan 2012 16:40:45 +0000 (11:40 -0500)] 
Improve lttng add-context message output

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix UST context on global update
David Goulet [Mon, 30 Jan 2012 16:38:03 +0000 (11:38 -0500)] 
Fix UST context on global update

Contexts were not added to the application upon registration.

Improve error handling on add context for event and channel.

Fix add_ust_ctx_* to lookup the context before adding it to the hash
table.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix unhandled return value
David Goulet [Mon, 30 Jan 2012 16:37:53 +0000 (11:37 -0500)] 
Fix unhandled return value

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd kernel work-around for boot_id
Mathieu Desnoyers [Mon, 30 Jan 2012 13:30:53 +0000 (08:30 -0500)] 
Add kernel work-around for boot_id

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lkml.org/lkml/2012/1/29/180
12 years agoDefine MAP_STACK to 0 if not defined by the architecture
Mathieu Desnoyers [Mon, 30 Jan 2012 13:05:21 +0000 (08:05 -0500)] 
Define MAP_STACK to 0 if not defined by the architecture

This is just a hint anyway, currently no-op.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoDon't iterate on events when adding context to channel
David Goulet [Fri, 27 Jan 2012 21:39:17 +0000 (16:39 -0500)] 
Don't iterate on events when adding context to channel

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix context mapping for UST and kernel
Mathieu Desnoyers [Fri, 27 Jan 2012 21:38:17 +0000 (16:38 -0500)] 
Fix context mapping for UST and kernel

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoAdd CMD_WARNING error code
David Goulet [Fri, 27 Jan 2012 17:43:54 +0000 (12:43 -0500)] 
Add CMD_WARNING error code

The CMD_WARNING is returned if at least one command went wrong and at
least one succeeded. This shoudl tell the user that there is an error
message on stderr but the rest of the command went well.

One use case for that is the multiple -t of add_context. If one of them
fails, this code is returned.

This error code is added at the end of the enum so the previous CMD code
are not changed.

Also, if the tracer (-k/-u) is not specified, CMD_ERROR is returned
instead of CMD_UNDEFINED which makes way more sense.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix comments and usage output
David Goulet [Fri, 27 Jan 2012 16:08:23 +0000 (11:08 -0500)] 
Fix comments and usage output

Multiple fixes to comments in lttng and lttng-consumerd.

Adds --list-commands as an arguments to ignore when auto spawning the
session daemon from lttng cli.

Usage of the consumerd now output on a stream and usage is set to stdout
when asked with --help.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix comments and enforce expected return values
David Goulet [Fri, 27 Jan 2012 15:37:45 +0000 (10:37 -0500)] 
Fix comments and enforce expected return values

Improve calibrate and add_context usage() printout. Document and enforce
the expected return values for the cmd_calibrate/cmd_addcontext chain of
functions.

Fix add_context usage()

Add documentation in liblttng-ctl.

Signed-off-by: Daniel Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoImprove lttng.c usage()
David Goulet [Fri, 27 Jan 2012 15:22:33 +0000 (10:22 -0500)] 
Improve lttng.c usage()

Signed-off-by: Daniel Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix lttng sessiond spawn wait race
Mathieu Desnoyers [Wed, 25 Jan 2012 14:39:28 +0000 (09:39 -0500)] 
Fix lttng sessiond spawn wait race

If the child is scheduled before the parent, using "pause()" in the
parent could be executed after the signal has been handled: that's
entirely racy. Use a proper signal handler and flag to handle this
racelessly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix sessiond needed checks
Mathieu Desnoyers [Wed, 25 Jan 2012 14:37:39 +0000 (09:37 -0500)] 
Fix sessiond needed checks

- strncmp should compare up to and _include_ the \0 (was off by one).
  Instead of 2 for "-h", it should be 3. Use "sizeof("-h")" instead of
  hardcoding 3.
- strncmp logic was reversed for the --list-options check.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRemove default defines from lttng.h
David Goulet [Tue, 24 Jan 2012 22:43:54 +0000 (17:43 -0500)] 
Remove default defines from lttng.h

They were not use in lttng.h and of no use for the user also. They are
all moved to common/defaults.h.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix comment of cmd_create
Simon Marchi [Tue, 24 Jan 2012 22:00:52 +0000 (17:00 -0500)] 
Fix comment of cmd_create

Another victim of copy paste.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
12 years agoFix file descriptor leak and typo in conf.c
Daniel Thibault [Tue, 24 Jan 2012 22:32:47 +0000 (17:32 -0500)] 
Fix file descriptor leak and typo in conf.c

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRename env var to standard LTTNG_ prefix
David Goulet [Tue, 24 Jan 2012 19:49:05 +0000 (14:49 -0500)] 
Rename env var to standard LTTNG_ prefix

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix typo in lttng cli comments
David Goulet [Tue, 24 Jan 2012 18:53:16 +0000 (13:53 -0500)] 
Fix typo in lttng cli comments

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUse correct variable in list bash autocompletion
Yannick Brosseau [Tue, 24 Jan 2012 18:44:01 +0000 (13:44 -0500)] 
Use correct variable in list bash autocompletion

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
12 years agoAdd kernel requirements
David Goulet [Tue, 24 Jan 2012 18:36:40 +0000 (13:36 -0500)] 
Add kernel requirements

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRemove useless COPYING file
David Goulet [Tue, 24 Jan 2012 18:04:05 +0000 (13:04 -0500)] 
Remove useless COPYING file

Fix typo in LICENSE

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFirst import of extras/ with lttng bash completion
David Goulet [Tue, 24 Jan 2012 17:30:45 +0000 (12:30 -0500)] 
First import of extras/ with lttng bash completion

Creation of the extras/ directory. Will mostly contains third part
scripts or tools not core to the project.

Adds the lttng bash completion script which can be copied to
/etc/bash_completion.d/lttng for first and second level command auto
completion.

Thanks to Simon Marchi for this contributions!

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd a '--list-options' option to each command.
Simon Marchi [Tue, 24 Jan 2012 16:28:04 +0000 (11:28 -0500)] 
Add a '--list-options' option to each command.

This is intended to be used for programmable Bash completion.

Modified from previous version:
- Changed '\0' to 0 to match current coding style.

Changes made by David Goulet:
- Check args for --list-options in lttng cli to stop auto execution of
  the session daemon.
- Adds --list-options to all help. (Hidding command is bad :P)
- Fix uninitialized ret value in enable channel

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoCheck kernel version for tests
David Goulet [Tue, 24 Jan 2012 16:49:49 +0000 (11:49 -0500)] 
Check kernel version for tests

Test using the session daemon must be done on a kernel version 2.6.27 or
higher for lttng-tools and lttng-ust requirements. Before starting a
session daemon, tests validate the kernel version and stop them if the
kernel is too old.

This is *really* important for launchpad build system which compile and
run our tests on 2.6.24 kernel.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd MSG_WAITALL to recvmsg of sessiond-comm
David Goulet [Tue, 24 Jan 2012 15:17:30 +0000 (10:17 -0500)] 
Add MSG_WAITALL to recvmsg of sessiond-comm

Get the complete message on receive. We do not handle receiving split
data with the lttcomm_recv_unix_sock which is *not* good but for now we
will simply add this flag since every call should block anyway and does
not require any other funky flags.

This issue was detected with the kernel events listing failing by
sending half of the data half the time.

Reported-by: Daniel Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoImplement UST calibrate and change default
David Goulet [Mon, 23 Jan 2012 23:08:42 +0000 (18:08 -0500)] 
Implement UST calibrate and change default

Calibrate now works for UST (even if ust does not implement it now).

Only --function is exposed since it's the only one implemented and also
becomes the default.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate lttng ust ABI/API copy
David Goulet [Mon, 23 Jan 2012 22:51:01 +0000 (17:51 -0500)] 
Update lttng ust ABI/API copy

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoChange not implemented error to undefined.
David Goulet [Mon, 23 Jan 2012 21:55:40 +0000 (16:55 -0500)] 
Change not implemented error to undefined.

Aiming to a stable release, "not implemented" message are not a good
idea for user to see.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoDisable lttng ust domain not implemented
David Goulet [Mon, 23 Jan 2012 21:42:30 +0000 (16:42 -0500)] 
Disable lttng ust domain not implemented

Keep them in lttng.h to retain values for future development.

Also fix define alignment in lttng.h

Note that at this commit, "Not implemented" error is still returned.
This will be fix to "Unknown command" in next commit.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate version to 2.0-pre18 v2.0-pre18
David Goulet [Mon, 23 Jan 2012 20:35:14 +0000 (15:35 -0500)] 
Update version to 2.0-pre18

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate TODO list
David Goulet [Mon, 23 Jan 2012 20:25:55 +0000 (15:25 -0500)] 
Update TODO list

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoChange SIGCHLD to SIGUSR1 when lttng waiting on sessiond
David Goulet [Mon, 23 Jan 2012 19:12:46 +0000 (14:12 -0500)] 
Change SIGCHLD to SIGUSR1 when lttng waiting on sessiond

Using lttng cli, if the session daemon dies after exec(), a SIGCHLD is
returned. It was catched but not handled to cleanly quit and inform the
user that the session daemon failed.

We now use SIGUSR1 to signal the lttng cli that the session daemon is
ready to receive command.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix kernel version to only test major version
David Goulet [Mon, 23 Jan 2012 18:31:16 +0000 (13:31 -0500)] 
Fix kernel version to only test major version

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd UST version validation
David Goulet [Mon, 23 Jan 2012 17:01:35 +0000 (12:01 -0500)] 
Add UST version validation

Upon registration of an UST app, we now check the version compatibility
with the session daemon and set a compatible bit. Only the major version
is validated since major version bump implies ABI/API breakage.

For now, every action on the application list check the app compatible
bit before executing it. We are too close from a stable release so hard
*not standard* check is done across the map for ust-app. The downside is
that the client will not get informed of any incompatible app upon any
action on the tracer using lttng cli.

If the version is NOT compatible, the register done is sent and the app
is kept in the registry. We can't close the socket or deny the
registration because if the env. var LTTNG_UST_REGISTER_TIMEOUT=-1 is
set on the app side, infinite loop will occur and possibly stall the
app.

New sessiond comm. version error added but not use at this commit.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate lttng kernel modules names
David Goulet [Sun, 22 Jan 2012 21:23:38 +0000 (16:23 -0500)] 
Update lttng kernel modules names

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd kernel module version validation
David Goulet [Sun, 22 Jan 2012 21:11:11 +0000 (16:11 -0500)] 
Add kernel module version validation

The session daemon now checks if the kernel modules are compatible
whenever it tries to load them.

Introduce modprobe.c/.h and kern-modules.h that contains the lttng
modules information and function to load/remove them. Also add a call to
kernel.c for kernel version validation.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoNew sessiond comm error for kernel version
David Goulet [Sun, 22 Jan 2012 21:10:03 +0000 (16:10 -0500)] 
New sessiond comm error for kernel version

Signed-off-by: David Goulet <dgoulet@efficios.com>
This page took 0.042057 seconds and 4 git commands to generate.