package org.eclipse.linuxtools.lttng2.kernel.core.trace;
import java.io.File;
+import java.nio.BufferOverflowException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IStatus;
} catch (NullPointerException e){
validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.toString(), e);
return validStatus;
+ } catch (final BufferOverflowException e) {
+ validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.LttngKernelTrace_TraceReadError + ": " + Messages.LttngKernelTrace_MalformedTrace); //$NON-NLS-1$
+ return validStatus;
}
/* Make sure the domain is "kernel" in the trace's env vars */
* The domain is not "kernel"
*/
public static String LttngKernelTrace_DomainError;
+ /**
+ * Malformed trace (buffer overflow maybe?)
+ * @since 2.1
+ */
+ public static String LttngKernelTrace_MalformedTrace;
+ /**
+ * Trace read error
+ * @since 2.1
+ */
+ public static String LttngKernelTrace_TraceReadError;
static {
// initialize resource bundle
###############################################################################
LttngKernelTrace_DomainError=Domain mismatch, the environment should be 'kernel'.
+LttngKernelTrace_MalformedTrace=Buffer overflow exception, trace is malformed
+LttngKernelTrace_TraceReadError=Lttng trace read error
package org.eclipse.linuxtools.tmf.core.ctfadaptor;
+import java.nio.BufferOverflowException;
import java.util.Collections;
import java.util.Map;
temp.dispose();
} catch (final CTFReaderException e) {
validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError +": " + e.toString()); //$NON-NLS-1$
+ } catch (final BufferOverflowException e){
+ validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError +": " + Messages.CtfTmfTrace_BufferOverflowErrorMessage); //$NON-NLS-1$
}
+
return validTrace;
}
private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.core.ctfadaptor.messages"; //$NON-NLS-1$
+ /** Buffer overflow detected
+ * @since 2.1*/
+ public static String CtfTmfTrace_BufferOverflowErrorMessage;
+
/** Major version number not set */
public static String CtfTmfTrace_MajorNotSet;
# Ericsson - Initial API and implementation
###############################################################################
+CtfTmfTrace_BufferOverflowErrorMessage=Buffer overflow exception, trace is malformed
CtfTmfTrace_MajorNotSet=Major version number not set
CtfTmfTrace_ReadingError=Reading error
CtfTmfTrace_NoEvent=Trace has no events
\ No newline at end of file