From 97fe0bc3ed887495a146904d175e4e041ad331b3 Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Thu, 17 Mar 2016 11:27:22 -0400 Subject: [PATCH] control: Bug 489857: Fix live mode support for LTTng 2.4 Live streaming was added in 2.4.x. Since we can't retrieve whether a session is live or not from a 2.4.x node, we copy the information over from the session information at session creation time. Note that this information gets lost when the user presses the refresh button or restarts or Trace Compass. For LTTng 2.5.0 and later it's possible to retrieve this information. So we don't need copy this at creation time. This will make sure that the session is recognized as live after a Trace Compass restart or a refresh. Change-Id: I4f07e0502de9c858a614946640305fbbcc8c27f6 Signed-off-by: Bernd Hufmann Reviewed-on: https://git.eclipse.org/r/68685 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle Tested-by: Marc-Andre Laperle Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann --- .../META-INF/MANIFEST.MF | 2 +- .../model/impl/TraceSessionComponent.java | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/META-INF/MANIFEST.MF b/lttng/org.eclipse.tracecompass.lttng2.control.ui/META-INF/MANIFEST.MF index 17c9d679d1..0e963d6a68 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/META-INF/MANIFEST.MF +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-Vendor: %Bundle-Vendor -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.1.qualifier Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.control.ui;singleton:=true Bundle-Activator: org.eclipse.tracecompass.internal.lttng2.control.ui.Activator diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java index 32de99024f..f681545cfa 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceSessionComponent.java @@ -108,13 +108,32 @@ public class TraceSessionComponent extends TraceControlComponent { } private void copyLiveInfo(ISessionInfo sessionInfo) { - // Since we can't retrieve this information from the node, we copy it over + /* + * Since we can't retrieve this live port and URL from the node, we + * copy it over. Note that this information gets lost when the user + * presses the refresh button or restarts or Trace Compass. + */ if (sessionInfo.getLivePort() != null) { fSessionInfo.setLivePort(sessionInfo.getLivePort()); } if (sessionInfo.getLiveUrl() != null) { fSessionInfo.setLiveUrl(sessionInfo.getLiveUrl()); } + + /* + * Live streaming has been added in 2.4.x. Since we can't retrieve + * whether a session is live or not from a 2.4.x node, we copy it over. + * Note that this information gets lost when the user presses the + * refresh button or restarts or Trace Compass. + * + * For LTTng 2.5.0 and later it's possible to retrieve this information. + * So we don't need to copy this over be set here. This will make sure + * that the session is recognized as live after a Trace Compass restart + * or a refresh. + */ + if (!getTargetNode().isVersionSupported("2.5.0")) { //$NON-NLS-1$ + fSessionInfo.setLive(sessionInfo.isLive()); + } } // ------------------------------------------------------------------------ -- 2.34.1