AM_CONDITIONAL([BUILD_LIB_TESTPOINT], [test x$build_lib_testpoint = xyes])
AM_CONDITIONAL([BUILD_LIB_UST_CONSUMER], [test x$build_lib_ust_consumer = xyes])
+# check for pgrep
+AC_PATH_PROG([PGREP], [pgrep], [no])
+AM_CONDITIONAL([HAS_PGREP], [test "x$PGREP" != "xno"])
+
if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-parser.h"; then
if test x"$(basename "$YACC")" != "xbison -y"; then
AC_MSG_ERROR([[bison not found and is required when building from git.
installcheck-am:
if BUILD_TESTS
+if HAS_PGREP
+ ./utils/warn_lttng_processes.sh $(PGREP)
+endif
./run.sh unit_tests
./run.sh fast_regression
if PYTHON_BINDING
check-am:
if BUILD_TESTS
+if HAS_PGREP
+ ./utils/warn_lttng_processes.sh $(PGREP)
+endif
./run.sh unit_tests
./run.sh fast_regression
if PYTHON_BINDING
SUBDIRS = tap testapp
-EXTRA_DIST = utils.sh test_utils.py babelstats.pl
-dist_noinst_SCRIPTS = utils.sh test_utils.py babelstats.pl
+EXTRA_DIST = utils.sh test_utils.py babelstats.pl warn_lttng_processes.sh
+dist_noinst_SCRIPTS = utils.sh test_utils.py babelstats.pl warn_lttng_processes.sh
all-local:
@if [ x"$(srcdir)" != x"$(builddir)" ]; then \
--- /dev/null
+#!/bin/bash
+
+if [ x$LTTNG_TOOLS_TESTS_DISABLE_WARN_LTTNG_PROCESSES == x1 ]; then
+ exit
+fi
+
+color_warn='\E[1;33m'
+color_reset='\E[0m'
+color_bold='\E[1m'
+
+lttng_processes="$("$1" 'lttng|gen-ust-.+' -a | grep -v "$(basename "$0")")"
+
+if [ $? -eq 0 ]; then
+ pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')"
+
+ echo -e "${color_warn}Warning: the following LTTng processes were detected running on the system:$color_reset"
+ echo
+ echo "$lttng_processes"
+ echo
+ echo -e "Here's how to kill them: ${color_bold}kill -9 $pids$color_reset"
+ echo -e "${color_warn}If you leave them alive, some tests could fail.$color_reset"
+ echo
+fi