From 7dcd53abdbb09620295366872b6cbf553c02086c Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 14 Jan 2022 15:36:24 -0500 Subject: [PATCH] Improve observability of checkForLttngTools for debugging Signed-off-by: Jonathan Rajotte --- .../src/main/java/org/lttng/tools/utils/ShellUtils.java | 2 +- .../src/main/java/org/lttng/ust/agent/utils/LttngUtils.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lttng-tools-java/src/main/java/org/lttng/tools/utils/ShellUtils.java b/lttng-tools-java/src/main/java/org/lttng/tools/utils/ShellUtils.java index eb94c20..112d5d4 100644 --- a/lttng-tools-java/src/main/java/org/lttng/tools/utils/ShellUtils.java +++ b/lttng-tools-java/src/main/java/org/lttng/tools/utils/ShellUtils.java @@ -69,7 +69,7 @@ public final class ShellUtils { Process p = builder.start(); int ret = p.waitFor(); - System.out.println("(returned from command)"); + System.out.println(String.format("(returned from command: %d)", ret)); return (ret == 0); diff --git a/lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/utils/LttngUtils.java b/lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/utils/LttngUtils.java index 884d69c..2be57f3 100644 --- a/lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/utils/LttngUtils.java +++ b/lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/utils/LttngUtils.java @@ -44,6 +44,7 @@ public final class LttngUtils { * was an error */ public static boolean checkForLttngTools(Domain domain) { + System.out.println("Sanity check: start"); try (ILttngSession session = ILttngSession.createSession(null, domain)) { boolean ret1 = session.enableAllEvents(); boolean ret2 = session.start(); @@ -52,6 +53,10 @@ public final class LttngUtils { * "lttng view" also tests that Babeltrace is installed and working */ List contents = session.view(); + if (!contents.isEmpty()) { + System.out.print(String.join("\n", contents)); + } + System.out.println("Sanity check: end"); return (ret1 && ret2 && ret3 && contents.isEmpty()); } } -- 2.34.1