gdbtrace: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ust.core / src / org / eclipse / linuxtools / internal / lttng2 / ust / core / trace / callstack / LttngUstCallStackProvider.java
index 6b825abfc615129279188d4950b7a6ea51cb1575..15bc30a1aaf8431dc43611403a4f49925d90c488 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add support for thread id
  *******************************************************************************/
 
 package org.eclipse.linuxtools.internal.lttng2.ust.core.trace.callstack;
@@ -16,10 +17,10 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.eclipse.linuxtools.tmf.core.callstack.CallStackStateProvider;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.ctf.core.CtfTmfEvent;
 
 /**
  * Callstack provider for LTTng-UST traces.
@@ -68,7 +69,7 @@ public class LttngUstCallStackProvider extends CallStackStateProvider {
      * Version number of this state provider. Please bump this if you modify
      * the contents of the generated state history in some way.
      */
-    private static final int VERSION = 1;
+    private static final int VERSION = 2;
 
     // ------------------------------------------------------------------------
     // Constructor
@@ -161,4 +162,10 @@ public class LttngUstCallStackProvider extends CallStackStateProvider {
 
         return new String(procName + '-' + vtid.toString());
     }
+
+    @Override
+    protected Long getThreadId(ITmfEvent event) {
+        ITmfEventField content = ((CtfTmfEvent) event).getContent();
+        return (Long) content.getField(CONTEXT_VTID).getValue();
+    }
 }
This page took 0.028542 seconds and 5 git commands to generate.