lttng-ust.git
11 years agoRemove outdated libustctl_function_tests test
Jérémie Galarneau [Wed, 20 Feb 2013 21:16:07 +0000 (16:16 -0500)] 
Remove outdated libustctl_function_tests test

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 years agoRemove outdated test hello2
Jérémie Galarneau [Wed, 20 Feb 2013 21:00:07 +0000 (16:00 -0500)] 
Remove outdated test hello2

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 years agoRemove outdated dlopen test
Jérémie Galarneau [Wed, 20 Feb 2013 20:36:51 +0000 (15:36 -0500)] 
Remove outdated dlopen test

Using dlopen to load the tracepoint providers is now discouraged as
specified in the lttng-ust man page.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 years agoRemove outdated test basic long
Jérémie Galarneau [Wed, 20 Feb 2013 20:16:33 +0000 (15:16 -0500)] 
Remove outdated test basic long

Replaced by the ust-demo test in lttng-tools

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 years agoRemove outdated test basic
Jérémie Galarneau [Wed, 20 Feb 2013 20:11:42 +0000 (15:11 -0500)] 
Remove outdated test basic

This test is replaced by the ust-demo test in lttng-tools

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 years agocyg_profile: implement fast and verbose .so
Mathieu Desnoyers [Tue, 26 Mar 2013 13:29:04 +0000 (09:29 -0400)] 
cyg_profile: implement fast and verbose .so

The "fast" .so (liblttng-ust-cyg-profile-fast.so) is for use-cases where
we expect a complete event stream to be recorded, so we can skip
duplicate information.

The verbose .so (liblttng-ust-cyg-profile.so) is for use-cases where
events discarded are expected, and the trace analyzer needs extra
information to be able to reconstruct the program flow.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoPerformance: add unlikely to tracepoint dynamic linking test
Mathieu Desnoyers [Tue, 26 Mar 2013 11:30:07 +0000 (07:30 -0400)] 
Performance: add unlikely to tracepoint dynamic linking test

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: _LGPL_SOURCE rcu dereference fix
Mathieu Desnoyers [Tue, 26 Mar 2013 12:18:18 +0000 (08:18 -0400)] 
Fix: _LGPL_SOURCE rcu dereference fix

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement liblttng-ust-cyg-profile function entry/exit instrumentation
Mathieu Desnoyers [Fri, 22 Mar 2013 16:30:22 +0000 (12:30 -0400)] 
Implement liblttng-ust-cyg-profile function entry/exit instrumentation

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoMinor fix: libc wrapper internal run script
Mathieu Desnoyers [Fri, 22 Mar 2013 16:29:44 +0000 (12:29 -0400)] 
Minor fix: libc wrapper internal run script

Take arguments in the script too.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: ustctl_recv_register_event pointer mixup
Mathieu Desnoyers [Fri, 22 Mar 2013 16:24:07 +0000 (12:24 -0400)] 
Fix: ustctl_recv_register_event pointer mixup

Was causing some event names to appear as "" in metadata.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: allow enabling same events for two channels
Mathieu Desnoyers [Thu, 21 Mar 2013 19:24:55 +0000 (15:24 -0400)] 
Fix: allow enabling same events for two channels

Fix the following use-case:

  593  lttng create
  594  lttng enable-channel test1 -u
  595  lttng enable-event -u -a
  596  lttng enable-event -u -a -c test1
  597  lttng start

run ./demo-trace

  598  lttng stop
  600  lttng view |wc -l

Previously, we were seeing only 8 events (number of events written in a
single stream), but now we see 16 events (each event is dispatched into
two streams).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd channel ID field to attr
Mathieu Desnoyers [Thu, 21 Mar 2013 15:08:14 +0000 (11:08 -0400)] 
Add channel ID field to attr

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRemove useless else clause
Mathieu Desnoyers [Thu, 21 Mar 2013 03:33:19 +0000 (23:33 -0400)] 
Remove useless else clause

Reported-by: Keun-O Park <keun-o.park@windriver.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agotracepoint: move "probe" test outside of loop
Mathieu Desnoyers [Thu, 21 Mar 2013 02:41:42 +0000 (22:41 -0400)] 
tracepoint: move "probe" test outside of loop

This is a slow-path optimisation.

Reported-by: Sahara <keun-o.park@windriver.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix uninitialized has_loglevel variable
Mathieu Desnoyers [Wed, 20 Mar 2013 20:07:07 +0000 (16:07 -0400)] 
Fix uninitialized has_loglevel variable

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix clang warnings
Mathieu Desnoyers [Wed, 20 Mar 2013 19:44:55 +0000 (15:44 -0400)] 
Fix clang warnings

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup: work-around clang unused result warning
Mathieu Desnoyers [Wed, 20 Mar 2013 19:27:41 +0000 (15:27 -0400)] 
Cleanup: work-around clang unused result warning

Not useful for CHAN_WARN_ON() macro.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup compile warning
Mathieu Desnoyers [Wed, 20 Mar 2013 18:07:17 +0000 (14:07 -0400)] 
Cleanup compile warning

ustctl.c: In function 'ustctl_init':
ustctl.c:1772:2: warning: implicit declaration of function
'lttng_ring_buffer_client_overwrite_rt_init'
[-Wimplicit-function-declaration]
ustctl.c:1774:2: warning: implicit declaration of function
'lttng_ring_buffer_client_discard_rt_init'
[-Wimplicit-function-declaration]
ustctl.c: In function 'ustctl_exit':
ustctl.c:1781:2: warning: implicit declaration of function
'lttng_ring_buffer_client_discard_rt_exit'
[-Wimplicit-function-declaration]
ustctl.c:1783:2: warning: implicit declaration of function
'lttng_ring_buffer_client_overwrite_rt_exit'
[-Wimplicit-function-declaration]

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup: remove unused variables
Mathieu Desnoyers [Wed, 20 Mar 2013 18:07:03 +0000 (14:07 -0400)] 
Cleanup: remove unused variables

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agotracepoint: Don't add NULL probes
Mathieu Desnoyers [Wed, 20 Mar 2013 18:02:38 +0000 (14:02 -0400)] 
tracepoint: Don't add NULL probes

Reported-by: Sahara <keun-o.park@windriver.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRemove mention of locking issues associated with dlopen usage
Jérémie Galarneau [Tue, 19 Mar 2013 20:43:32 +0000 (16:43 -0400)] 
Remove mention of locking issues associated with dlopen usage

This notice has been removed from the README as part of revision
b834dead.

Add a warning relating to dlclose() usage detailed in issue 447 in both
the man page and the README file.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement read timer (for RT)
Mathieu Desnoyers [Mon, 11 Mar 2013 14:12:40 +0000 (10:12 -0400)] 
Implement read timer (for RT)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoOnly flush when there are readers active
Mathieu Desnoyers [Sat, 9 Mar 2013 17:05:19 +0000 (12:05 -0500)] 
Only flush when there are readers active

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd mutex for channel wakeup fd update
Mathieu Desnoyers [Sat, 9 Mar 2013 16:56:25 +0000 (11:56 -0500)] 
Add mutex for channel wakeup fd update

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: fields should be initialized to NULL
Mathieu Desnoyers [Thu, 7 Mar 2013 16:55:01 +0000 (11:55 -0500)] 
Fix: fields should be initialized to NULL

Fixes uninitialized pointer free.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement ustctl_duplicate_ust_object_data
Mathieu Desnoyers [Wed, 6 Mar 2013 23:18:59 +0000 (18:18 -0500)] 
Implement ustctl_duplicate_ust_object_data

Allow sessiond to duplicate its object data. Useful for per-uid buffers.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd channel wakeup fd to monitor close
Mathieu Desnoyers [Wed, 6 Mar 2013 21:11:44 +0000 (16:11 -0500)] 
Add channel wakeup fd to monitor close

Add channel wakeup fd, so consumer can keep its handle on the stream
wakeup_fd (for periodic timer flush), and yet still discover that an
application has closed a channel or exited.

Requires to be updated in locked-step with lttng-tools
"Add channel wakeup fd to monitor close"

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: refcount issue in lttng-ust-abi.c
Mathieu Desnoyers [Wed, 6 Mar 2013 15:07:12 +0000 (10:07 -0500)] 
Fix: refcount issue in lttng-ust-abi.c

The following scenario could lead to a segmentation fault in
applications when the sessiond disappears or when the application try to
exit. This is caused by incorrect handling of reference counts.

This can happen in very particular race scenario, described as follows:

1) The sessiond asks for "release" of one or more objects (e.g. a
   session object), but _without_ asking for release of _all_ objects
   referencing the session.
2) The application exits, thus calling objd_table_destroy(). It walks on
   all objects, decrementing their reference count, freeing memory when
   their reference count reaches "1".

However, here is the issue: since "release" has already been performed
by sessiond on the session object, this extra reference count unref
performed by objd_table_destroy() can make the session object disappear
while it is still needed by either the channel object or the enabler
object. Therefore, we can experience a segmentation fault when we try to
unref and free the channel or enabler objects within
objd_table_destroy().

Fix this issue by adding the concept of an "owner reference". Only
objd_table_destroy(), lttng_ust_objd_table_owner_cleanup(), "release"
commands, and failure paths of object creation are allowed to decrement
the owner reference. We restrict objd_table_destroy() and
lttng_ust_objd_table_owner_cleanup() to _only_ decrement refcount of
objects _if_ their owner reference is still held.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: only consumerd should print errors
Mathieu Desnoyers [Wed, 6 Mar 2013 01:56:05 +0000 (20:56 -0500)] 
Fix: only consumerd should print errors

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoImplement ring buffer periodic buffer switch timer
Mathieu Desnoyers [Wed, 6 Mar 2013 01:03:37 +0000 (20:03 -0500)] 
Implement ring buffer periodic buffer switch timer

The tricky part was the teardown. It must not race against neither
pending signals nor in-flight signal handler execution, otherwise the
timer handler could access freed channel data. Use a dedicated thread to
handle those signals, with a synchronization point between each handler
execution.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: ensure all probe providers have their symbols
Mathieu Desnoyers [Tue, 5 Mar 2013 22:04:44 +0000 (17:04 -0500)] 
Fix: ensure all probe providers have their symbols

Following the removal of metadata generation from UST, the probes cannot
find the tracepoint_dlopen() symbol. Ensure those probes can be built by
declaring this symbol within each probe.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoReactivate error printing
Mathieu Desnoyers [Tue, 5 Mar 2013 20:17:22 +0000 (15:17 -0500)] 
Reactivate error printing

Print errors at buffer teardown if LTTNG_UST_DEBUG=1 is set (env. var.)
when launching the consumerd. This is possible now that consumerd owns
the buffers.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUnregister tracepoint probes when not needed
Mathieu Desnoyers [Mon, 4 Mar 2013 00:41:24 +0000 (19:41 -0500)] 
Unregister tracepoint probes when not needed

Ensure tracepoint probes are only connected when we meet these
conditions:

at least one enabler enables event && session active && channel enabled

We introduce a "tstate" flag in addition to "active/enabled".

Active and enabled fields are used to atomically enable/disable session
and channel, whereas the tstate flag is a "transient state" enable
state. It is used to update all events following a state change
transition. The actual effect of the state transition is committed
atomically with store to active/enabled flag.

Upon enable, we do:

tstate = 1
update all events
enable = 1;

Upon disable, we do the opposite:

enable = 0;
tstate = 0;
update all events

The purpose of this scheme is to allow atomic enable/disable of events
while allowing per-event probe registration to be performed
non-atomically.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup: remove now unused metadata code from UST
Mathieu Desnoyers [Sun, 3 Mar 2013 23:22:36 +0000 (18:22 -0500)] 
Cleanup: remove now unused metadata code from UST

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: notification timeout logic
Mathieu Desnoyers [Fri, 1 Mar 2013 17:57:39 +0000 (12:57 -0500)] 
Fix: notification timeout logic

-1: wait forever
0 to 10ms: wait for 10ms
+10ms: wait for the specified amount.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: don't print error in comm proto connect on ENOENT
Mathieu Desnoyers [Fri, 1 Mar 2013 16:54:31 +0000 (11:54 -0500)] 
Fix: don't print error in comm proto connect on ENOENT

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: return expected error return values for sessiond
Mathieu Desnoyers [Fri, 1 Mar 2013 16:45:45 +0000 (11:45 -0500)] 
Fix: return expected error return values for sessiond

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: set wait/wake fd to -1 before close
Mathieu Desnoyers [Fri, 1 Mar 2013 16:26:12 +0000 (11:26 -0500)] 
Fix: set wait/wake fd to -1 before close

Else triggers double-close race.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: Only notify socket should have timeout/nonblock
Mathieu Desnoyers [Thu, 28 Feb 2013 22:18:06 +0000 (17:18 -0500)] 
Fix: Only notify socket should have timeout/nonblock

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: ustctl: return -EPIPE to sessiond if connection is closed
Mathieu Desnoyers [Thu, 28 Feb 2013 18:03:44 +0000 (13:03 -0500)] 
Fix: ustctl: return -EPIPE to sessiond if connection is closed

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: Add timeout on notification socket
Mathieu Desnoyers [Wed, 27 Feb 2013 22:24:26 +0000 (17:24 -0500)] 
Fix: Add timeout on notification socket

Use the constructor timeout value. If an error occurs, shutdown() is
called on the socket, so the following attempts to use this socket will
fail very quickly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRemove now unused metadata printf code
Mathieu Desnoyers [Tue, 26 Feb 2013 20:47:53 +0000 (15:47 -0500)] 
Remove now unused metadata printf code

Metadata is now generated by sessiond.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoMove metadata creation into lttng-sessiond and lttng-consumed
Mathieu Desnoyers [Tue, 26 Feb 2013 19:32:52 +0000 (14:32 -0500)] 
Move metadata creation into lttng-sessiond and lttng-consumed

Includes fixes in type serialization. Also stop sending metadata channel
events.

Need to be applied in locked-step with lttng-tools commit:

"Move metadata creation into lttng-sessiond and lttng-consumed"

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd write metadata API to ust-ctl.h
Mathieu Desnoyers [Mon, 25 Feb 2013 19:05:15 +0000 (14:05 -0500)] 
Add write metadata API to ust-ctl.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoMove UST registry into sessiond and implement notifiers
Mathieu Desnoyers [Mon, 11 Feb 2013 23:00:34 +0000 (18:00 -0500)] 
Move UST registry into sessiond and implement notifiers

Needs to be use in locked-step with lttng-tools

"Move UST registry into sessiond and implement notifiers" commit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: don't flush-final for offset 0 if reader is on sub-buffer
Mathieu Desnoyers [Wed, 27 Feb 2013 21:39:30 +0000 (16:39 -0500)] 
Fix: don't flush-final for offset 0 if reader is on sub-buffer

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUse tp rcu link test in provider
Mathieu Desnoyers [Tue, 26 Feb 2013 20:25:18 +0000 (15:25 -0500)] 
Use tp rcu link test in provider

Ensure we never trigger a null pointer exception.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRemove direct dependency of probes on urcu-bp
Mathieu Desnoyers [Tue, 26 Feb 2013 20:16:57 +0000 (15:16 -0500)] 
Remove direct dependency of probes on urcu-bp

The filter feature added a direct dependency of probes providers against
urcu-bp .so, while linking them against liblttng-ust should suffice. Fix
this by using the tracepoint.h wrapper for rcu_dereference().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUse urcu tls-compat.h
Mathieu Desnoyers [Thu, 21 Feb 2013 15:55:52 +0000 (10:55 -0500)] 
Use urcu tls-compat.h

We can use the URCU_TLS() compatibility layer from userspace RCU to
support some BSD flavors that do not support __thread.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoLazy provider registration
Mathieu Desnoyers [Tue, 19 Feb 2013 15:43:10 +0000 (10:43 -0500)] 
Lazy provider registration

Register probe providers lazily, so process startup time is not impacted
by the number of events (especially for large number of events) as long
as no UST tracing session is active.

Refs #446

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAlways use lttng_get_probe_list_head to get probe list
Mathieu Desnoyers [Tue, 19 Feb 2013 14:54:05 +0000 (09:54 -0500)] 
Always use lttng_get_probe_list_head to get probe list

Prepare lazy probe registration.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix static build
Mathieu Desnoyers [Mon, 18 Feb 2013 20:12:51 +0000 (15:12 -0500)] 
Fix static build

Move init_usterr() to snprintf, along with its ust_loglevel state.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoMove LTTng-UST buffer ownership from application to consumer
Mathieu Desnoyers [Tue, 29 Jan 2013 22:40:18 +0000 (17:40 -0500)] 
Move LTTng-UST buffer ownership from application to consumer

Before this change, applications were performing allocation and teardown
of their buffers. Applications therefore had ownership of the buffers.
The shm and wait fd were passed from applications, though sessiond, to
consumerd through unix sockets.

This change moves ownership of buffers from applications to consumer.
This will allow sharing buffers across many processes in a near future.
It will also facilitate implementation of periodical timers on the
consumer side, now that it has ownership of channels and buffers
(also called streams). This imply that file descriptors on shm and
wakeup end of the pipe are now passed from the consumerd to sessiond,
then to applications, through unix sockets. Then, applications "map"
channel and streams into their own memory space. Channel control
structure is actually a copy for each application, while streams are a
shared memory map (shm) between consumerd and all applications that
write into it, and have a wake up file descriptor on the application
side.

Dependency on libuuid is now removed from lttng-ust, and moved to
lttng-tools, since the UUID is needed at channel and buffer allocation.

This commit needs to be used along with commit named
"Move LTTng-UST buffer ownership from application to consumer" in
lttng-tools.

Reviewed-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix package: don't distribute generated headers
Mathieu Desnoyers [Fri, 15 Feb 2013 13:19:59 +0000 (08:19 -0500)] 
Fix package: don't distribute generated headers

Fixes #421

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: don't cancel already exited threads
Mathieu Desnoyers [Thu, 14 Feb 2013 19:46:53 +0000 (14:46 -0500)] 
Fix: don't cancel already exited threads

Ensure we don't issue pthread_cancel() on already exited threads.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoScalability fix: tracepoint.c hash table size increase
Mathieu Desnoyers [Tue, 12 Feb 2013 19:25:28 +0000 (14:25 -0500)] 
Scalability fix: tracepoint.c hash table size increase

Speed up process startup for applications with large number of
tracepoints (e.g. 16k in J9 vm) by increasing the tracepoint.c hash
table size from 64 to 4096.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoScalability fix for many events: event hash table size
Mathieu Desnoyers [Tue, 12 Feb 2013 19:20:05 +0000 (14:20 -0500)] 
Scalability fix for many events: event hash table size

Increase number of buckets for event hash table (per session) from 64 to
4096. This improves process startup time for J9 vm (with 16k
tracepoints) very significantly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoSpeed up probe registration for large amount of events
Mathieu Desnoyers [Wed, 6 Feb 2013 21:56:16 +0000 (16:56 -0500)] 
Speed up probe registration for large amount of events

LTTng-UST probe registration is O(n^2). I actually left a comment that
describes this, also implying that we can improve this if it becomes an
issue.

I've had a report from Yang Wang, who works on instrumenting the J9 VM,
that O(n^2) does not agree well with 16000 probes and tracepoints.

It appears that lttng_probe_register() is being too paranoid for its own
good. There are now many things that are guaranteed by the way probe
providers are being built.

We actually need to keep a check that no provider with the same name has
been registered (O(n) on the number of registered providers, could be
improved with a hash table if it ever becomes necessary).

Use an assert to check that each event name starts with its own provider
name (it would be an internal error within the provider if it's not the
case). (O(n) on the number of events within a provider)

The rest is just useless, so remove this O(n^2) check.

While we are there, remove the now unused
lttng_event_get()/lttng_event_put() functions.

Reported-by: Yang Wang <yangw.wang5@unb.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd missing demo-trace shell script to dist tarball
Mathieu Desnoyers [Thu, 31 Jan 2013 19:59:11 +0000 (14:59 -0500)] 
Add missing demo-trace shell script to dist tarball

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoDocumentation: add uuid package name for Fedora in README
Mathieu Desnoyers [Thu, 31 Jan 2013 19:26:30 +0000 (14:26 -0500)] 
Documentation: add uuid package name for Fedora in README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: missing test for lttng_ust_comm_should_quit in lttng-ust-comm.c
Mathieu Desnoyers [Fri, 25 Jan 2013 15:11:18 +0000 (10:11 -0500)] 
Fix: missing test for lttng_ust_comm_should_quit in lttng-ust-comm.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdd compilation support for Tile architectures
Simon Marchi [Thu, 24 Jan 2013 20:42:18 +0000 (15:42 -0500)] 
Add compilation support for Tile architectures

Also add missing space on the mips line for OCD purposes.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoDocumentation: clarify debian package name for uuid in README
Mathieu Desnoyers [Mon, 21 Jan 2013 17:11:12 +0000 (12:11 -0500)] 
Documentation: clarify debian package name for uuid in README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: comment in ust-ctl.h
Mathieu Desnoyers [Mon, 21 Jan 2013 16:58:55 +0000 (11:58 -0500)] 
Fix: comment in ust-ctl.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix I/O-related error values in ustctl
Mathieu Desnoyers [Mon, 21 Jan 2013 15:56:33 +0000 (10:56 -0500)] 
Fix I/O-related error values in ustctl

These internal ustctl API members document >=0 as OK values. Make sure
reply recv errors are returned as errors.

Clarify ustctl_create_stream() error values.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: David Goulet <dgoulet@efficios.com>
11 years agoIntroduce hash table for lttng_create_event_if_missing()
Mathieu Desnoyers [Wed, 16 Jan 2013 17:56:09 +0000 (12:56 -0500)] 
Introduce hash table for lttng_create_event_if_missing()

lttng_create_event_if_missing() takes a lot of CPU time with stress-test
applications containing 1000 different TRACEPOINT_EVENT() and 1000
individual tracepoint() call-site.

With tracing disabled:

time ./AppWith1000_lines_TP 0

real    0m2.487s
user    0m2.424s
sys     0m0.000s

Introducing this hash table cuts the overhead very significantly when
tracing is enabled:

Before patch:

 72.16%  AppWith1000_lin  liblttng-ust.so.0.0.0             [.] lttng_create_event_if_missing
 25.64%  AppWith1000_lin  AppWith1000_lines_TP              [.] a(int)

time ./AppWith1000_lines_TP 0

real    0m7.946s
user    0m7.864s
sys     0m0.000s

After patch:

 89.13%  AppWith1000_lin  AppWith1000_lines_TP              [.] a(int)
  3.30%  AppWith1000_lin  liblttng-ust.so.0.0.0             [.] lttng_create_event_if_missing

time ./AppWith1000_lines_TP 0

real    0m2.762s
user    0m2.692s
sys     0m0.004s

Acked-by: David Goulet <dgoulet@efficios.com>
Acked-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: don't build C++ example if a C++ compiler isn't available
Samuel Martin [Sun, 13 Jan 2013 16:40:10 +0000 (11:40 -0500)] 
Fix: don't build C++ example if a C++ compiler isn't available

By default lttng-ust builds a hello.cxx C++ example that demonstrates
the usage of the userspace tracing library in a C++ program.
Unfortunately, when no C++ support is available, the build of lttng-ust
fails just because of this example code. So we make the compilation of
this code conditional on whether a working C++ compiler was found.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoRemove LIBFORMAT output in configure.
Simon Marchi [Wed, 9 Jan 2013 20:41:52 +0000 (15:41 -0500)] 
Remove LIBFORMAT output in configure.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoDocument dependency on libuuid
Mathieu Desnoyers [Thu, 20 Dec 2012 19:01:33 +0000 (14:01 -0500)] 
Document dependency on libuuid

Fixes #418

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoVersion 2.1.0 v2.1.0
Mathieu Desnoyers [Thu, 20 Dec 2012 18:24:28 +0000 (13:24 -0500)] 
Version 2.1.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoBump liblttng-ust-ctl lib version major number
Mathieu Desnoyers [Thu, 20 Dec 2012 17:32:15 +0000 (12:32 -0500)] 
Bump liblttng-ust-ctl lib version major number

This internal library between ust and tools has had its ABI changed
between 2.0 and 2.1.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoBump UST proto version minor number
Mathieu Desnoyers [Thu, 20 Dec 2012 15:44:05 +0000 (10:44 -0500)] 
Bump UST proto version minor number

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoHelper to debug: add object name
Mathieu Desnoyers [Thu, 20 Dec 2012 00:33:44 +0000 (19:33 -0500)] 
Helper to debug: add object name

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoTests: Fix rundir not created in ust-basic-tracing
Christian Babeux [Wed, 19 Dec 2012 19:41:43 +0000 (14:41 -0500)] 
Tests: Fix rundir not created in ust-basic-tracing

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoust test: add missing return -1
Mathieu Desnoyers [Wed, 19 Dec 2012 19:39:00 +0000 (14:39 -0500)] 
ust test: add missing return -1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoTest: update ust tracing unit tests to 2.1 internal ABI
Mathieu Desnoyers [Wed, 19 Dec 2012 19:37:14 +0000 (14:37 -0500)] 
Test: update ust tracing unit tests to 2.1 internal ABI

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoTests: Fix rundir not created in ust-multi-test
Christian Babeux [Wed, 19 Dec 2012 19:22:27 +0000 (14:22 -0500)] 
Tests: Fix rundir not created in ust-multi-test

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdapt internal files and examples to TRACEPOINT_INCLUDE
Mathieu Desnoyers [Mon, 17 Dec 2012 20:50:31 +0000 (15:50 -0500)] 
Adapt internal files and examples to TRACEPOINT_INCLUDE

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoAdapt tests to TRACEPOINT_INCLUDE
Mathieu Desnoyers [Mon, 17 Dec 2012 20:46:11 +0000 (15:46 -0500)] 
Adapt tests to TRACEPOINT_INCLUDE

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup: tests remove hello.cxx/ust_tests_demo.h
Mathieu Desnoyers [Mon, 17 Dec 2012 20:43:22 +0000 (15:43 -0500)] 
Cleanup: tests remove hello.cxx/ust_tests_demo.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: don't do macro expansion in tracepoint file name
Mathieu Desnoyers [Mon, 17 Dec 2012 20:36:08 +0000 (15:36 -0500)] 
Fix: don't do macro expansion in tracepoint file name

Change the API in a backward compatible way: previously, probe headers
would do e.g.

but e.g. "linux" here would be expanded to "1", which is bad.

Fix this by allowing those headers to do:

instead. We still support the old TRACEPOINT_INCLUDE_FILE for backward
compatibility.

Reported-by: Sébastien Barthélémy <barthelemy@crans.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix lttng-gen-tp: Template file must end in .tp
Christian Babeux [Fri, 14 Dec 2012 01:36:32 +0000 (20:36 -0500)] 
Fix lttng-gen-tp: Template file must end in .tp

Fixes #297

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoPack structures in comm protocol between UST and sessiond
Mathieu Desnoyers [Thu, 13 Dec 2012 22:01:05 +0000 (17:01 -0500)] 
Pack structures in comm protocol between UST and sessiond

Ensure robustness with respect to 32-bit vs 64-bit apps vs sessiond.

Since we are updating the ABI, change the order of overwrite field in
channel and channel attributes, to remove some unneeded padding.

This breaks compatibility between sessiond 2.1 and ust 2.0 (and
vice-versa), but sessiond refuses applications with version number that
does not match.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup lttng-gen-tp: Help not showing when using -h,--help
Christian Babeux [Thu, 13 Dec 2012 21:06:12 +0000 (16:06 -0500)] 
Cleanup lttng-gen-tp: Help not showing when using -h,--help

Fixes #299

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoCleanup lttng-gen-tp: remove leading underscore before include guard
Mathieu Desnoyers [Thu, 13 Dec 2012 20:05:26 +0000 (15:05 -0500)] 
Cleanup lttng-gen-tp: remove leading underscore before include guard

Fixes #298

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agofix memleak: ustctl free shadow chan on ustctl_unmap_channel()
Mathieu Desnoyers [Mon, 10 Dec 2012 20:33:05 +0000 (15:33 -0500)] 
fix memleak: ustctl free shadow chan on ustctl_unmap_channel()

Also on error path within map channel.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoUpdate license text
Mathieu Desnoyers [Wed, 5 Dec 2012 13:11:32 +0000 (08:11 -0500)] 
Update license text

- Add LICENSE file
- all public headers are now under MIT license,
- add missing text from MIT license into each file using this license.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: check if event enabled for bytecode-less events
Mathieu Desnoyers [Tue, 4 Dec 2012 12:30:04 +0000 (07:30 -0500)] 
Fix: check if event enabled for bytecode-less events

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoFix: handle enablers without bytecode
Mathieu Desnoyers [Mon, 3 Dec 2012 15:11:24 +0000 (10:11 -0500)] 
Fix: handle enablers without bytecode

to reproduce issue with the upstream "hello" program:

lttng create
lttng enable-event -u -a --filter 'intfield==42'
lttng enable-event -u -a
lttng start

./hello
lttng stop
lttng view

only shows event with 42 intfield. We expect all events.

Fixes #406

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 years agoPrint probe provider mismatch error even without -Wsystem-headers
Mathieu Desnoyers [Mon, 26 Nov 2012 20:14:24 +0000 (15:14 -0500)] 
Print probe provider mismatch error even without -Wsystem-headers

Suggested-by: David OShea <David.OShea@quantum.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agofilter: Add missing padding
Mathieu Desnoyers [Thu, 22 Nov 2012 19:41:13 +0000 (14:41 -0500)] 
filter: Add missing padding

This will make future extensions to filter much easier.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoVersion 2.1.0-rc2 v2.1.0-rc2
Mathieu Desnoyers [Thu, 22 Nov 2012 19:03:53 +0000 (14:03 -0500)] 
Version 2.1.0-rc2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agofilter interpreter cleanup: use uint64_t for retval
Mathieu Desnoyers [Thu, 22 Nov 2012 18:50:34 +0000 (13:50 -0500)] 
filter interpreter cleanup: use uint64_t for retval

Reported-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: filter linking can dereference NULL pointer on alloc failure
Mathieu Desnoyers [Thu, 22 Nov 2012 17:28:49 +0000 (12:28 -0500)] 
Fix: filter linking can dereference NULL pointer on alloc failure

Reported-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoCleanup: remove whitespaces and EOL in tests
Mathieu Desnoyers [Thu, 22 Nov 2012 16:05:13 +0000 (11:05 -0500)] 
Cleanup: remove whitespaces and EOL in tests

Reviewed-by: David Goulet <dgoulet@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFilter: use only single lower bit of filter return value
Mathieu Desnoyers [Tue, 20 Nov 2012 21:21:18 +0000 (16:21 -0500)] 
Filter: use only single lower bit of filter return value

Implementation change: use a uint64_t as filter return value, and test
with a mask for this bit. This reserves other bits for future use.

Reviewed-by: David Goulet <dgoulet@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: filter: var len array at end of external structure
Mathieu Desnoyers [Fri, 16 Nov 2012 22:20:09 +0000 (17:20 -0500)] 
Fix: filter: var len array at end of external structure

Reviewed-by: David Goulet <dgoulet@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: filter link fail handling
Mathieu Desnoyers [Fri, 16 Nov 2012 20:53:09 +0000 (15:53 -0500)] 
Fix: filter link fail handling

Reviewed-by: David Goulet <dgoulet@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 years agoFix: add missing seqnum field to filter
Mathieu Desnoyers [Fri, 16 Nov 2012 20:26:10 +0000 (15:26 -0500)] 
Fix: add missing seqnum field to filter

Reviewed-by: David Goulet <dgoulet@efficios.com>
Reviewed-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.045006 seconds and 4 git commands to generate.