Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Version: 1.4.1.qualifier
Bundle-Version: 1.5.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.control.ui;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.lttng2.control.ui.Activator
Expand Down Expand Up @@ -42,6 +42,7 @@ Export-Package: org.eclipse.tracecompass.internal.lttng2.control.ui;x-friends:="
org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests,org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests",
org.eclipse.tracecompass.internal.lttng2.control.ui.views.preferences;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
org.eclipse.tracecompass.internal.lttng2.control.ui.views.property;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests",
org.eclipse.tracecompass.internal.lttng2.control.ui.views.service;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests,org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests"
org.eclipse.tracecompass.internal.lttng2.control.ui.views.service;x-friends:="org.eclipse.tracecompass.lttng2.control.ui.tests,org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests",
org.eclipse.tracecompass.lttng2.control.ui.views.signals
Import-Package: com.google.common.collect
Automatic-Module-Name: org.eclipse.tracecompass.lttng2.control.ui
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@

import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
import org.eclipse.tracecompass.lttng2.control.ui.views.signals.ExternalTraceStartSignal;
import org.eclipse.tracecompass.lttng2.control.ui.views.signals.LTTngSessionStartSignal;
import org.eclipse.tracecompass.lttng2.control.ui.views.signals.LTTngSessionStopSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;

/**
* <p>
Expand All @@ -27,6 +34,20 @@
*/
public class StartHandler extends ChangeSessionStateHandler {

/**
* Constructor
*/
public StartHandler() {
super();
TmfSignalManager.register(this);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

@Override
public void dispose() {
TmfSignalManager.deregister(this);
super.dispose();
}

// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
Expand All @@ -43,5 +64,35 @@ public TraceSessionState getNewState() {
@Override
public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException {
session.startSession(monitor);
TmfSignalManager.dispatchSignal(
new LTTngSessionStartSignal(session));
}

/**
* Handle the external trace start signal
* @param signal contains the information of the start external trace
*/
@TmfSignalHandler
public void handle(ExternalTraceStartSignal signal) {
Display.getDefault().asyncExec(() -> {
try {
execute(null);
} catch (ExecutionException e) {
Activator.getDefault().logError("Failed to synchronize with the external trace start signal", e); //$NON-NLS-1$
}
});
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

/**
* Handle the LTTng session stop signal
* @param signal contains the information of the stop LTTng session
*/
@TmfSignalHandler
public void handle(LTTngSessionStopSignal signal) {
Display.getDefault().asyncExec(() -> {
if (signal.getSource() instanceof TraceSessionComponent session && !this.fSessions.contains(session)) {
this.fSessions.add(session);
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@

import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
import org.eclipse.tracecompass.lttng2.control.ui.views.signals.ExternalTraceStopSignal;
import org.eclipse.tracecompass.lttng2.control.ui.views.signals.LTTngSessionStartSignal;
import org.eclipse.tracecompass.lttng2.control.ui.views.signals.LTTngSessionStopSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;

/**
* <p>
Expand All @@ -27,6 +34,20 @@
*/
public class StopHandler extends ChangeSessionStateHandler {

/**
* Constructor
*/
public StopHandler() {
super();
TmfSignalManager.register(this);
}

@Override
public void dispose() {
TmfSignalManager.deregister(this);
super.dispose();
}

// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
Expand All @@ -43,5 +64,35 @@ public TraceSessionState getNewState() {
@Override
public void changeState(TraceSessionComponent session, IProgressMonitor monitor) throws ExecutionException {
session.stopSession(monitor);
TmfSignalManager.dispatchSignal(
new LTTngSessionStopSignal(session));
}

/**
* Handle the external trace stop signal
* @param signal contains the information of the stop external trace
*/
@TmfSignalHandler
public void handle(ExternalTraceStopSignal signal) {
Display.getDefault().asyncExec(() -> {
try {
execute(null);
} catch (ExecutionException e) {
Activator.getDefault().logError("Failed to synchronize with the external trace stop signal", e); //$NON-NLS-1$
}
});
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

/**
* Handle the LTTng session start signal
* @param signal contains the information of the start LTTng session
*/
@TmfSignalHandler
public void handle(LTTngSessionStartSignal signal) {
Display.getDefault().asyncExec(() -> {
if (signal.getSource() instanceof TraceSessionComponent session && !this.fSessions.contains(session)) {
this.fSessions.add(session);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* Copyright (c) 2026 Renesas Electronics Corp.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Tuan Can - Initial API and implementation
*******************************************************************************/

package org.eclipse.tracecompass.lttng2.control.ui.views.signals;
Comment thread
coderabbitai[bot] marked this conversation as resolved.

import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;

/**
* Signal notify that the External trace have been started
* @since 1.5
*/
public class ExternalTraceStartSignal extends TmfSignal{

private final String sessionName;

/**
* Constructor
* @param source input source
* @param sessionName external trace
*/
public ExternalTraceStartSignal(Object source, String sessionName) {
super(source);
this.sessionName = sessionName;
}

/**
* Get the name of the external trace
* @return External trace name
*/
public String getSessionName() {
return sessionName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* Copyright (c) 2026 Renesas Electronics Corp.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Tuan Can - Initial API and implementation
*******************************************************************************/

package org.eclipse.tracecompass.lttng2.control.ui.views.signals;

import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;

/**
* Signal notify that the External trace have been stopped
* @since 1.5
*/
public class ExternalTraceStopSignal extends TmfSignal{

private final String sessionName;

/**
* Constructor
* @param source input source
* @param sessionName external trace
*/
public ExternalTraceStopSignal(Object source, String sessionName) {
super(source);
this.sessionName = sessionName;
}

/**
* Get the name of the external trace
* @return External trace name
*/
public String getSessionName() {
return sessionName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* Copyright (c) 2026 Renesas Electronics Corp.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Tuan Can - Initial API and implementation
*******************************************************************************/

package org.eclipse.tracecompass.lttng2.control.ui.views.signals;

import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;

/**
* Signal notify that the LTTng session have been destroyed
* @since 1.5
*/
public class LTTngSessionDestroySignal extends TmfSignal{

private final String sessionName;

/**
* Constructor
* @param source input source
* @param sessionName LTTng session name
*/
public LTTngSessionDestroySignal(Object source, String sessionName) {
super(source);
this.sessionName = sessionName;
}

/**
* Get the name of the LTTng session
* @return LTTng session name
*/
public String getSessionName() {
return sessionName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*******************************************************************************
* Copyright (c) 2026 Renesas Electronics Corp.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Tuan Can - Initial API and implementation
*******************************************************************************/

package org.eclipse.tracecompass.lttng2.control.ui.views.signals;

import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;

/**
* Signal notify that the LTTng session have been started
* @since 1.5
*/
public class LTTngSessionStartSignal extends TmfSignal{


/**
* Constructor
* @param source input source
*/
public LTTngSessionStartSignal(Object source) {
super(source);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2026 Renesas Electronics Corp.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Tuan Can - Initial API and implementation
*******************************************************************************/

package org.eclipse.tracecompass.lttng2.control.ui.views.signals;

import org.eclipse.tracecompass.tmf.core.signal.TmfSignal;

/**
* Signal notify that the LTTng session have been stopped
* @since 1.5
*/
public class LTTngSessionStopSignal extends TmfSignal{

/**
* Constructor
* @param source input source
*/
public LTTngSessionStopSignal(Object source) {
super(source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,4 @@ private static void toggleFilters(boolean checked) {

shell.bot().button(APPLY_BUTTON).click();
}
}
}
Loading