Skip to content

Commit

Permalink
Change LttngUstTrace to validate as a CTFValidationStatus
Browse files Browse the repository at this point in the history
This passes the declared event types and environment to children traces.

Signed-off-by: Reza Rouhghalandari <[email protected]>
  • Loading branch information
Rezix93 authored and arfio committed Jul 31, 2024
1 parent 51bd764 commit c8509f5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
import org.eclipse.tracecompass.tmf.core.trace.TmfEventTypeCollectionHelper;
import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus;
import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEventFactory;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTraceValidationStatus;
Expand Down Expand Up @@ -187,13 +186,14 @@ public Iterable<ITmfEventAspect<?>> getEventAspects() {
public IStatus validate(final IProject project, final String path) {
IStatus status = super.validate(project, path);
if (status instanceof CtfTraceValidationStatus) {
Map<String, String> environment = ((CtfTraceValidationStatus) status).getEnvironment();
CtfTraceValidationStatus ctfTraceValidationStatus = (CtfTraceValidationStatus) status;
Map<String, String> environment = ctfTraceValidationStatus.getEnvironment();
/* Make sure the domain is "ust" in the trace's env vars */
String domain = environment.get("domain"); //$NON-NLS-1$
if (domain == null || !domain.equals("\"ust\"")) { //$NON-NLS-1$
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngUstTrace_DomainError);
return Status.error(Messages.LttngUstTrace_DomainError);
}
return new TraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID);
return new CtfTraceValidationStatus(CONFIDENCE, Activator.PLUGIN_ID, environment, ctfTraceValidationStatus.getEventNames() );
}
return status;
}
Expand Down

0 comments on commit c8509f5

Please sign in to comment.