Michael Jeanson [Thu, 18 Feb 2016 17:45:13 +0000 (12:45 -0500)]
Fix: Use ipv6 loopback adress in test_uri
Some older version of Debian/Ubuntu and maybe other distros won't set
localhost to point on ::1 in the system hosts file and use instead a
custom name like ip6-localhost or ipv6-locahost which is not
standardized across distros.
To work around this, use the ipv6 loopback address instead of localhost.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tests are using the nproc utility which return the number of
_available_ CPUs. The distinction between online, available and
configured CPUs is subtle, but important.
The number of "online" CPUs can change at runtime as CPUs are
hot-plugged. This could happen during a test and result in
unexpected results.
The number of "configured" CPUs includes any CPU which may be
offline at the time.
The number of "available" CPUs, which is what is returned by the
nproc utility, may differ from both "online" and "configured"
counts. This is the case in containers which are assigned to a
subset of configured CPUs.
clock offset: print negative value in metadata for lttng-ust metadata
In the upcoming 2.8, we can print the negative value of clock offset in
the metadata, and expect users to update their viewers to correct any
bug that could prevent them from handling those negative values.
This happens only in cases where the system sets CLOCK_REALTIME to 0
after boot, thus leading to a negative clock offset value between
realtime and monotonic clocks.
Fix: handle negative clock offset for lttng-ust metadata
In the unlikely situation where a system sets its hardware clock
(CLOCK_REALTIME) to 0 (Epoch) after boot, the difference
monotonic - realtime
becomes negative.
Fixup this situation by returning a 0 offset in this case.
This ensures that trace viewer implementations (e.g. babeltrace) which
currently cannot handle the negative offset (known bug) still work with
the generated traces.
This patch should be applied to master and stable-2.7.
Jonathan Rajotte [Thu, 14 Jan 2016 20:08:22 +0000 (15:08 -0500)]
Fix: test: append to LD_LIBRARY_PATH
The overwriting of LD_LIBRARY_PATH can cause failure of tests when lttng-ust is
not installed in the default path and location is passed via LD_LIBRARY_PATH.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Build: fallback to AC_CHECK_LIBS when looking for popt and uuid
Not all distro ship .pc so fallback to basic libs searching if necessary.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Samuel Martin [Tue, 1 Dec 2015 23:36:45 +0000 (00:36 +0100)]
tests/unit: fix object files' location
Referring to *.o files under a .libs/ directory is not recommended
because this belongs to libtool's innards.
Indeed, libtool decides to place the *.o files in an
implementation-specific location:
- PIC *.o files go into a .libs/ directory;
- non-PIC *.o files are generated along side to their corresponding
source files.
Using PIC objects to build executable is legit, thought it may
introduce some minor overhead at runtime.
However, hard-coding these PIC object files in the Makefile.am to build
executables breaks the build in case of static only build.
In this case, no PIC object files is generated, so the linker will not
found some of the needed objects files.
Changing these dependencies' path fixes the static build, keeping the
shared one ok, though the non-PIC object files are now always built.
Fixes #983.
Fix tested on git master and v2.6 with no change needed.
Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Samuel Martin [Sun, 22 Nov 2015 22:38:00 +0000 (23:38 +0100)]
configure.ac: fix static build
For static build, some extra LDFLAGS may be needed.
Using PKG_CHECK_MODULES instead of AC_CHECK_LIB for librairy detection
allows to get all these flags. Then, the LIBS variable can be extended
with everything that is needed.
So, use PKG_CHECK_MODULES for popt and uuid detection; which both depend
on libintl.
This changes fixes build failures triggered with Buildroot, e.g.:
http://autobuild.buildroot.net/results/0f1/0f1e015a0c5a5ac2beeb5011d31a1e0058a32a0d/build-end.log
Signed-off-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Julien Desfossez [Fri, 27 Nov 2015 17:12:44 +0000 (12:12 -0500)]
Fix: close indexes when rotating the trace files in splice mode
The consumer needs to close the old index file when doing a file
rotation before opening a new one.
The relay does not have this problem (handled with refcounts).
usleep_safe() ensures that usleep honors its timing guarantees
(which it, according to the man pages, does not strictly enforce).
Some tests need to make ensure no events are emitted at the same
timestamp since Babeltrace does not define an ordering which can
be relied upon in such a case.
Philippe Proulx [Tue, 1 Sep 2015 02:32:11 +0000 (22:32 -0400)]
make check: add warning when LTTng processes are running
This patch adds a warning when running LTTng/test processes are
detected at the beginning of make check. It offers a convenient
way to kill them and warns the user that some tests could fail
if the processes are kept alive.
The check can be disabled by setting
$LTTNG_TOOLS_TESTS_DISABLE_WARN_LTTNG_PROCESSES to 1
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Adds debug output to the getcpu_override test and split its
two tests into two distinct functions. This ensures that we
output two separate traces without overwriting the previous one.
Fix: Check for NULL hash tables on relay daemon teardown
The relay daemon will log any "leaked" object on exit. However,
some errors encountered early-on during the daemon's
initialization may result in the teardown being executed with
uninitialized hash tables.
Agent: Make the agent protocol consistently network endian
Considering the Agent Protocol is bumped to v2.0 as of 2.8.x,
this patch revisits the unfortunate decision of communicating
in host-endianness from the session daemon to the agents, and
in big endian from the agents to the session daemon.
Mikael Beckius [Wed, 21 Oct 2015 19:48:29 +0000 (15:48 -0400)]
Fix live timer calculation error
There is an calculation error for live timer. Variable
switch_timer_interval is based on microsecond, and it is not
right to assign switch_timer_interval mod 1000000 to var tv_nsec
which is based on nanosecond.
Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com> Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Jonathan Rajotte [Fri, 16 Oct 2015 23:08:29 +0000 (19:08 -0400)]
Select which binaries/extras to build at configure time
Introduce new flags to the configure script to select what to build:
* By default everything is built *
--disable-bin-lttng
Do not build anything under src/bin/lttng.
--disable-bin-lttng-consumerd
Do not build anything under src/bin/lttng-consumerd.
--disable-bin-lttng-crash
Do not build anything under src/bin/lttng-crash.
--disable-bin-lttng-relayd
Do not build anything under src/bin/lttng-relayd.
--disable-bin-lttng-sessiond
Do not build anything under src/bin/lttng-sessiond.
--disable-extras
Do not build anything under extras.
Only the necessary libs (from src/lib and src/common) are built.
libcommon and libconfig are always built since they are used by every
target.
If any lttng-* binaries are disabled, 'tests' will not be built.
On ./configure a warning is shown to the user.
Also 'make check' and 'make checkinstall' only return a warning when 'tests'
are not built.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>