Improve observability of checkForLttngTools for debugging
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 14 Jan 2022 20:36:24 +0000 (15:36 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 14 Jan 2022 20:36:55 +0000 (15:36 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
lttng-tools-java/src/main/java/org/lttng/tools/utils/ShellUtils.java
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/utils/LttngUtils.java

index eb94c20aba6f4a2ed7ed7ab69768419bc2fcb693..112d5d416f16c072c57dea597200aaf583e6a22c 100644 (file)
@@ -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);
 
index 884d69c2d0fdc3a4af36010e56191d8a4dd65120..2be57f373994a667cb7afb092c7cabcba2deffa9 100644 (file)
@@ -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<String> 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());
         }
     }
This page took 0.025052 seconds and 4 git commands to generate.