1 /**********************************************************************
2 * Copyright (c) 2013 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Matthew Khouzam - Initial API and implementation
11 **********************************************************************/
13 package org
.eclipse
.linuxtools
.lttng2
.ust
.core
.trace
;
15 import org
.eclipse
.core
.resources
.IProject
;
16 import org
.eclipse
.core
.runtime
.IStatus
;
17 import org
.eclipse
.core
.runtime
.Status
;
18 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFReaderException
;
19 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFTrace
;
20 import org
.eclipse
.linuxtools
.internal
.lttng2
.ust
.core
.Activator
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.ctfadaptor
.CtfTmfTrace
;
24 * Class to contain LTTng-UST traces
26 * @author Matthew Khouzam
29 public class LttngUstTrace
extends CtfTmfTrace
{
34 public LttngUstTrace() {
39 public IStatus
validate(final IProject project
, final String path
) {
42 /* Make sure the trace is openable as a CTF trace. */
44 temp
= new CTFTrace(path
);
45 } catch (CTFReaderException e
) {
46 status
= new Status(IStatus
.ERROR
, Activator
.PLUGIN_ID
, e
.toString(), e
);
48 } catch (NullPointerException e
){
49 status
= new Status(IStatus
.ERROR
, Activator
.PLUGIN_ID
, e
.toString(), e
);
53 /* Make sure the domain is "ust" in the trace's env vars */
54 String dom
= temp
.getEnvironment().get("domain"); //$NON-NLS-1$
56 if (dom
!= null && dom
.equals("\"ust\"")) { //$NON-NLS-1$
57 return Status
.OK_STATUS
;
59 status
= new Status(IStatus
.ERROR
, Activator
.PLUGIN_ID
, Messages
.LttngUstTrace_DomainError
);