lttng-tools.git
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>
12 years agoAdd missing string.h header for strerror_r()
David Goulet [Sun, 22 Jan 2012 21:09:24 +0000 (16:09 -0500)] 
Add missing string.h header for strerror_r()

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix missing headers in Makefiles
David Goulet [Fri, 20 Jan 2012 22:06:11 +0000 (17:06 -0500)] 
Fix missing headers in Makefiles

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate README
David Goulet [Fri, 20 Jan 2012 22:02:29 +0000 (17:02 -0500)] 
Update README

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoMove all default values to defaults.h
David Goulet [Fri, 20 Jan 2012 21:57:25 +0000 (16:57 -0500)] 
Move all default values to defaults.h

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRename lttngerr.h to error.h
David Goulet [Fri, 20 Jan 2012 21:43:59 +0000 (16:43 -0500)] 
Rename lttngerr.h to error.h

Also add this header in common.h.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoSplit and remove lttng-share header file
David Goulet [Fri, 20 Jan 2012 21:30:23 +0000 (16:30 -0500)] 
Split and remove lttng-share header file

This header is split into two files: defaults.h and macros.h.

A third header is introduce here which is common.h including runas.h and
macros.h which are part of the common library. Since the defaults.h
contains only defaults values, it seems ok to keep it seperate from the
common library having only macros and function calls.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix DBG message grammatical error
David Goulet [Fri, 20 Jan 2012 20:54:18 +0000 (15:54 -0500)] 
Fix DBG message grammatical error

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoMove compat to common and create an internal lib
David Goulet [Fri, 20 Jan 2012 20:51:04 +0000 (15:51 -0500)] 
Move compat to common and create an internal lib

libcompat is the name of the new lib.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRename cmd.h for command.h
David Goulet [Fri, 20 Jan 2012 20:44:44 +0000 (15:44 -0500)] 
Rename cmd.h for command.h

Also move utils.h and conf.h inside the command.h because every lttng
cli commands are using those headers.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd missing headers for make dist
David Goulet [Fri, 20 Jan 2012 20:37:52 +0000 (15:37 -0500)] 
Add missing headers for make dist

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix off-by-one and double list size instead of steady increment
David Goulet [Fri, 20 Jan 2012 20:07:15 +0000 (15:07 -0500)] 
Fix off-by-one and double list size instead of steady increment

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoComplete change of the source directory tree
David Goulet [Fri, 20 Jan 2012 18:17:16 +0000 (13:17 -0500)] 
Complete change of the source directory tree

For the sake of clearness and awesomeness :P, this change was needed for
better semantic across the code and better organization of source files.

src/
--> Contains source files of the project
bin/
--> Contains every binaries this git tree builds (lttng,
lttng-sessiond and lttng-consumerd).

lib/
--> Contains exported libraries (lttng-ctl).

common/
--> Contains shared code for the entire project. (internal
libraries mostly)

Every internal headers are moved from include/ to src/common. The
include directory only contains exported public headers now
(lttng/lttng.h). The -I$(top_srcdir)/src is also added for all
Makefiles.

The consumerd APIs are not exported anymore. The reason is that the
consumer will get completely re-engineered in the next months. It's our
safety net for the APIs breakage of the coming year concerning the
consumerd library.

Renaming is done also on some internal libraries to follow the naming
convention. The public library liblttngctl is renamed to liblttng-ctl
making it linkable now with "-llttng-ctl" deprecating the old
"-llttngctl".

No code is changed with this commit except #include statements
added/removed/renamed. This is why there is yet files and internal API
calls that does not follow the naming convention (Ex: lttngerr.h,
lttng-share.h in src/common).

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoUpdate version to 2.0-pre17 v2.0-pre17
David Goulet [Thu, 19 Jan 2012 19:12:39 +0000 (14:12 -0500)] 
Update version to 2.0-pre17

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix missing files for make dist
David Goulet [Thu, 19 Jan 2012 19:06:43 +0000 (14:06 -0500)] 
Fix missing files for make dist

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoDon't init kernel tracer if not root (UID=0)
David Goulet [Thu, 19 Jan 2012 18:43:57 +0000 (13:43 -0500)] 
Don't init kernel tracer if not root (UID=0)

No point of trying to init kernel tracer if the session daemon is not
root. At this time, only UID=0 can load kernel modules and interact with
the lttng kernel tracer.

Reported-by: Daniel Thibault <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix strncmp for the help option check
David Goulet [Wed, 18 Jan 2012 17:21:42 +0000 (12:21 -0500)] 
Fix strncmp for the help option check

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix double free and out of order delete session
David Goulet [Tue, 17 Jan 2012 22:05:10 +0000 (17:05 -0500)] 
Fix double free and out of order delete session

Failing to create metadata, the data structure was freed but the pointer
was not set to NULL. When deleting the metadata of that session (that
has failed), the pointer was not NULL creating a "valid" pointer for the
check and creating a double free error. This failure happens when the
session daemon reached the maximum number of open files.

Also, on destroy trace, the ust app session was freed and deref. just
after creating an invalid pointer access.

Finally, set the started flag of a ust app session to 0 when stopping
the session.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoDon't start session daemon with --help on the cli
David Goulet [Tue, 17 Jan 2012 22:03:57 +0000 (17:03 -0500)] 
Don't start session daemon with --help on the cli

Any --help or -h will not spawned anymore a session daemon when used
with lttng cli.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix UST tests if lttng-ust is not available
David Goulet [Tue, 17 Jan 2012 21:20:18 +0000 (16:20 -0500)] 
Fix UST tests if lttng-ust is not available

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix code syntax
David Goulet [Tue, 17 Jan 2012 20:51:58 +0000 (15:51 -0500)] 
Fix code syntax

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd UST test ust-nprocesses
David Goulet [Tue, 17 Jan 2012 18:38:48 +0000 (13:38 -0500)] 
Add UST test ust-nprocesses

Simple to test that launches 100 instrumented applications and validate
that they are all registered to the session daemon.

After that, one event is enabled, tracing starts/stops and finally the
tracing session gets destroyed.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoMake MSG() print on stdout instead of stderr
David Goulet [Tue, 17 Jan 2012 18:37:56 +0000 (13:37 -0500)] 
Make MSG() print on stdout instead of stderr

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd UST test for n events using validation
David Goulet [Mon, 16 Jan 2012 22:25:49 +0000 (17:25 -0500)] 
Add UST test for n events using validation

ust-nevents tests an instrumented application generating 100 events and
validating that those events are found using babeltrace (need to be
installed).

Adds the tests/utils.sh which is a family of function used to interact
with lttng cli. There is also a trace_matches function which uses
babeltrace to find string patterns.

Also, the session daemon is spawned at the beginning of runall.sh and
killed at the end. This means that all tests are done on a single
session daemon instance. Thus, session name across tests have to be
unique! From now on, each test should use the file name as a unique
identifier for the session name.

Finally, fixed the session name for all tests. At this commit, "make
check" or "sudo make check" should pass.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd UST validation test for data structure
David Goulet [Mon, 16 Jan 2012 18:12:02 +0000 (13:12 -0500)] 
Add UST validation test for data structure

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix runas namespace
David Goulet [Mon, 16 Jan 2012 17:15:18 +0000 (12:15 -0500)] 
Fix runas namespace

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoMove runas.h to common/ directory
David Goulet [Mon, 16 Jan 2012 17:00:24 +0000 (12:00 -0500)] 
Move runas.h to common/ directory

Simply put to improve semantic over the code includes and knowing that
runas.h comes from the common library.

It's arguable to do this across the code base for all internal
libraries. This should be discuss at least for the code tree
consistency.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd UST test binaries to gitignore
David Goulet [Mon, 16 Jan 2012 16:54:20 +0000 (11:54 -0500)] 
Add UST test binaries to gitignore

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd two basic tests for UST global domain
David Goulet [Mon, 16 Jan 2012 16:08:35 +0000 (11:08 -0500)] 
Add two basic tests for UST global domain

They test basic functionnality of UST meaning creating
channel/session/event, enabling/disabling, start/stop and destroy the
session.

Those two tests *does not* use UST instrumented application. They only
test support and communication between lttng cli and session daemon.

Integrated with "make check"

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRemove CLONE_VM flag
Mathieu Desnoyers [Fri, 13 Jan 2012 21:18:27 +0000 (16:18 -0500)] 
Remove CLONE_VM flag

Makes debugging with GDB impossible. We'll have to revisit the actual
performance impact of not having CLONE_VM in place eventually.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRemove stringify and add quotes directly in the configure
Yannick Brosseau [Fri, 13 Jan 2012 15:23:49 +0000 (10:23 -0500)] 
Remove stringify and add quotes directly in the configure

Some part of the path where the same as some defined variable and
the resulting string conversion gave the wrong result.

Remove the whole stringify function, since its use can be misleading

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd debug output to sessiond's kernel consumer selection
Alexandre Montplaisir [Thu, 12 Jan 2012 22:50:36 +0000 (17:50 -0500)] 
Add debug output to sessiond's kernel consumer selection

Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd libdir and bindir outputs to configure
Alexandre Montplaisir [Thu, 12 Jan 2012 22:50:35 +0000 (17:50 -0500)] 
Add libdir and bindir outputs to configure

Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd target arch and paths to the configure output
Alexandre Montplaisir [Thu, 12 Jan 2012 22:50:34 +0000 (17:50 -0500)] 
Add target arch and paths to the configure output

The two eval's are needed to correctly expand the variables in the
default path.

Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix multiple error handling for UST tracing
David Goulet [Fri, 13 Jan 2012 18:47:24 +0000 (13:47 -0500)] 
Fix multiple error handling for UST tracing

Bad error handling was making event and channel out of sync between
trace ust and ust app data structure.

This makes the session daemon way more stable for the case the sessiond
and/or UST tracer reach the maximum number of open files.

Fix memory leaks upon error when creating a session/channel/event.

Fix out of order add unique channel node to hash table.

Finally, fix some debug/error statements.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoMerge branch 'master' of git://git.lttng.org/lttng-tools
David Goulet [Fri, 13 Jan 2012 15:10:58 +0000 (10:10 -0500)] 
Merge branch 'master' of git://git.lttng.org/lttng-tools

12 years agoFix incorrect error message for stop trace
Mathieu Desnoyers [Thu, 12 Jan 2012 22:49:31 +0000 (17:49 -0500)] 
Fix incorrect error message for stop trace

Reported-by: Tan Dung Le Tran <tan.dung.le.tran@ericsson.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix ht default size test
Mathieu Desnoyers [Thu, 12 Jan 2012 19:39:23 +0000 (14:39 -0500)] 
Fix ht default size test

in the line:

  size != 0 ? : (size = DEFAULT_HT_SIZE);

we should notice that the lack of ( ) around "size != 0" leads to the
following behavior: the compiler will try to evaluate

  "0 ? : (size = DEFAULT_HT_SIZE)"

and compare it to size, which is not the expected behavior.

Use a standard "if (cond)" test instead. The ? : expression is not
needed here anyway, it just complicates the code.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUST consumer: close shm fd after mapping it
Mathieu Desnoyers [Thu, 12 Jan 2012 19:30:04 +0000 (14:30 -0500)] 
UST consumer: close shm fd after mapping it

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate lttng-ust-abi.h local copy
Mathieu Desnoyers [Thu, 12 Jan 2012 18:51:08 +0000 (13:51 -0500)] 
Update lttng-ust-abi.h local copy

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRemove unneeded fields assignments (should not use those UST-internal fields)
Mathieu Desnoyers [Thu, 12 Jan 2012 18:47:09 +0000 (13:47 -0500)] 
Remove unneeded fields assignments (should not use those UST-internal fields)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix out of order channel insert in hash table
David Goulet [Thu, 12 Jan 2012 18:04:51 +0000 (13:04 -0500)] 
Fix out of order channel insert in hash table

The channel, ust-app side, was added to the hash table of the session
even if the creation failed on the tracer side. When enabling event for
that channel, a segfault was hit since the channel did not exist on the
tracer side and channel_data was NULL at this point.

Now the channel insertion in the hash table is done *after* enabling it
on the tracer side.

Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd missing rcu register thread calls
David Goulet [Thu, 12 Jan 2012 15:59:38 +0000 (10:59 -0500)] 
Add missing rcu register thread calls

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoFix trace UST destroy channel
David Goulet [Thu, 12 Jan 2012 15:47:13 +0000 (10:47 -0500)] 
Fix trace UST destroy channel

The trace_ust_destroy_channel call was iterating over the internal
events hash table and destroying the complete hash table at each event
which makes no sense at all. This caused a major segfault in the hash
table data structure when destroying a session.

Reported-by: Tan Dung Le Tran<tan.dung.le.tran@ericsson.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoMake consumer verbose only with --verbose-consumer option
David Goulet [Wed, 11 Jan 2012 22:09:54 +0000 (17:09 -0500)] 
Make consumer verbose only with --verbose-consumer option

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd missing rcu read lock and add assert
David Goulet [Wed, 11 Jan 2012 20:21:58 +0000 (15:21 -0500)] 
Add missing rcu read lock and add assert

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRCU support for consumer's hash tables
David Goulet [Wed, 11 Jan 2012 19:51:04 +0000 (14:51 -0500)] 
RCU support for consumer's hash tables

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd lttng hash table support to liblttng-consumer
David Goulet [Wed, 11 Jan 2012 17:03:07 +0000 (12:03 -0500)] 
Add lttng hash table support to liblttng-consumer

Remove linked list usage from liblttng-consumer and replace them by
lockless RCU hash tables.

Note that there is still a mutex lock protecting those hash tables and
no RCU lock mechanism used. For now, it's OK and a very small
performance hit.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoRemove application from socket hash table upon unregister
Mathieu Desnoyers [Tue, 10 Jan 2012 20:25:34 +0000 (15:25 -0500)] 
Remove application from socket hash table upon unregister

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix id vs uid confusion introduced by merge of new hash table code
Mathieu Desnoyers [Tue, 10 Jan 2012 19:37:33 +0000 (14:37 -0500)] 
Fix id vs uid confusion introduced by merge of new hash table code

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRemove incorrect assert in hash table lookup
Mathieu Desnoyers [Tue, 10 Jan 2012 18:55:26 +0000 (13:55 -0500)] 
Remove incorrect assert in hash table lookup

key can be NULL (0 value is allowed).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agolttng-sessiond: do not call ustctl_register_done()
Gerlando Falauto [Thu, 5 Jan 2012 11:25:29 +0000 (12:25 +0100)] 
lttng-sessiond: do not call ustctl_register_done()

When lttng-ust support is not enabled, compilation might fail with:
lttng-tools.git/lttng-sessiond/main.c:1167: undefined reference to
`ustctl_register_done'

Actually when HAVE_LIBLTTNG_UST_CTL is not defined, the function call is
normally optimized out by the compiler because ust_app_register() is a
static inline alway returning a negative value, leaving the call within
unreachable code.

Depending on the compiler version and optimization flags, this may
however not always happen, leading to the above error.

Therefore replace ustctl_register_done() with ustapp_register_done(),
which calls the original function when lttng-ust is enabled, and returns
an error otherwise (it is unreachable code anyway).

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd and support the new hash table library
David Goulet [Fri, 16 Dec 2011 22:14:21 +0000 (17:14 -0500)] 
Add and support the new hash table library

liblttng-ht/ is the library introduced for hash table management.

This library uses the URCU ht-shrink branch (not yet upstream) making
the lib completely lockless. Import git head URCU hashtables at commit:
91a75cc579698814e47877cc8927fcae1f573739

Note that urcu hash table files are copied from the urcu git ree to this
git tree waiting for them to be upstream and stable.

Old hash table files are removed from libcommon.

Signed-off-by: David Goulet <dgoulet@efficios.com>
12 years agoAdd missing Makefile.am in common/
Mathieu Desnoyers [Mon, 9 Jan 2012 15:22:06 +0000 (10:22 -0500)] 
Add missing Makefile.am in common/

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoMove runas to common/
Mathieu Desnoyers [Sat, 7 Jan 2012 21:19:51 +0000 (16:19 -0500)] 
Move runas to common/

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoMove hash table to common/ directory
Mathieu Desnoyers [Sat, 7 Jan 2012 21:14:38 +0000 (16:14 -0500)] 
Move hash table to common/ directory

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agorunas: use CLONE_VM flag
Mathieu Desnoyers [Sat, 7 Jan 2012 19:56:55 +0000 (14:56 -0500)] 
runas: use CLONE_VM flag

Having to clone the vma each time runas is executed brings a significant
slowdown to the "start" operation when done with attached application,
and to the file creation needed when an application is attaching to the
sessiond. Use CLONE_VM flag to speed this up.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agorunas: use waitpid instead of wait
Mathieu Desnoyers [Fri, 6 Jan 2012 21:52:28 +0000 (16:52 -0500)] 
runas: use waitpid instead of wait

Deal with multithreading by waiting specifically for the pid we cloned.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoUpdate version to 2.0-pre16 v2.0-pre16
David Goulet [Fri, 23 Dec 2011 16:19:08 +0000 (11:19 -0500)] 
Update version to 2.0-pre16

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agotest_sessions: add fflush after printf not ending with newline
Mathieu Desnoyers [Thu, 22 Dec 2011 02:35:19 +0000 (21:35 -0500)] 
test_sessions: add fflush after printf not ending with newline

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoclone: return instead of exit()
Mathieu Desnoyers [Thu, 22 Dec 2011 02:32:45 +0000 (21:32 -0500)] 
clone: return instead of exit()

Calling exit() from the cloned process is a bad idea, because we share
file descriptors with the parent, and exit() has side-effects (anyway,
more than the low-level _exit()).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix stack of librunas child by using mmap and a larger stack
Mathieu Desnoyers [Wed, 21 Dec 2011 23:44:36 +0000 (18:44 -0500)] 
Fix stack of librunas child by using mmap and a larger stack

Did cause SIGSEGV for tests/test_sessions.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoOnly seteuid/setegid if they differ from current values
Mathieu Desnoyers [Wed, 21 Dec 2011 15:42:51 +0000 (10:42 -0500)] 
Only seteuid/setegid if they differ from current values

According to seteuid(2):

       According to POSIX.1, seteuid() (setegid()) need not permit euid (egid)
       to be the same value as the current effective user (group) ID, and some
       implementations do not permit this.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoOnly allow the user or group owning the session (or root) to control a session
Mathieu Desnoyers [Wed, 21 Dec 2011 15:21:29 +0000 (10:21 -0500)] 
Only allow the user or group owning the session (or root) to control a session

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agolibrunas: clone another process also if not root
Mathieu Desnoyers [Wed, 21 Dec 2011 14:44:24 +0000 (09:44 -0500)] 
librunas: clone another process also if not root

Still useful to isolate umask(0).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCreate output directory at session creation command
Mathieu Desnoyers [Wed, 21 Dec 2011 02:46:48 +0000 (21:46 -0500)] 
Create output directory at session creation command

Otherwise it is weird to see that we are using a directory that we don't
have write access to. Better to fail immediately on the create command.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoImplement open_run_as, using clone() CLONE_FILES
Mathieu Desnoyers [Wed, 21 Dec 2011 02:33:13 +0000 (21:33 -0500)] 
Implement open_run_as, using clone() CLONE_FILES

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agolibrarize run_as
Mathieu Desnoyers [Tue, 20 Dec 2011 23:01:10 +0000 (18:01 -0500)] 
librarize run_as

still TODO: finish open_run_as -- need to pass the file descriptor back
to the parent. Currently using a racy open+fchown work-around.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoImplement run_as wrappers for mkdir/mkdir_recursive/open
Mathieu Desnoyers [Tue, 20 Dec 2011 21:42:58 +0000 (16:42 -0500)] 
Implement run_as wrappers for mkdir/mkdir_recursive/open

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoIntroduce run_as for mkdir_recursive
Mathieu Desnoyers [Tue, 20 Dec 2011 21:09:32 +0000 (16:09 -0500)] 
Introduce run_as for mkdir_recursive

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCreate all trace directories and files with client user credentials
Mathieu Desnoyers [Tue, 20 Dec 2011 20:19:01 +0000 (15:19 -0500)] 
Create all trace directories and files with client user credentials

Keep the client user credentials that created a session along with the
session. Use exactly those credentials to chown the created directories
and files.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoRename sessiond internal "uid" fields to "id"
Mathieu Desnoyers [Tue, 20 Dec 2011 18:12:30 +0000 (13:12 -0500)] 
Rename sessiond internal "uid" fields to "id"

Ensure we don't confuse "user ID" (UID) and session unique ID
(session_id or id).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoChange easter egg MSG to DBG
David Goulet [Fri, 16 Dec 2011 17:26:03 +0000 (12:26 -0500)] 
Change easter egg MSG to DBG

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoAdd debug statement
David Goulet [Fri, 16 Dec 2011 17:23:52 +0000 (12:23 -0500)] 
Add debug statement

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoSupport creds passing between lttng and sessiond
David Goulet [Fri, 16 Dec 2011 17:15:28 +0000 (12:15 -0500)] 
Support creds passing between lttng and sessiond

From now on, the lttng command line sends it's credential at each
command along with the regular communication data.

The tracing output directory is set to those credentials (uid/gid) if
the session daemon is running as a regular user (even if the user is in
the tracing group). So *no* tracing group is ever set if the session
daemon is not running as a non-root user.

If the sessiond is running as root, the tracing group is set (if exist)
and the uid of the calling user is used.

This fixes the triple enable-channel/event needed to trace UST
applications with a non-root session daemon. This was reported by
Yannick Brosseau <yannick.brosseau@polymtl.ca>.

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoAdd support for passing credentials over Unix sock
David Goulet [Fri, 16 Dec 2011 17:12:35 +0000 (12:12 -0500)] 
Add support for passing credentials over Unix sock

Add lttcomm_* functions for sending, receiving and setting socket option
to pass credentials over a Unix socket. Those functions allowed normal
data to be pass as well.

First commit of a series to enable credentials passing between the lttng
command line client and the session daemon.

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoFix nested double usage of hashtable iterators
David Goulet [Thu, 15 Dec 2011 16:42:44 +0000 (11:42 -0500)] 
Fix nested double usage of hashtable iterators

Also cleanup iterator declaration by moving the nested iterator inside
the loop scope.

Reported-by: Yannick Brosseau <yannick.brosseau@polymtl.ca>
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoAdd disable kernel tracing option to sessiond
David Goulet [Wed, 14 Dec 2011 21:24:42 +0000 (16:24 -0500)] 
Add disable kernel tracing option to sessiond

Use --no-kernel to completely disable kernel tracing.

Reported-by: Tan Dung Le Tran <tan.dung.le.tran@ericsson.com>
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoUpdate version to 2.0-pre15 v2.0-pre15
David Goulet [Tue, 13 Dec 2011 21:25:39 +0000 (16:25 -0500)] 
Update version to 2.0-pre15

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoChange liburcu dependency to 0.6.7
David Goulet [Tue, 13 Dec 2011 21:23:41 +0000 (16:23 -0500)] 
Change liburcu dependency to 0.6.7

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoFix missing files needed for release
David Goulet [Tue, 13 Dec 2011 21:06:58 +0000 (16:06 -0500)] 
Fix missing files needed for release

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoFix register consumer fd test on registration
David Goulet [Tue, 13 Dec 2011 20:50:16 +0000 (15:50 -0500)] 
Fix register consumer fd test on registration

When a kernel session is created, a consumer is immediately spawned. So,
using two sessions, the second one was not able to register it's own
consumer since the consumer_fd is set because there is a running kernel
consumer from the first created session. The flag consumer_fds_sent is
now used to test if the kernel consumer is already consuming buffers.

Reported-by: Julien Desfossez <julien.desfossez@polymtl.ca>
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoFix code syntax
David Goulet [Mon, 12 Dec 2011 20:58:34 +0000 (15:58 -0500)] 
Fix code syntax

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoUpdate quickstart with UST tracing howto
David Goulet [Mon, 12 Dec 2011 19:42:41 +0000 (14:42 -0500)] 
Update quickstart with UST tracing howto

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoDeprecate lttng-cli.txt file
David Goulet [Mon, 12 Dec 2011 19:42:27 +0000 (14:42 -0500)] 
Deprecate lttng-cli.txt file

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoFix missing consumer binary name in execl
David Goulet [Mon, 12 Dec 2011 17:58:11 +0000 (12:58 -0500)] 
Fix missing consumer binary name in execl

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoFix flush buffer after wait quiescent
David Goulet [Mon, 12 Dec 2011 17:56:29 +0000 (12:56 -0500)] 
Fix flush buffer after wait quiescent

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
12 years agoFlush UST buffers after stop and wait quiescent
David Goulet [Mon, 12 Dec 2011 15:43:57 +0000 (10:43 -0500)] 
Flush UST buffers after stop and wait quiescent

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
This page took 0.042886 seconds and 4 git commands to generate.