tests: compile some tools/tests as C++ These tests use things from the common libs, or at least include header files from src/common. These files are going to contain C++-specific things in a following commit, so it's easier if we compile them tools/tests as C++. Change-Id: Ib99f2373beb414c50eaa10b35e0d895bc37e4e64 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Cleanup: always use sysconf to get the page size Use 'sysconf(_SC_PAGE_SIZE)' across the code base which is works on all our supported platforms. Change-Id: I4231d45e0b03301de1274c0a5a4903cd17b4a80a Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tests: Cleanup: gen-syscall-events: remove duplicated help line Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: Id5bc54598f8abf7498f3b81064a83c60379922d6
testapp: gen-syscall-events: use dynamic paths provided via args This is to try and mitigate the limitation found here: https://bugs.lttng.org/issues/1261 Using an argument ensures that the path is not in the .rodata section of the executable and reduces the chance that the kernel tracer incurs a page fault when attempting to serialize the path argument. The path is pre-faulted to mitigate the problem described in #1261. Fixes #1261 Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I6b6173ee5d8b33dcdf1cc391db9d1eafe00f90b9 Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479
Tests: gen-syscall-events: generate 2 events of each type for filtering Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I4803fb2e465d1865f0130b7546ee871b6752a226 Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479
tests: Move to kernel style SPDX license identifiers The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. See https://spdx.org/ids-how for details. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Change-Id: I89cd4b4b7440f71f52426a5508252932bb46e796 Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tests: Fix: arm64 use sys_openat instead of sys_open gen-syscall-events is failing to build on arm64 because of the following error: ``` gen-syscall-events.c: In function ‘main’: gen-syscall-events.c:35:15: error: ‘SYS_open’ undeclared (first use in this function) fd = syscall(SYS_open, "/proc/cpuinfo", O_RDONLY); ``` SYS_open is not available using the syscall(2) arm64 glibc function. SYS_openat should be used instead. Change test app and test cases to use SYS_openat. Other projects have encountered the same issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758521 https://bugs.launchpad.net/linaro-aarch64/+bug/1100782 Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Tests: Change syscall tests to use `gen-syscall-events` testapp Use `gen-syscall-events` testapp in conjuction with the LTTng PID tracker to improve the reliability of the syscall tracing tests by only tracing the test app's activity. Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tests: Add test app to generate syscalls This app launches and waits for the creation of a file specified in the arguments before executing syscalls. This can be used with the PID tracker feature of LTTng to only trace the syscalls made by the test process and thus makes the tests more reliable. Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>