1 /*******************************************************************************
2 * Copyright (c) 2010, 2016 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 * Patrick Tasse - Initial API and implementation
11 * Bernd Hufmann - Add trace type id handling
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.core
.parsers
.custom
;
16 import static org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
.checkNotNull
;
18 import java
.io
.ByteArrayInputStream
;
20 import java
.io
.IOException
;
21 import java
.io
.RandomAccessFile
;
22 import java
.nio
.ByteBuffer
;
24 import javax
.xml
.parsers
.DocumentBuilder
;
25 import javax
.xml
.parsers
.DocumentBuilderFactory
;
26 import javax
.xml
.parsers
.ParserConfigurationException
;
28 import org
.eclipse
.core
.resources
.IProject
;
29 import org
.eclipse
.core
.resources
.IResource
;
30 import org
.eclipse
.core
.runtime
.IStatus
;
31 import org
.eclipse
.core
.runtime
.Status
;
32 import org
.eclipse
.jdt
.annotation
.NonNull
;
33 import org
.eclipse
.tracecompass
.internal
.tmf
.core
.Activator
;
34 import org
.eclipse
.tracecompass
.internal
.tmf
.core
.parsers
.custom
.CustomEventAspects
;
35 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
36 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEventField
;
37 import org
.eclipse
.tracecompass
.tmf
.core
.event
.aspect
.ITmfEventAspect
;
38 import org
.eclipse
.tracecompass
.tmf
.core
.exceptions
.TmfTraceException
;
39 import org
.eclipse
.tracecompass
.tmf
.core
.io
.BufferedRandomAccessFile
;
40 import org
.eclipse
.tracecompass
.tmf
.core
.parsers
.custom
.CustomTraceDefinition
.Tag
;
41 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfSignalHandler
;
42 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfTraceRangeUpdatedSignal
;
43 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.TmfTimestamp
;
44 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfContext
;
45 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfContext
;
46 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTrace
;
47 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTraceUtils
;
48 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TraceValidationStatus
;
49 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.ITmfPersistentlyIndexable
;
50 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.ITmfTraceIndexer
;
51 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.TmfBTreeTraceIndexer
;
52 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.checkpoint
.ITmfCheckpoint
;
53 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.checkpoint
.TmfCheckpoint
;
54 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.location
.ITmfLocation
;
55 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.location
.TmfLongLocation
;
56 import org
.w3c
.dom
.Document
;
57 import org
.w3c
.dom
.Element
;
58 import org
.w3c
.dom
.Node
;
59 import org
.w3c
.dom
.NodeList
;
60 import org
.xml
.sax
.EntityResolver
;
61 import org
.xml
.sax
.ErrorHandler
;
62 import org
.xml
.sax
.InputSource
;
63 import org
.xml
.sax
.SAXException
;
64 import org
.xml
.sax
.SAXParseException
;
67 * Trace object for custom XML trace parsers.
69 * @author Patrick Tassé
71 public class CustomXmlTrace
extends TmfTrace
implements ITmfPersistentlyIndexable
{
73 private static final TmfLongLocation NULL_LOCATION
= new TmfLongLocation(-1L);
74 private static final int DEFAULT_CACHE_SIZE
= 100;
75 private static final int MAX_LINES
= 100;
76 private static final int CONFIDENCE
= 100;
78 private final CustomXmlTraceDefinition fDefinition
;
79 private final ITmfEventField fRootField
;
80 private final CustomXmlInputElement fRecordInputElement
;
81 private BufferedRandomAccessFile fFile
;
82 private final @NonNull String fTraceTypeId
;
84 private static final char SEPARATOR
= ':';
85 private static final String CUSTOM_XML_TRACE_TYPE_PREFIX
= "custom.xml.trace" + SEPARATOR
; //$NON-NLS-1$
86 private static final String LINUX_TOOLS_CUSTOM_XML_TRACE_TYPE_PREFIX
= "org.eclipse.linuxtools.tmf.core.parsers.custom.CustomXmlTrace" + SEPARATOR
; //$NON-NLS-1$
87 private static final String EARLY_TRACE_COMPASS_CUSTOM_XML_TRACE_TYPE_PREFIX
= "org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTrace" + SEPARATOR
; //$NON-NLS-1$
95 public CustomXmlTrace(final CustomXmlTraceDefinition definition
) {
96 fDefinition
= definition
;
97 fRootField
= CustomEventType
.getRootField(definition
);
98 fRecordInputElement
= getRecordInputElement(fDefinition
.rootInputElement
);
99 fTraceTypeId
= buildTraceTypeId(definition
.categoryName
, definition
.definitionName
);
100 setCacheSize(DEFAULT_CACHE_SIZE
);
111 * Path to the trace/log file
114 * @throws TmfTraceException
115 * If the trace/log couldn't be opened
117 public CustomXmlTrace(final IResource resource
,
118 final CustomXmlTraceDefinition definition
, final String path
,
119 final int pageSize
) throws TmfTraceException
{
121 setCacheSize((pageSize
> 0) ? pageSize
: DEFAULT_CACHE_SIZE
);
122 initTrace(resource
, path
, CustomXmlEvent
.class);
126 public void initTrace(final IResource resource
, final String path
, final Class
<?
extends ITmfEvent
> eventType
) throws TmfTraceException
{
127 super.initTrace(resource
, path
, eventType
);
131 private void initFile() throws TmfTraceException
{
134 fFile
= new BufferedRandomAccessFile(getPath(), "r"); //$NON-NLS-1$
135 } catch (IOException e
) {
136 throw new TmfTraceException(e
.getMessage(), e
);
141 public synchronized void dispose() {
146 private void closeFile() {
150 } catch (IOException e
) {
158 public ITmfTraceIndexer
getIndexer() {
159 return super.getIndexer();
163 public Iterable
<ITmfEventAspect
<?
>> getEventAspects() {
164 return CustomEventAspects
.generateAspects(fDefinition
);
168 public synchronized TmfContext
seekEvent(final ITmfLocation location
) {
169 final CustomXmlTraceContext context
= new CustomXmlTraceContext(NULL_LOCATION
, ITmfContext
.UNKNOWN_RANK
);
170 if (NULL_LOCATION
.equals(location
) || fFile
== null) {
174 if (location
== null) {
176 } else if (location
.getLocationInfo() instanceof Long
) {
177 fFile
.seek((Long
) location
.getLocationInfo());
179 long rawPos
= fFile
.getFilePointer();
180 String line
= fFile
.getNextLine();
181 while (line
!= null) {
182 final int idx
= indexOfElement(fRecordInputElement
.getElementName(), line
, 0);
184 context
.setLocation(new TmfLongLocation(rawPos
+ idx
));
187 rawPos
= fFile
.getFilePointer();
188 line
= fFile
.getNextLine();
191 } catch (final IOException e
) {
192 Activator
.logError("Error seeking event. File: " + getPath(), e
); //$NON-NLS-1$
199 public synchronized TmfContext
seekEvent(final double ratio
) {
201 return new CustomTxtTraceContext(NULL_LOCATION
, ITmfContext
.UNKNOWN_RANK
);
204 long pos
= Math
.round(ratio
* fFile
.length());
207 if (fFile
.read() == '\n') {
212 final ITmfLocation location
= new TmfLongLocation(pos
);
213 final TmfContext context
= seekEvent(location
);
214 context
.setRank(ITmfContext
.UNKNOWN_RANK
);
216 } catch (final IOException e
) {
217 Activator
.logError("Error seeking event. File: " + getPath(), e
); //$NON-NLS-1$
218 return new CustomXmlTraceContext(NULL_LOCATION
, ITmfContext
.UNKNOWN_RANK
);
223 public synchronized double getLocationRatio(final ITmfLocation location
) {
228 if (location
.getLocationInfo() instanceof Long
) {
229 return ((Long
) location
.getLocationInfo()).doubleValue() / fFile
.length();
231 } catch (final IOException e
) {
232 Activator
.logError("Error getting location ration. File: " + getPath(), e
); //$NON-NLS-1$
238 public ITmfLocation
getCurrentLocation() {
239 // TODO Auto-generated method stub
244 public synchronized CustomXmlEvent
parseEvent(final ITmfContext tmfContext
) {
245 ITmfContext context
= seekEvent(tmfContext
.getLocation());
246 return parse(context
);
250 public synchronized CustomXmlEvent
getNext(final ITmfContext context
) {
251 final ITmfContext savedContext
= new TmfContext(context
.getLocation(), context
.getRank());
252 final CustomXmlEvent event
= parse(context
);
254 updateAttributes(savedContext
, event
);
255 context
.increaseRank();
260 private synchronized CustomXmlEvent
parse(final ITmfContext tmfContext
) {
264 if (!(tmfContext
instanceof CustomXmlTraceContext
)) {
268 final CustomXmlTraceContext context
= (CustomXmlTraceContext
) tmfContext
;
269 ITmfLocation location
= context
.getLocation();
270 if (location
== null || !(location
.getLocationInfo() instanceof Long
) || NULL_LOCATION
.equals(location
)) {
274 CustomXmlEvent event
= null;
276 // Below +1 for the <
277 if (fFile
.getFilePointer() != (Long
) location
.getLocationInfo() + 1) {
278 fFile
.seek((Long
) location
.getLocationInfo() + 1);
280 final StringBuffer elementBuffer
= new StringBuffer("<"); //$NON-NLS-1$
281 readElement(elementBuffer
, fFile
);
282 final Element element
= parseElementBuffer(elementBuffer
);
284 event
= extractEvent(element
, fRecordInputElement
);
285 ((StringBuffer
) event
.getContentValue()).append(elementBuffer
);
287 long rawPos
= fFile
.getFilePointer();
288 String line
= fFile
.getNextLine();
289 while (line
!= null) {
290 final int idx
= indexOfElement(fRecordInputElement
.getElementName(), line
, 0);
292 context
.setLocation(new TmfLongLocation(rawPos
+ idx
));
295 rawPos
= fFile
.getFilePointer();
296 line
= fFile
.getNextLine();
298 } catch (final IOException e
) {
299 Activator
.logError("Error parsing event. File: " + getPath(), e
); //$NON-NLS-1$
302 context
.setLocation(NULL_LOCATION
);
306 private Element
parseElementBuffer(final StringBuffer elementBuffer
) {
308 final DocumentBuilderFactory dbf
= DocumentBuilderFactory
.newInstance();
309 final DocumentBuilder db
= dbf
.newDocumentBuilder();
311 // The following allows xml parsing without access to the dtd
312 final EntityResolver resolver
= new EntityResolver() {
314 public InputSource
resolveEntity(final String publicId
, final String systemId
) {
315 final String empty
= ""; //$NON-NLS-1$
316 final ByteArrayInputStream bais
= new ByteArrayInputStream(empty
.getBytes());
317 return new InputSource(bais
);
320 db
.setEntityResolver(resolver
);
322 // The following catches xml parsing exceptions
323 db
.setErrorHandler(new ErrorHandler() {
325 public void error(final SAXParseException saxparseexception
) throws SAXException
{
329 public void warning(final SAXParseException saxparseexception
) throws SAXException
{
333 public void fatalError(final SAXParseException saxparseexception
) throws SAXException
{
334 throw saxparseexception
;
338 final Document doc
= db
.parse(new ByteArrayInputStream(elementBuffer
.toString().getBytes()));
339 return doc
.getDocumentElement();
340 } catch (final ParserConfigurationException e
) {
341 Activator
.logError("Error parsing element buffer. File:" + getPath(), e
); //$NON-NLS-1$
342 } catch (final SAXException e
) {
343 Activator
.logError("Error parsing element buffer. File:" + getPath(), e
); //$NON-NLS-1$
344 } catch (final IOException e
) {
345 Activator
.logError("Error parsing element buffer. File: " + getPath(), e
); //$NON-NLS-1$
350 private static int indexOfElement(String elementName
, String line
, int fromIndex
) {
351 final String recordElementStart
= '<' + elementName
;
352 int index
= line
.indexOf(recordElementStart
, fromIndex
);
356 int nextCharIndex
= index
+ recordElementStart
.length();
357 if (nextCharIndex
< line
.length()) {
358 char c
= line
.charAt(nextCharIndex
);
359 // Check that the match is not just a substring of another element
360 if (Character
.isLetterOrDigit(c
)) {
361 return indexOfElement(elementName
, line
, nextCharIndex
);
367 private void readElement(final StringBuffer buffer
, final RandomAccessFile raFile
) {
370 boolean startTagClosed
= false;
372 while ((i
= raFile
.read()) != -1) {
374 final char c
= (char) i
;
377 readQuote(buffer
, raFile
, '"');
378 } else if (c
== '\'') {
379 readQuote(buffer
, raFile
, '\'');
380 } else if (c
== '<') {
381 readElement(buffer
, raFile
);
382 } else if (c
== '/' && numRead
== 1) {
384 } else if (c
== '-' && numRead
== 3 && buffer
.substring(buffer
.length() - 3, buffer
.length() - 1).equals("!-")) { //$NON-NLS-1$
385 readComment(buffer
, raFile
); // found "<!--"
386 } else if (i
== '>') {
387 if (buffer
.charAt(buffer
.length() - 2) == '/') {
389 } else if (startTagClosed
) {
390 break; // found "<...>...</...>"
393 startTagClosed
= true; // found "<...>"
398 } catch (final IOException e
) {
403 private static void readQuote(final StringBuffer buffer
,
404 final RandomAccessFile raFile
, final char eq
) {
407 while ((i
= raFile
.read()) != -1) {
408 final char c
= (char) i
;
412 break; // found matching end-quote
416 } catch (final IOException e
) {
421 private static void readComment(final StringBuffer buffer
,
422 final RandomAccessFile raFile
) {
426 while ((i
= raFile
.read()) != -1) {
428 final char c
= (char) i
;
430 if (c
== '>' && numRead
>= 2 && buffer
.substring(buffer
.length() - 3, buffer
.length() - 1).equals("--")) //$NON-NLS-1$
432 break; // found "-->"
436 } catch (final IOException e
) {
442 * Parse an XML element.
444 * @param parentElement
447 * The contents to parse
448 * @return The parsed content
450 public static StringBuffer
parseElement(final Element parentElement
, final StringBuffer buffer
) {
451 final NodeList nodeList
= parentElement
.getChildNodes();
452 String separator
= null;
453 for (int i
= 0; i
< nodeList
.getLength(); i
++) {
454 final Node node
= nodeList
.item(i
);
455 short nodeType
= node
.getNodeType();
456 if (nodeType
== Node
.ELEMENT_NODE
) {
457 if (separator
== null) {
458 separator
= " | "; //$NON-NLS-1$
460 buffer
.append(separator
);
462 final Element element
= (Element
) node
;
463 if (!element
.hasChildNodes()) {
464 buffer
.append(element
.getNodeName());
465 } else if (element
.getChildNodes().getLength() == 1 && element
.getFirstChild().getNodeType() == Node
.TEXT_NODE
) {
466 buffer
.append(element
.getNodeName());
468 buffer
.append(element
.getFirstChild().getNodeValue().trim());
470 buffer
.append(element
.getNodeName());
471 buffer
.append(" [ "); //$NON-NLS-1$
472 parseElement(element
, buffer
);
473 buffer
.append(" ]"); //$NON-NLS-1$
475 } else if ((nodeType
== Node
.TEXT_NODE
) && (!node
.getNodeValue().trim().isEmpty())) {
476 buffer
.append(node
.getNodeValue().trim());
483 * Get an input element if it is a valid record input. If not, we will look
484 * into its children for valid inputs.
486 * @param inputElement
487 * The main element to check for.
488 * @return The record element
490 public CustomXmlInputElement
getRecordInputElement(final CustomXmlInputElement inputElement
) {
491 if (inputElement
.isLogEntry()) {
493 } else if (inputElement
.getChildElements() != null) {
494 for (final CustomXmlInputElement childInputElement
: inputElement
.getChildElements()) {
495 final CustomXmlInputElement recordInputElement
= getRecordInputElement(childInputElement
);
496 if (recordInputElement
!= null) {
497 return recordInputElement
;
505 * Extract a trace event from an XML element.
509 * @param inputElement
511 * @return The extracted event
513 public CustomXmlEvent
extractEvent(final Element element
, final CustomXmlInputElement inputElement
) {
514 CustomXmlEventType eventType
= new CustomXmlEventType(checkNotNull(fDefinition
.definitionName
), fRootField
);
515 final CustomXmlEvent event
= new CustomXmlEvent(fDefinition
, this, TmfTimestamp
.ZERO
, eventType
);
516 event
.setContent(new CustomEventContent(event
, new StringBuffer()));
517 parseElement(element
, event
, inputElement
);
521 private void parseElement(final Element element
, final CustomXmlEvent event
, final CustomXmlInputElement inputElement
) {
522 String eventType
= inputElement
.getEventType();
523 if (eventType
!= null && event
.getType() instanceof CustomEventType
) {
524 ((CustomEventType
) event
.getType()).setName(eventType
);
526 if (!inputElement
.getInputTag().equals(Tag
.IGNORE
)) {
527 event
.parseInput(parseElement(element
, new StringBuffer()).toString(), inputElement
.getInputTag(), inputElement
.getInputName(), inputElement
.getInputAction(), inputElement
.getInputFormat());
529 if (inputElement
.getAttributes() != null) {
530 for (final CustomXmlInputAttribute attribute
: inputElement
.getAttributes()) {
531 event
.parseInput(element
.getAttribute(attribute
.getAttributeName()), attribute
.getInputTag(), attribute
.getInputName(), attribute
.getInputAction(), attribute
.getInputFormat());
534 final NodeList childNodes
= element
.getChildNodes();
535 if (inputElement
.getChildElements() != null) {
536 for (int i
= 0; i
< childNodes
.getLength(); i
++) {
537 final Node node
= childNodes
.item(i
);
538 if (node
instanceof Element
) {
539 for (final CustomXmlInputElement child
: inputElement
.getChildElements()) {
540 if (node
.getNodeName().equals(child
.getElementName())) {
541 parseElement((Element
) node
, event
, child
);
552 * Retrieve the trace definition.
554 * @return The trace definition
556 public CustomTraceDefinition
getDefinition() {
563 * The default implementation sets the confidence to 100 if any of the first
564 * 100 lines of the file contains a valid record input element, and 0
568 public IStatus
validate(IProject project
, String path
) {
569 File file
= new File(path
);
570 if (!file
.exists() || !file
.isFile() || !file
.canRead()) {
571 return new Status(IStatus
.ERROR
, Activator
.PLUGIN_ID
, Messages
.CustomTrace_FileNotFound
+ ": " + path
); //$NON-NLS-1$
574 if (!TmfTraceUtils
.isText(file
)) {
575 return new TraceValidationStatus(0, Activator
.PLUGIN_ID
);
577 } catch (IOException e
) {
578 Activator
.logError("Error validating file: " + path
, e
); //$NON-NLS-1$
579 return new Status(IStatus
.ERROR
, Activator
.PLUGIN_ID
, "IOException validating file: " + path
, e
); //$NON-NLS-1$
581 try (BufferedRandomAccessFile rafile
= new BufferedRandomAccessFile(path
, "r")) { //$NON-NLS-1$
584 String line
= rafile
.getNextLine();
585 while ((line
!= null) && (lineCount
++ < MAX_LINES
)) {
586 final int idx
= indexOfElement(fRecordInputElement
.getElementName(), line
, 0);
588 rafile
.seek(rawPos
+ idx
+ 1); // +1 is for the <
589 final StringBuffer elementBuffer
= new StringBuffer("<"); //$NON-NLS-1$
590 readElement(elementBuffer
, rafile
);
591 final Element element
= parseElementBuffer(elementBuffer
);
592 if (element
!= null) {
594 return new TraceValidationStatus(CONFIDENCE
, Activator
.PLUGIN_ID
);
597 rawPos
= rafile
.getFilePointer();
598 line
= rafile
.getNextLine();
600 } catch (IOException e
) {
601 return new Status(IStatus
.ERROR
, Activator
.PLUGIN_ID
, "IOException validating file: " + path
, e
); //$NON-NLS-1$
603 return new TraceValidationStatus(0, Activator
.PLUGIN_ID
);
606 private static int fCheckpointSize
= -1;
609 public synchronized int getCheckpointSize() {
610 if (fCheckpointSize
== -1) {
611 TmfCheckpoint c
= new TmfCheckpoint(TmfTimestamp
.ZERO
, new TmfLongLocation(0L), 0);
612 ByteBuffer b
= ByteBuffer
.allocate(ITmfCheckpoint
.MAX_SERIALIZE_SIZE
);
615 fCheckpointSize
= b
.position();
618 return fCheckpointSize
;
622 public ITmfLocation
restoreLocation(ByteBuffer bufferIn
) {
623 return new TmfLongLocation(bufferIn
);
627 protected ITmfTraceIndexer
createIndexer(int interval
) {
628 return new TmfBTreeTraceIndexer(this, interval
);
632 public String
getTraceTypeId() {
637 * Build the trace type id for a custom XML trace
641 * @param definitionName
642 * the definition name
643 * @return the trace type id
645 public static @NonNull String
buildTraceTypeId(String category
, String definitionName
) {
646 return CUSTOM_XML_TRACE_TYPE_PREFIX
+ category
+ SEPARATOR
+ definitionName
;
650 * Checks whether the given trace type ID is a custom XML trace type ID
653 * the trace type ID to check
654 * @return <code>true</code> if it's a custom text trace type ID else <code>false</code>
656 public static boolean isCustomTraceTypeId(@NonNull String traceTypeId
) {
657 return traceTypeId
.startsWith(CUSTOM_XML_TRACE_TYPE_PREFIX
);
661 * This methods builds a trace type ID from a given ID taking into
662 * consideration any format changes that were done for the IDs of custom
663 * XML traces. For example, such format change took place when moving to
664 * Trace Compass. Trace type IDs that are part of the plug-in extension for
665 * trace types won't be changed.
667 * This method is useful for IDs that were persisted in the workspace before
668 * the format changes (e.g. in the persistent properties of a trace
671 * It ensures backwards compatibility of the workspace for custom XML
675 * the legacy trace type ID
676 * @return the trace type id in Trace Compass format
678 public static @NonNull String
buildCompatibilityTraceTypeId(@NonNull String traceTypeId
) {
679 // Handle early Trace Compass custom XML trace type IDs
680 if (traceTypeId
.startsWith(EARLY_TRACE_COMPASS_CUSTOM_XML_TRACE_TYPE_PREFIX
)) {
681 return CUSTOM_XML_TRACE_TYPE_PREFIX
+ traceTypeId
.substring(EARLY_TRACE_COMPASS_CUSTOM_XML_TRACE_TYPE_PREFIX
.length());
684 // Handle Linux Tools custom XML trace type IDs (with and without category)
685 int index
= traceTypeId
.lastIndexOf(SEPARATOR
);
686 if ((index
!= -1) && (traceTypeId
.startsWith(LINUX_TOOLS_CUSTOM_XML_TRACE_TYPE_PREFIX
))) {
687 String definitionName
= index
< traceTypeId
.length() ? traceTypeId
.substring(index
+ 1) : ""; //$NON-NLS-1$
688 if (traceTypeId
.contains(CustomXmlTrace
.class.getSimpleName() + SEPARATOR
) && traceTypeId
.indexOf(SEPARATOR
) == index
) {
689 return buildTraceTypeId(CustomXmlTraceDefinition
.CUSTOM_XML_CATEGORY
, definitionName
);
691 return CUSTOM_XML_TRACE_TYPE_PREFIX
+ traceTypeId
.substring(LINUX_TOOLS_CUSTOM_XML_TRACE_TYPE_PREFIX
.length());
698 public void traceRangeUpdated(TmfTraceRangeUpdatedSignal signal
) {
699 if (signal
.getTrace() == this) {
701 synchronized (this) {
702 // Reset the file handle in case it has reached the end of the
703 // file already. Otherwise, it will not be able to read new data
704 // pass the previous end.
707 } catch (TmfTraceException e
) {
708 Activator
.logError(e
.getLocalizedMessage(), e
);
711 super.traceRangeUpdated(signal
);