Christian Babeux [Wed, 3 Oct 2012 16:36:57 +0000 (12:36 -0400)]
Tests: Fix LD_PRELOAD library lookup path for health tests
The LD_PRELOAD library lookup was failing when the tests were not runned
in the health directory.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 3 Oct 2012 16:29:24 +0000 (12:29 -0400)]
Fix: Add arbitrary wait period for kernel streaming test
Once the trace has been destroy, there is a race condition between
reading the trace and the trace being completely written on disk.
We don't have anyway of telling if the streamed trace has been completed
so we have to add an arbitrary wait period so the test can successfully
parse and validate the trace.
I never hit that problem until this morning with my Linux 3.6.0 kernel.
Maybe related or not, still the trace can occur on slower systems.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 3 Oct 2012 15:07:14 +0000 (11:07 -0400)]
Fix coding style and add/change debug statements
Change all perror() to PERROR() and add some DBG() and ERR() statement
for easier verbose reading.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Paul Chavent [Tue, 2 Oct 2012 20:42:16 +0000 (16:42 -0400)]
Fix: Build out of src tree
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 2 Oct 2012 18:20:04 +0000 (14:20 -0400)]
Tests: Add health check tests to configure
Add health folder to top-level tests Makefile.am. Also add a runall
script to run all health check tests.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 2 Oct 2012 18:06:30 +0000 (14:06 -0400)]
Tests: Add health check thread stall test
This test trigger a "code stall" in a specified thread using the
testpoint mechanism. The testpoint behavior is implemented in
health_stall.c. The testpoint code stall a specific thread processing by
calling sleep(3).
The test select the thread to be stalled by enabling a specific
environment variable.
The test ensure the threads can be succesfully stalled and that the
health check feature is able to properly detect stalling in non-polling
cases.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 2 Oct 2012 18:05:32 +0000 (14:05 -0400)]
Tests: Add health check thread exit test
This test trigger a failure in a specified thread using the recently
introduced testpoint mechanism. The testpoints behavior is implemented
in health_exit.c. The testpoint code simply calls pthread_exit(3) and
effectively "kill" the thread without affecting the other threads
behavior.
The test select the thread to be "killed" by enabling a specific
environment variable.
With this test we ensure that each thread can be succesfully terminated
and that the health check feature properly detect a failure.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 2 Oct 2012 18:19:19 +0000 (14:19 -0400)]
Tests: Add a health check utility program
The health_check program is a simple utility to query the health
status of the different threads of the sessiond.
Sample output:
> ./health_check
Health check cmd: 0
Health check app. manage: 0
Health check app. registration: 0
Health check kernel: 0
Health check consumer: 0
The return code is encoded to indicate which thread has failed.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 2 Oct 2012 20:00:27 +0000 (16:00 -0400)]
Add testpoints in lttng-sessiond for each threads
This commit adds 8 new testpoints in the lttng-sessiond binary. These
testpoints rely on the testpoints infrastructure introduced recently.
Testpoints:
thread_manage_clients
thread_manage_clients_before_loop
thread_registration_apps
thread_manage_apps
thread_manage_apps_before_loop
thread_manage_kernel
thread_manage_kernel_before_loop
thread_manage_consumer
The thread_<thread_name> testpoints are placed directly at the thread
start and they can be used to trigger failure in <thread_name>.
The thread_<thread_name>_before_loop testpoints are placed directly
before the main processing loop of the thread and thus can be used to
stall the processing of the thread.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Fri, 14 Sep 2012 19:00:30 +0000 (15:00 -0400)]
New testpoint mechanism to instrument binaries for testing
This commit introduce two new macros: TESTPOINT_DECL(name) and
testpoint(name).
Here a quick example that show how to use the testpoint mechanism:
file: main.c
/* Testpoint declaration */
TESTPOINT_DECL(interesting_function)
void interesting_function(void)
{
testpoint(interesting_function);
/* Some processing that can fail */
...
}
int main(int argc, char *argv[])
{
interesting_function();
...
printf("End");
}
file: testpoint.c
void __testpoint_interesting_function(void)
{
printf("In testpoint of interesting function!");
}
Compile:
gcc -o test main.c
gcc -fPIC -shared -o testpoint.so testpoint.c
Run:
> ./test
End
> export LTTNG_TESTPOINT_ENABLE=1
> LD_PRELOAD=testpoint.so ./test
In testpoint of interesting function!
End
> export LTTNG_TESTPOINT_ENABLE=0
> LD_PRELOAD=testpoint.so ./test
End
The testpoint mechanism is triggered via the preloading of a shared
object containing the appropriate testpoint symbols and by setting the
LTTNG_TESTPOINT_ENABLE environment variable.
The check on this environment variable is done on the application
startup with the help of a constructor (lttng_testpoint_check) which
toggle a global state variable indicating whether or not the testpoints
should be activated.
When enabled, the testpoint() macro calls an underlying wrapper specific
to the testpoint and simply try to lookup the testpoint symbol via a
dlsym() call.
When disabled, the testpoint() call will only incur an additionnal test
per testpoint on a global variable. This performance 'hit' should be
acceptable for production use.
The testpoint mechanism should be *always on*. It can be explicitly
disabled via CFLAGS="-DNTESTPOINT" in a way similar to NDEBUG and
assert().
Please refer to 0005-testpoint-mechanism.txt for more information.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Mon, 1 Oct 2012 23:19:29 +0000 (19:19 -0400)]
Fix: off-by-one in comm proto between lttng-ctl and sessiond
Mostly affects setting a filter on an event with large event name.
This fix breaks the ABI between lttng-ctl and lttng-sessiond, both
should be updated together, and sessiond must be restarted.
Fixes #357
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
David Goulet [Fri, 28 Sep 2012 19:43:19 +0000 (15:43 -0400)]
Fix: Metadata stream leak when received in consumer
Between threads, when the metadata stream is received, it is allocated.
We now pass the pointer to the metadata thread thus fixing a memory leak
because the original stream was never freed.
This commit also modified some debug statements and remove a duplicate
code snippet.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Fri, 28 Sep 2012 20:41:25 +0000 (16:41 -0400)]
Fix: consumer_allocate_stream error handling
Fix a memory leak and "be nice" when handling stream alloc errors. Upon
CPU hotplug, it is possible that we receive a stream only after all
other streams are finalized, which means it could happen that we discard
that channel, in the unlikely event that we have cpu hotplug
concurrently with destroy.
Moreover, this fix the return path of channel lookup failure: we were
returning an zeroed stream rather than returning an error, which was
certainly not the intended behavior.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Fri, 28 Sep 2012 19:39:42 +0000 (15:39 -0400)]
Fix: consumer should await for initial streams
lttng-sessiond need to let the consumer know how many streams are sent
initially, so that for very short traces (short-lived apps, short kernel
trace), the consumerd don't run into the scenario where it deletes the
channel when there are still pending streams to receive for this
channel.
Fixes #355
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 28 Sep 2012 16:08:15 +0000 (12:08 -0400)]
Fix: Missing rcu read side lock in consumer
The metadata thread was not using rcu read side lock for its operations
on the internal metadata hash table.
This led to faulty free() when destroying the hash table and possible
corrupted data when it was resized.
Also change some static definition of calls inside consumer.c.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 26 Sep 2012 16:00:02 +0000 (12:00 -0400)]
Update version to v2.1.0-rc4
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 19 Sep 2012 14:15:45 +0000 (10:15 -0400)]
Fix: Change sempahore to pthread conditions
Fixes #324
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Wed, 26 Sep 2012 02:16:44 +0000 (22:16 -0400)]
Fix: relayd relay_send_version: handle sscanf return code
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Wed, 26 Sep 2012 02:10:06 +0000 (22:10 -0400)]
Fix relayd: NULL ptr deref
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Wed, 26 Sep 2012 02:03:47 +0000 (22:03 -0400)]
Fix: relayd: possible NULL ptr deref, memory leak, accept fd leak
- relay_cmd was not freed on error.
- newsock is a pointer. A pointer is always > 0. (unsigned comparison)
- if / else if could lead to newsock to be dereferenced while NULL.
- missing lttcomm_destroy_sock on newsock on setsockopt error.
Memory and FD leak.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Wed, 26 Sep 2012 00:49:41 +0000 (20:49 -0400)]
Tests: add print bytecode to filter grammar test
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 26 Sep 2012 00:47:36 +0000 (20:47 -0400)]
Cleanup: assign values to bytecode opcodes
This is part of a fixed ABI anyway, and it helps debugging.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 26 Sep 2012 00:46:10 +0000 (20:46 -0400)]
Fix: Filter: Fix allocation length error
Was causing generation of corrupted filter bytecode.
Fixes #351,#344
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 26 Sep 2012 00:44:24 +0000 (20:44 -0400)]
Fix: Filter: add missing ast free
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
David Goulet [Tue, 25 Sep 2012 19:27:49 +0000 (15:27 -0400)]
Add testpoint mechanism proposal 0005
A patch is coming later on that implements this proposal. Authored by
Christian Babeux <christian.babeux@efficios.com>.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 25 Sep 2012 16:06:38 +0000 (12:06 -0400)]
Tests: Add high throughput with bandwidth limits test
This test is used to stress the new streaming feature with high
throughput in a bandwidth limited use case.
The bandwidth limitation is done via the tc (traffic control) kernel
utility. Root permissions are needed to set bandwidth limits. Limits
are set on the loopback interface (lo).
The test cycle through bandwidth limits from 3200kbits to 50kbits.
There are currently two known limitations/issues:
- The tests fails when the lttng stop commands is issued right after the
traced applications are done executing.
- Setting a bandwidth limit on the control port of the relayd will
trigger a timeout in the sessiond.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Sep 2012 20:55:08 +0000 (16:55 -0400)]
Fix: Returned code when listing kernel channel
The lttng_list_channels() API call now returns a
LTTNG_ERR_KERN_CHAN_NOT_FOUND or LTTNG_ERR_UST_CHAN_NOT_FOUND when there
is no channel enabled for the session and domain.
Changes had to be made to the list command in order to correctly manage
the returned code.
The bug260 mentionned that the session(s) were destroyed but this could
not be reproduce. However, the rest of the bug description is valid.
Fixes #260
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 24 Sep 2012 16:11:47 +0000 (12:11 -0400)]
Tests: Rename helper functions to have consistent names
Most of the helper functions had inconsistent naming.
Suggested naming convention for helper functions:
<action>_<bin_name>
or
<action>_lttng_<command>
List of modified helper functions:
lttng_start_relayd -> start_lttng_relayd
lttng_stop_relayd -> stop_lttng_relayd
start_sessiond -> start_lttng_sessiond
stop_sessiond -> stop_lttng_sessiond
start_tracing -> start_lttng_tracing
stop_tracing -> stop_lttng_tracing
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 24 Sep 2012 16:11:46 +0000 (12:11 -0400)]
Tests: Cleanup redundant code and use printing helper functions
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 24 Sep 2012 16:11:45 +0000 (12:11 -0400)]
Tests: Add helper functions for printing status and banner
Add three new printing functions:
print_ok: Print the OK status with optional color support.
print_fail: Print the FAIL status with optional color support.
print_test_banner: Print a test banner of the test description.
e.g.:
sometest.sh:
TEST_DESC="A really useful test"
[...]
source $TESTDIR/utils.sh
print_test_banner $TEST_DESC
[...]
print_ok
print_fail
[...]
$ ./sometest.sh
----------------------
A really useful test
----------------------
OK
FAIL
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 24 Sep 2012 16:11:44 +0000 (12:11 -0400)]
Tests: Add a check for color support when printing status
When printing the status of test is OK or FAIL, check if stdout is
attached to a terminal device. This way the output is not cluttered with
useless escape characters. Some use cases where we don't want colors:
$ ./sometest | less
$ ./sometest > a.log
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Sep 2012 19:35:18 +0000 (15:35 -0400)]
Fix: Lib lttng-ctl on error returns lttng code
The library was returning negative value that were NOT a lttng error
code documented in lttng-error.h. This was problematic because the
lttng_strerror() could not recognized the returned code and thus the
caller was clueless about the error.
This patch makes sure every lttng-ctl calls return either the correct
documented positive value or a negative lttng error code on error that
can be directly translate by lttng_strerror() which takes a negative
lttng code.
Small fix: enable event command, when hitting a loglevel error now
returns a lttng error code and does not print the help anymore.
Fixes #337
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Sep 2012 17:24:48 +0000 (13:24 -0400)]
Fix: lttng_set_event_filter() was returning bad error code
Change the API call to return a lttng-error.h code. Also change the
already enable filter message from an ERR() to a WARN().
On error, the lttng UI now prints the returned error from the API call.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Sep 2012 17:14:01 +0000 (13:14 -0400)]
Fix: printing [no write] on lttng list -uf
The print message was using the wrong condition to print [no write].
Fixes #345
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Sep 2012 16:48:29 +0000 (12:48 -0400)]
Fix: Disable event on filter error with lttng
This patch slightly improves filter output messages and add a MSG() when
the filter is successfully set.
When a filter error occured, the enable _all_ events success message was
not printed out. This commit fixes this issue.
Fixes #343
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 24 Sep 2012 14:50:38 +0000 (10:50 -0400)]
Add test file from stable-2.0 to gitignore
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 21 Sep 2012 16:59:10 +0000 (12:59 -0400)]
Fix: Wrong returned error code on UST enable event
Instead of sending back a FATAL error, correctly notify the user of a
failed UST enable event.
The bug261 was not reproducible anymore but led to this fix.
(Closes 261)
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 19 Sep 2012 16:25:52 +0000 (12:25 -0400)]
Add consumer commands to lttng.1 man page
enable-consumer and disable-consumer are documented in lttng.1
The create command was also modified in version 2.1.
Some basic fixes of indentation, syntax and updates.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 18 Sep 2012 16:24:51 +0000 (12:24 -0400)]
Add lttng_health_check(3) man page
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 18 Sep 2012 15:13:33 +0000 (11:13 -0400)]
Fix: Remove LPOLLNVAL from consumer metadata revents
Without epoll(7), this value does not exist in the compat layer. For
now, this poll error is set within the LPOLLHUP in the poll(2) compat
header and POLLNVAL of epoll is set to POLLHUP so we basically don't
need it at all if we simply use the LPOLLHUP code.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 17 Sep 2012 21:32:03 +0000 (17:32 -0400)]
Fix: Mismatch of field name between ust and tools
The "written" field of the lttng_event_field and lttng_ust_field_iter
structures has been renamed to "nowrite" in the upstream version of
lttng-ust.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 17 Sep 2012 16:25:41 +0000 (12:25 -0400)]
Add the written value when listing fields
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 17 Sep 2012 15:57:07 +0000 (11:57 -0400)]
Fix: Consumer return value check after mmap/splice
With the feature of not sending the trace file padding over the network
for streaming, the return value of mmap or splice failed to match the
passed value when the trace is written on disk since we ignore the
padding for that case.
However, this was simply to print an error message so no behavior is
changed with this patch.
Detail comments were added to explain this "complex" return value check.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Thu, 13 Sep 2012 18:19:19 +0000 (14:19 -0400)]
Don't send the subbuffer padding for streaming
For network streaming, with the mmap() mechanism only for now, the
consumer does NOT send the padding over the network. Instead, the size
of the padding is specified in the data header or metadata payload.
The lttng-relayd now is the one appending the zeros to the trace files.
Again, this feature is NOT available yet for splice output.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 12 Sep 2012 19:26:46 +0000 (15:26 -0400)]
Update coding style. Add error handling section
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 12 Sep 2012 19:19:05 +0000 (15:19 -0400)]
Fix: Returned error code in consumer on read buffer
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 12 Sep 2012 15:33:24 +0000 (11:33 -0400)]
Update version to v2.1.0-rc3
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 11 Sep 2012 20:24:56 +0000 (16:24 -0400)]
Fix: Relayd fix ret value when adding a connection
The pointer was used and not the struct size.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 11 Sep 2012 17:48:56 +0000 (13:48 -0400)]
Add new thread in consumer for metadata handling
To prioritize the consumption of the metadata, this patch introduce a
new thread in the consumer which exclusively handles metadata in order
to separate them from the trace data.
The motivation behind this change is that once a start command is done
on the tracer (kernel or UST), the start waits up to 10 seconds for the
metadata to be written (LTTNG_METADATA_TIMEOUT_MSEC). However, there is
a case where there is not enough space in the metadata buffers and the
tracer waits so to not drop data. After the timeout, if the write(s) is
unsuccessful, the start session command fails.
The previous problem can occur with network streaming with high
throughput data such as enable-event -a -k and a low bandwitdh
connection.
The separation between metadata and trace data does the trick where
consuming metadata does not depend anymore on the arbitrary time to
stream trace data while metadata buffers needs to get consumed.
Of course, this fix is more _visible_ on multiprocessor/core machines
but can also help on single processor to prioritize metadata
consumption.
It helps on single-processor too because the scheduler will schedule
both the data and metadata threads. Even if the data thread need to send
many MB of data, if the metadata thread sends small enough metadata we
should be good with half of the CPU time.
I see that the metadata reaches easily 192k for kernel traces though. On
a 5KB/s connection, this sums up to 38s. However, thanks to the fact
that the 10s delay is allowed between each sub-buffer, we don't reach
the limit. This limits us to small trace packet sizes though, if we ever
have lots of metadata. E.g. on a 5KB/s connection, metadata buffers
configured as 2x64KB, with metadata size of e.g. 512KB, would trigger
the 10s delay error.
So we should be good for now, but removing this arbitrary 10s delay is
something to keep in mind as future improvement.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 11 Sep 2012 19:28:59 +0000 (15:28 -0400)]
Fix: consumer recv command error path
See bug #332.
The debug output now prints this and does not infinite loop:
DEBUG1: Communication interrupted on command socket [in
lttng_consumer_thread_receive_fds() at consumer.c:1784]
DEBUG1: consumer_thread_receive_fds exiting [in
lttng_consumer_thread_receive_fds() at consumer.c:1794]
Fixes #332
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Mon, 10 Sep 2012 14:45:41 +0000 (10:45 -0400)]
Fix filter: fix recent regressions
Fix:
commit
d93c4f1ffcffa73102e3299276f2f83951a68c36
Author: Christian Babeux <christian.babeux@efficios.com>
Date: Thu Sep 6 13:40:19 2012 -0400
Fix: Accept bytecode of length 65536 bytes
Broke the filter: it changed the reloc table format, without knowledge
of UST, and without good reason: it should stay { uint16_t, string } --
it does not need a uint32_t offset. Add a check for the value returned
by bytecode_get_len() when populating the reloc table.
Fix:
commit
5ddb0a08c5c3ca917b025032b864d78e53c7c68a
Author: Christian Babeux <christian.babeux@efficios.com>
Date: Mon Aug 27 14:48:21 2012 -0400
Fix: Generation of bytecode longer than 32768 bytes fails
Mixed the concepts of "len" and "alloc_len". It was therefore not
checking the bounds correctly, and was not zeroing the memory range
expected to be zeroed, causing out-of-bound array access.
Acked-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 7 Sep 2012 17:41:10 +0000 (13:41 -0400)]
Update lttng-ust-abi.h from upstream lttng-ust
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Thu, 6 Sep 2012 17:40:19 +0000 (13:40 -0400)]
Fix: Accept bytecode of length 65536 bytes
In order to support the filter bytecode maximum length (65536 bytes),
the lttng_ust_filter_bytecode len field type must be able to hold more
than a uint16_t. Change the field type to a uint32_t.
Also, since the relocation table is located at the end of the actual
bytecode, the reloc_table_offset (reloc_offset in ust-abi) field must
support offset values larger than 65535. Change the field type to a
uint32_t. This change will allow support of relocation table appended to
larger bytecode without breaking the ABI if the need arise in the
future.
Both changes currently breaks the filter ABI, but this should be a
reasonable compromise since the filtering feature has not been released
yet.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 27 Aug 2012 18:48:21 +0000 (14:48 -0400)]
Fix: Generation of bytecode longer than 32768 bytes fails
The bytecode buffer length field is currently limited to a uint16_t. A
larger buffer, lttng_filter_bytecode_alloc, is the underlying storage
for the bytecode.
The current allocation policy dictate that the alloc buffer size must be
doubled everytime the bytecode size plus padding exceeds its capacity.
A problem arise when generating bytecode larger than 32768 bytes.
e.g.:
Legend
* required_len: new bytecode len
* old_len: current alloc_len
* new_len: new alloc_len
src/bin/lttng/lttng enable-event event:bla -s foo -u --filter "`perl -e 'print "intfield" . " && 1" x2730'`"
UST event ust_tests_hello:tptest created in channel channel0
[debug liblttng-ctl] Generating IR... [debug liblttng-ctl] done
[debug liblttng-ctl] Validating IR... [debug liblttng-ctl] done
[debug liblttng-ctl] Generating bytecode... required_len = 11, old_len = 4, new_len = 16
required_len = 7, old_len = 4, new_len = 8
required_len = 16, old_len = 8, new_len = 16
required_len = 19, old_len = 16, new_len = 32
required_len = 40, old_len = 32, new_len = 64
required_len = 67, old_len = 64, new_len = 128
required_len = 136, old_len = 128, new_len = 256
required_len = 259, old_len = 256, new_len = 512
required_len = 520, old_len = 512, new_len = 1024
required_len = 1027, old_len = 1024, new_len = 2048
required_len = 2056, old_len = 2048, new_len = 4096
required_len = 4099, old_len = 4096, new_len = 8192
required_len = 8200, old_len = 8192, new_len = 16384
required_len = 16387, old_len = 16384, new_len = 32768
required_len = 32776, old_len = 32768, new_len = 65536 <-- Overflow 16-bits
Generate bytecode error
Error: Error setting filter
The last new_len exceed the range of 16-bits values. In order to support
the largest bytecode length (65535), the underlying alloc buffer len
must be able to store more than 65535. Fix this by using a uint32_t for
alloc_len.
Also, add a check to ensure that a bytecode longer than
LTTNG_FILTER_MAX_LEN (65535) bytes can't be generated.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 27 Aug 2012 18:48:19 +0000 (14:48 -0400)]
Fix: Filter bytecode alloc buffer size must be a power of 2
The current allocation policy for the filter bytecode buffer is to
double the size each time the underlying buffer can no longer contain
the entire bytecode plus padding.
In some cases, the initial allocation length is not a multiple of 2,
thus possibly leading to odd-looking allocation size each time the
buffer size is doubled.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Danny Serres [Thu, 9 Aug 2012 15:24:02 +0000 (11:24 -0400)]
Add lttng-ctl SWIG python bindings
The lttng-tools Python module can be used to directly control the
lttng-tools API inside Python, using 'import lttng'.
Therefore, it becomes possible to create a trace, add events, start/stop
tracing, destroy a session and so on from within Python.
SWIG >= 2.0 is used to create the wrapper and its 'warning md variable
unused' bug is patched in Makefile.am.
In the interface file, struct and enum are directly copied from lttng.h
(all changes must be made in both files).
To install with python bingings, configure using
--enable-python-bindings
Please note that this extra feature is added in extras/ hence not
supported and not yet shipped by default with the tarball or packages.
Signed-off-by: Danny Serres <danny.serres@efficios.com>
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 27 Aug 2012 16:49:35 +0000 (12:49 -0400)]
Add C++ support to API header files
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 24 Aug 2012 19:13:34 +0000 (15:13 -0400)]
Librarify filter in liblttng-ctl and hide symbols
Create the libfilter.la inside the liblttng-ctl directory so we can
statically link with lttng-ctl and the tests.
Also hide the dynamic symbol of libfilter used in liblttng-ctl.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 24 Aug 2012 18:36:58 +0000 (14:36 -0400)]
Set hidden visibility for calls used in lttng-ctl
The liblttng-ctl had multiple dynamic symbols that are only used inside
the lttng-tools code tree and should not be exposed to the user.
This commit sets every function calls found with "objdump -T" with a
hidden visibility attribute.
The strpbrk_or_eos() is set static and the struct net_families as well
so we don't export those two symbols.
At this stage there is still the filter_* calls that need to be fixed.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Fri, 24 Aug 2012 02:05:12 +0000 (22:05 -0400)]
Notify the user if a filter is already enabled
When using the enable-event command in conjunction with the --filter
option, a user can specify a filter expression to refine the trace
output.
As stated in the lttng(1) man page, only the first activation of a
filter on an event will work. Subsequent activation of any filter
expression on the same event will fail.
e.g:
> lttng enable-event app:tp -s session -u --filter 'somefield > 42'
Case: invalid filter expression
> lttng enable-event app:tp -s session -u --filter 'invalid expression'
Error: Error setting filter
Warning: Some command(s) went wrong
> ...
Case: filter already enabled for event app:tp
> lttng enable-event app:tp -s session -u --filter 'someotherfield < 42'
Error: Error setting filter
Warning: Some command(s) went wrong
This commit differentiate the case where a filter was already set for
the specified event from the generic 'Error setting filter' error
message.
e.g:
> lttng enable-event app:tp -s session -u --filter 'somefield > 42'
Case: invalid filter expression
> lttng enable-event app:tp -s session -u --filter 'invalid expression'
Error: Error setting filter
Warning: Some command(s) went wrong
> ...
Case: filter already enabled for event app:tp
> lttng enable-event app:tp -s session -u --filter 'someotherfield < 42'
Error: Filter on event app:tp is already enabled (channel 0, session session)
Warning: Some command(s) went wrong
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 24 Aug 2012 15:15:29 +0000 (11:15 -0400)]
Install lttng-error.h and include it in lttng.h
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 22 Aug 2012 19:04:52 +0000 (15:04 -0400)]
Add lttng-error.h containing every API err. code
Move all error codes from sessiond-comm.h to lttng-error.h and rename
them changing the prefix LTTCOMM* to the LTTNG_ERR_*.
With this change, the error codes will soon be public in
<lttng/lttng-error.h> that lttng.h will include by default.
This commit also removes a bunch of unused code but does NOT changed the
values so we don't break the 2.0 API.
The lttng_strerror() call uses the new error_get_str function. The
lttcomm_* API now only have internal communication error code such as
the consumerd errors. Those codes must NEVER be exposed to the public
API or, in that case, must be moved to lttng-error.h *without* changing
the current values of the lttng_error_code enum.
The gaps in the lttng_error_code enum found in lttng-error.h can be used
for new error codes but the assigned value are considered immutable for
the 2.x API.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Julien Desfossez [Thu, 23 Aug 2012 17:24:46 +0000 (13:24 -0400)]
Fix: missing hostname context
This context adds the hostname context field for the event(s) selected.
It is particularly useful when tracing a machine with containers (lxc),
that way we can easily distinguish events generated inside a container.
The API is extended but no features nor behaviors are changed.
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 22 Aug 2012 16:41:55 +0000 (12:41 -0400)]
Update version to v2.1.0-rc2
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 22 Aug 2012 16:27:23 +0000 (12:27 -0400)]
Fix: put back 2.0 output text for lttng create cmd
The create command was printing new messages with the changes made from
2.0 to 2.1 which is considered to be an API breakage.
This patch puts back the message output of 2.0 for the lttng create
command.
Reported-by: <bernd.hufmann@ericsson.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 22 Aug 2012 16:12:27 +0000 (12:12 -0400)]
Fix: remove set subdir call that uses bad ptr
When copying a consumer object from the tracing session to a specific
domain session, the original consumer of the session was modified by
appending the session name and datetime once again.
We ended up removing the call since at this stage in the code, the
session name and date is already appended if necessary.
Reported-by: <bernd.hufmann@ericsson.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Wed, 22 Aug 2012 13:34:03 +0000 (09:34 -0400)]
Filter: Handle the unary bitwise not operator (~) with an unsupported op error
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 21 Aug 2012 16:31:14 +0000 (12:31 -0400)]
Fix: missing mutex unlock on register consumer err
Reported-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 21 Aug 2012 15:51:23 +0000 (11:51 -0400)]
Remove underscore from ifndef of lttng.h
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 21 Aug 2012 15:49:44 +0000 (11:49 -0400)]
Remove unused define in lttng.h
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 21 Aug 2012 15:38:27 +0000 (11:38 -0400)]
Standardize lttng command line usage text
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 20 Aug 2012 21:12:51 +0000 (17:12 -0400)]
Merge duplicate code in consumer for destroy relayd
Kernel and UST were using the same exact code for the DESTROY_RELAYD
command received from the session daemon.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 20 Aug 2012 20:52:07 +0000 (16:52 -0400)]
Merge duplicate code in consumer for add relayd
The kernel and UST consumer were basically using the same exact code
when receiving a ADD_RELAYD command from the session daemon. We have
merge it in one simple function that both uses.
The daemon behavior is NOT altered with this patch.
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Mon, 20 Aug 2012 19:56:06 +0000 (15:56 -0400)]
Fix: Possible buffer overflows in strncat() usage
When using strncat, the size_t n argument must indicate the left over
space remaining in the buffer, *not* the total buffer size. Also, proper
care must be taken for the case where src contains n or more bytes and
thus allow space for the null terminating byte appended to dest (e.g.
strncat() will write n+1 bytes).
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Mon, 20 Aug 2012 19:42:10 +0000 (15:42 -0400)]
Move code out of main.c and fix some issues
This is a "code location refactoring". The file main.c was getting a bit
too HUGE so this commit splits the command subsystem of the session
daemon into cmd.c/.h and all helper functions used.
This commit also fixes missing rcu read side lock and the consumer
output hashtable memory leak on destroy.
Minor changes were made to functions call to pass needed variables from
the main.c to the command subsystem.
The behavior was not changed nor altered in any way.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 19:50:00 +0000 (15:50 -0400)]
Update version to v2.1.0-rc1
Bump internal UST major version.
Fix comments and debug output to follow this change.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 19:48:23 +0000 (15:48 -0400)]
Add missing decl. when UST is disabled
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 19:38:05 +0000 (15:38 -0400)]
Add missing scripts to the dist package
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 19:23:09 +0000 (15:23 -0400)]
Fix: UST app major version check
Makes a direct match between the major version of the application and
the one supported by lttng-tools (==).
Note that this version numbering is an internal scheme between UST and
lttng-tools. It has no link whatsoever with the public version of the
toolchain.
The 2.1.0-rc1 release commit will make sure this version corresponds to
the UST rc1.
CC: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 19:03:39 +0000 (15:03 -0400)]
Fix relayd version check and remove unused code
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 18:02:56 +0000 (14:02 -0400)]
Fix lttng view using lttng list sessions
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 17:02:14 +0000 (13:02 -0400)]
Fix comments and help text
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Fri, 17 Aug 2012 16:47:16 +0000 (12:47 -0400)]
Fix: lttng list command with network path
With network consumer, the session path was simply NULL or set to the
wrong local filesystem path when a consumer was set to use the network.
This commit adds the support for network path description when a lttng
list command is received.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Thu, 16 Aug 2012 20:12:12 +0000 (16:12 -0400)]
Deny register consumer if one exists
Is a LTTNG_REGISTER_CONSUMER command is received and a consumer is
already spawned, the command is denied returning a kernel consumer
error.
CC: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Thu, 16 Aug 2012 18:57:13 +0000 (14:57 -0400)]
Fix: Subdirectory handling for lttng and sessiond
The subdirectory creation was not right for a number of scenarios. With
this commit, if the user defines a path (either local or remote), the
session name will NOT be added to the path.
To handle the timestamp creation of the directory, a hidden function was
added to the lttng-ctl (meaning not visible through lttng.h) which takes
the date and time as a string and append it to the URI subdirectory if
none was provided for a network destination. This function is declared
as extern in the lttng client so it could link to it through the
liblttng-ctl (_lttng_create_session_ext).
It allows the timestamp of a session to be created on the client side
and keep the lttng_create_session() behavior intact meaning if a path is
define by the user when using the API directly, the traces are written
in that path without an extra session name directory.
There is one case where the timestamp is generated on the daemon side.
When creating a session with a local filesystem destination and then
switching to a network consumer, at that time the timestamp is
generated.
The real problematic, and why this has been done this way, is because we
can't transfer the timestamp between the client and the session daemon.
The only possible way that could be achieve right now is by parsing the
subdirectory of the URI containing the session name and timestamp
appended. This could be error prone and bring false negative.
CC: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Wed, 15 Aug 2012 16:39:31 +0000 (12:39 -0400)]
Cleanup: Remove unused get_default_session_name()
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Wed, 15 Aug 2012 16:39:30 +0000 (12:39 -0400)]
Fix: Invalid free on session_name when destroying session
The session_name should not be free(3) if the user has specified a
session name on the command line. Also, the caller is responsible to
free the allocated string when calling get_session_name(). Handle both
cases gracefully.
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Thu, 16 Aug 2012 19:17:11 +0000 (15:17 -0400)]
Fix: 32-bit print format type mismatch warnings
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Mathieu Desnoyers [Thu, 16 Aug 2012 14:51:01 +0000 (10:51 -0400)]
Cleanup: symbols in parser protected -> hidden
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
David Goulet [Thu, 16 Aug 2012 14:46:26 +0000 (10:46 -0400)]
Fix: set kernel consumer output directory
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 15 Aug 2012 20:50:27 +0000 (16:50 -0400)]
Add commented debug lines to test
Useful when a test fails, just uncomment the lines :)
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 15 Aug 2012 20:41:37 +0000 (16:41 -0400)]
Fix: multiple consumer locking problems
First, a lot of rcu_read_unlock() were missing the consumer command
handler which could make a rcu lock and return on error without
unlocking.
Fix goto error path in the consumer.
Fix a missing lock control socket mutex.
Fix memory leaks in a UST session where the consumers output object were
not freed during a destroy command.
Add a relayd sockets sent flag so we don't resend existing sockets to
the consumer during an enable_consumer command.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 15 Aug 2012 15:47:06 +0000 (11:47 -0400)]
Backport HT fixes from urcu upstream
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 15 Aug 2012 15:10:36 +0000 (11:10 -0400)]
Make the configure check for ustctl_set_filter
This function call will be part of the 2.1 release and lttng-tools 2.1
needs lttng-ust-ctl 2.1 for user space tracing to work.
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Wed, 15 Aug 2012 14:41:46 +0000 (10:41 -0400)]
Fix typos in uri_switch test
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 14 Aug 2012 22:02:32 +0000 (18:02 -0400)]
New URI switching tests
test_uri_switch_localhost_folder:
Random switching of the ouput folder for streaming on localhost.
test_uri_switch_file_network:
Create a session with a file:// URI and enable the consumer with a
net:// URI.
test_uri_switch_network_file:
Create a session with a net:// URI and enable the consumer with a
file:// URI.
All tests support IPv4 and IPv6 streaming targets.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 14 Aug 2012 21:14:04 +0000 (17:14 -0400)]
Fix: Possible invalid read on string in set_ip_address()
Acked-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 14 Aug 2012 20:33:39 +0000 (16:33 -0400)]
Fix: Use Python 2.x for the run-report script
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
David Goulet [Tue, 14 Aug 2012 21:08:12 +0000 (17:08 -0400)]
Activate streaming tests in make check
Signed-off-by: David Goulet <dgoulet@efficios.com>
Christian Babeux [Tue, 14 Aug 2012 20:33:41 +0000 (16:33 -0400)]
Fix: Memory leaks in uri_parsing unit tests.
lttng_uri need to be free'd by calling uri_free().
Add: Unit tests for uri comparison (uri_cmp).
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
This page took 0.046209 seconds and 4 git commands to generate.