First draft for the JNI change to support multiple trace version.
authorWilliam Bourque <william.bourque@polymtl.ca>
Tue, 16 Feb 2010 20:35:44 +0000 (20:35 +0000)
committerWilliam Bourque <william.bourque@polymtl.ca>
Tue, 16 Feb 2010 20:35:44 +0000 (20:35 +0000)
64 files changed:
org.eclipse.linuxtools.lttng.jni/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng.jni/build.properties
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarker.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTime.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Pointer.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/JniTime.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Constant.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventOutOfRangeException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerFieldException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoNextEventInTraceException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoSuchEventException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniOpenTraceFailedException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceVersionException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileWithoutEventException.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceFactory.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceVersion.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField_v2_3.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniParser.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniParser_v2_3.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTime.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace_v2_3.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile_v2_3.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/Jni_C_Common_v2_3.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/Jni_C_Pointer.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField_v2_5.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniParser.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniParser_v2_5.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTime.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace_v2_5.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile_v2_5.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/Jni_C_Common.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/Jni_C_Pointer.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniParser_v2_6.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java
org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java

diff --git a/org.eclipse.linuxtools.lttng.jni/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.linuxtools.lttng.jni/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..b6b7fb0
--- /dev/null
@@ -0,0 +1,8 @@
+#Mon Feb 01 15:09:25 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
index 34c5ae0c0fc447bdb212cc9e14c0b907d4990f9d..52f1943fb0b428598925bb198904ebfda79e5b91 100644 (file)
@@ -1,8 +1,8 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name
+Bundle-Name: Jni
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng.jni
-Bundle-Version: 0.2.0.qualifier
+Bundle-Version: 0.2.0
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Export-Package: org.eclipse.linuxtools.lttng.jni,
  org.eclipse.linuxtools.lttng.jni.common,
@@ -10,5 +10,3 @@ Export-Package: org.eclipse.linuxtools.lttng.jni,
  org.eclipse.linuxtools.lttng.jni.factory,
  org.eclipse.linuxtools.lttng.jni_v2_3,
  org.eclipse.linuxtools.lttng.jni_v2_5
-Bundle-Localization: plugin
-Bundle-Vendor: %Bundle-Vendor
index aa1a0082691202e9c8cc650976d2b2d128cae35b..34d2e4d2dad529ceaeb953bfcdb63c51d69ffed2 100644 (file)
@@ -1,5 +1,4 @@
 source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
-               .,\
-               plugin.properties
+               .
index 48dee4a666ef3e2c17226fbdcd4d57cce35cdd80..8ac2df3431a1f4489543eea80cb6dd92c90d9b28 100644 (file)
@@ -15,7 +15,7 @@ package org.eclipse.linuxtools.lttng.jni;
 import java.util.HashMap;
 
 import org.eclipse.linuxtools.lttng.jni.common.JniTime;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniEventException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniNoSuchEventException;
@@ -32,20 +32,15 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniNoSuchEventException;
  * </ul>
  * Note that the JniEvent content is not directly accessibe and should be obtained
  * using the parseAllFields() or parseFieldBy...() methods.
- * 
- * <b>NOTE</b><p>
- * This class is ABSTRACT, you need to extends it to support your specific LTTng version.<p>
- * 
  */
-public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEvent> 
-{
+public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEvent> {
     // Variables to detect if the event have been filled at least once
     // this make possible the detection of "uninitialized" struct in Ltt
-    // Can be "EOK", "ERANGE" or "EPERM" (defined in Jni_C_Common)
+    // Can be "EOK", "ERANGE" or "EPERM" (defined in Jaf_C_Common)
     private int eventState = EPERM; // Start with EPERM to ensure sanity
 
     // Internal C pointer of the JniEvent used in LTT
-    private Jni_C_Pointer_And_Library_Id thisEventPtr = new Jni_C_Pointer_And_Library_Id();
+    private Jni_C_Pointer thisEventPtr = new Jni_C_Pointer();
 
     // Reference to the parent tracefile
     private JniTracefile parentTracefile = null;
@@ -58,40 +53,53 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
     // Note that all type have been scaled up as there is no "unsigned" in java
     // This might be a problem about "unsigned long" as there is no equivalent
     // in java
-    private Jni_C_Pointer_And_Library_Id tracefilePtr = new Jni_C_Pointer_And_Library_Id();
+    private Jni_C_Pointer tracefilePtr = new Jni_C_Pointer();
     private JniTime eventTime = null;
 
     // These methods need a tracefile pointer, instead of a event pointer
-    protected native int      ltt_readNextEvent(int libId, long tracefilePtr);
-    protected native int      ltt_seekEvent(int libId, long tracefilePtr, JniTime givenTime);
-    protected native int      ltt_positionToFirstEvent(int libId, long tracefilePtr);
+    protected native int      ltt_readNextEvent(long tracefilePtr);
+    protected native int      ltt_seekEvent(long tracefilePtr, JniTime givenTime);
+    protected native int      ltt_positionToFirstEvent(long tracefilePtr);
         
     // Native access functions
-    protected native long     ltt_getTracefilePtr(int libId, long eventPtr);
-    protected native long     ltt_getBlock(int libId, long eventPtr);
-    protected native long     ltt_getOffset(int libId, long eventPtr);
-    protected native long     ltt_getCurrentTimestampCounter(int libId, long eventPtr);
-    protected native long     ltt_getTimestamp(int libId, long eventPtr);
-    protected native int      ltt_getEventMarkerId(int libId, long eventPtr);
-    protected native long     ltt_getNanosencondsTime(int libId, long eventPtr);
-    protected native void     ltt_feedEventTime(int libId, long eventPtr, JniTime eventTime);
-    protected native long     ltt_getEventDataSize(int libId, long eventPtr);
-    protected native long     ltt_getEventSize(int libId, long eventPtr);
-    protected native int      ltt_getCount(int libId, long eventPtr);
-    protected native long     ltt_getOverflowNanoSeconds(int libId, long eventPtr);
+    protected native long     ltt_getTracefilePtr(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native long     ltt_getBlock(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native long     ltt_getOffset(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native long     ltt_getCurrentTimestampCounter(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native long     ltt_getTimestamp(long eventPtr);
+    protected native int      ltt_getEventMarkerId(long eventPtr);
+    protected native long     ltt_getNanosencondsTime(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native void     ltt_feedEventTime(long eventPtr, JniTime eventTime);
+    protected native long     ltt_getEventDataSize(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native long     ltt_getEventSize(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native int      ltt_getCount(long eventPtr);
+    @SuppressWarnings("unused")
+    protected native long     ltt_getOverflowNanoSeconds(long eventPtr);
         
-    // This method can be use to obtain the content as byte array
-    // Warning : untested!
-    protected native void     ltt_getDataContent(int libId, long eventPtr, long dataSize, byte[] returnedContent);
+    // This method an event pointer
+    protected native void     ltt_getDataContent(long eventPtr, long dataSize, byte[] returnedContent);
         
     // Debug native function, ask LTT to print event structure
-    protected native void     ltt_printEvent(int libId, long eventPtr);
+    protected native void     ltt_printEvent(long eventPtr);
+
+       static {
+               System.loadLibrary("lttvtraceread_loader");
+       }
+
     
     /**
      * Default constructor is forbidden
      */
+    @SuppressWarnings("unused")
     protected JniEvent() {
-    }
+    };
 
     /**
      * Copy constructor.<p>
@@ -120,12 +128,12 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      *            
      * @exception JniException
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniMarker
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTracefile
      */
-    public JniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
-       
+    public JniEvent(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+
         // Basic test to make sure we didn't get null/empty value 
         if ((newEventPtr.getPointer() == NULL)
                 || (newMarkersMap == null) 
@@ -159,13 +167,13 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * If the move fails, the event will not get populated and the last event data will still be available.
      * 
-     * @return LTT read status, as defined in Jni_C_Constant.
+     * @return LTT read status, as defined in Jni_C_Common.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Common
      */
      public int readNextEvent() {
         // Ask Ltt to read the next event for this particular tracefile
-        eventState = ltt_readNextEvent(tracefilePtr.getLibraryId(), tracefilePtr.getPointer() );
+        eventState = ltt_readNextEvent( tracefilePtr.getPointer() );
         // If the event state is sane populate it
         if (eventState == EOK) {
             populateEventInformation();
@@ -184,14 +192,14 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * If the seek fails, the event will not get populated and the last event data will still be available.<p>
      * 
-     * @return LTT read status, as defined in Jni_C_Constant
+     * @return LTT read status, as defined in Jni_C_Common
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Common
      */
     public int seekToTime(JniTime seekTime) {
         // Ask Ltt to read the next event for this particular tracefile
-        eventState = ltt_seekEvent(tracefilePtr.getLibraryId(), tracefilePtr.getPointer(), seekTime);
-        
+        eventState = ltt_seekEvent(tracefilePtr.getPointer(), seekTime);
+
         // If the event state is sane populate it
         if (eventState == EOK) {
             populateEventInformation();
@@ -207,9 +215,9 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * If the seek fails, we will seek back to the previous position, so the event will stay in a consistent state.<p> 
      * 
-     * @return LTT read status, as defined in Jni_C_Constant
+     * @return LTT read status, as defined in Jni_C_Common
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Common
      */
     public int seekOrFallBack(JniTime seekTime) {
         // Save the old time
@@ -237,12 +245,12 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * A status different of EOK probably means there is no event associated to this tracefile.
      * 
-     * @return LTT read status, as defined in Jni_C_Constant
+     * @return LTT read status, as defined in Jni_C_Common
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Common
      */
     public int positionToFirstEvent() {
-        eventState = ltt_positionToFirstEvent(tracefilePtr.getLibraryId(), tracefilePtr.getPointer());
+        eventState = ltt_positionToFirstEvent(tracefilePtr.getPointer());
         
         return eventState;
     }
@@ -252,7 +260,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * @return Reference to the marker for this tracefile's event or null if none.
      *  
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniMarker
      */
     public JniMarker requestEventMarker() {
         return markersMap.get(getEventMarkerId());
@@ -269,7 +277,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
     public byte[] requestEventContent() {
         byte dataContent[] = new byte[(int) getEventDataSize()];
 
-        ltt_getDataContent(thisEventPtr.getLibraryId(), thisEventPtr.getPointer(), getEventDataSize(), dataContent);
+        ltt_getDataContent(thisEventPtr.getPointer(), getEventDataSize(), dataContent);
 
         return dataContent;
     }
@@ -281,7 +289,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * @return  Reference to the JniMarker object for this event or null if none. 
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniMarker
      */
     public String requestEventSource() {
         // *** TODO ***
@@ -301,7 +309,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * @return Object that contain the parsed payload
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniParser
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniParser
      */
     public Object parseFieldById(int fieldId) {
         return JniParser.parseField(this, fieldId);
@@ -316,7 +324,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * @return Object that contain the parsed payload
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniParser
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniParser
      */
     public Object parseFieldByName(String fieldName) {
         return JniParser.parseField(this, fieldName);
@@ -327,7 +335,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * @return HashMap<String, Object> which is the parsedContent objects and their name as key.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniParser 
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniParser 
      */
     public HashMap<String, Object> parseAllFields() {
         return JniParser.parseAllFields(this);
@@ -341,7 +349,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      */
     private void populateEventInformation() {
        // We need to save the time, as it is not a primitive (can't be dynamically called in getter)
-       eventTime.setTime(ltt_getNanosencondsTime(thisEventPtr.getLibraryId(), thisEventPtr.getPointer()));
+       eventTime.setTime(ltt_getNanosencondsTime(thisEventPtr.getPointer() ));
     }
     
     public JniTime getEventTime() {
@@ -351,11 +359,11 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
     // *** To get better performance, all getter belows call LTT directly ****
     //     That way, we can avoid copying data into memory
     public int getEventMarkerId() {
-        return ltt_getEventMarkerId(thisEventPtr.getLibraryId(), thisEventPtr.getPointer());
+        return ltt_getEventMarkerId(thisEventPtr.getPointer());
     }
 
     public long getEventDataSize() {
-        return ltt_getEventDataSize(thisEventPtr.getLibraryId(), thisEventPtr.getPointer());
+        return ltt_getEventDataSize(thisEventPtr.getPointer());
     }
 
     public HashMap<Integer, JniMarker> getMarkersMap() {
@@ -370,10 +378,10 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * @return The actual (long converted) pointer or NULL.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public Jni_C_Pointer_And_Library_Id getTracefilePtr() {
-        return new Jni_C_Pointer_And_Library_Id(thisEventPtr.getLibraryId(), ltt_getTracefilePtr(thisEventPtr.getLibraryId(), thisEventPtr.getPointer()) );
+    public Jni_C_Pointer getTracefilePtr() {
+        return new Jni_C_Pointer( ltt_getTracefilePtr(thisEventPtr.getPointer()) );
     }
 
     /**
@@ -384,9 +392,9 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * @return The actual (long converted) pointer or NULL.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public Jni_C_Pointer_And_Library_Id getEventPtr() {
+    public Jni_C_Pointer getEventPtr() {
         return thisEventPtr;
     }
 
@@ -399,7 +407,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      *
      * @return  The parent tracefile 
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTracefile
      */
     public JniTracefile getParentTracefile() {
         return parentTracefile;
@@ -439,9 +447,18 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
      * 
      * This function will call Ltt to print, so information printed will be 
      * the one from the C structure, not the one populated in java.<p>
+     * 
+     * This function will not throw but will complain loudly if pointer is NULL.
      */
     public void printEventInformation() {
-        ltt_printEvent(thisEventPtr.getLibraryId(), thisEventPtr.getPointer());
+
+        // If null pointer, print a warning!
+        if (thisEventPtr.getPointer() == NULL) {
+            printlnC("Pointer is NULL, cannot print. (printEventInformation)");
+        }
+        else {
+            ltt_printEvent(thisEventPtr.getPointer());
+        }
     }
     
     /**
@@ -464,5 +481,4 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable<JniEve
 
         return returnData;
     }
-    
 }
index dbad6c11951c3f1e60082e8c69ad3be027647269..8df197591214232d49803b5e43d280126b1c9cb7 100644 (file)
@@ -11,10 +11,11 @@ package org.eclipse.linuxtools.lttng.jni;
  *   William Bourque (wbourque@gmail.com) - Initial API and implementation
  *******************************************************************************/
 
+
 import java.util.ArrayList;
 import java.util.HashMap;
 
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniMarkerException;
 
@@ -32,16 +33,11 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniMarkerException;
  * <li> an overview of the marker format (in C style printf format)
  * <li> a reference to an ArrayList that contains MarkerFields object of this JniMarker
  * </ul>
- * 
- * <b>NOTE</b><p>
- * This class is ABSTRACT, you need to extends it to support your specific LTTng version.<br>
- * Please look at the abstract functions to override at the bottom of this file.<p>
- * 
  */
 public abstract class JniMarker extends Jni_C_Common
 {
     // Internal C pointer of the JniEvent used in LTT
-    private Jni_C_Pointer_And_Library_Id thisMarkerPtr = new Jni_C_Pointer_And_Library_Id();
+    private Jni_C_Pointer thisMarkerPtr = new Jni_C_Pointer();
 
     private String name = "";
     private String formatOverview = "";
@@ -53,24 +49,37 @@ public abstract class JniMarker extends Jni_C_Common
     private ArrayList<JniMarkerField> markerFieldsArrayList = null;
 
     // Native access method
-    protected native String ltt_getName(int libId, long markerPtr);   
-    protected native String ltt_getFormatOverview(int libId, long markerPtr);
-    protected native long ltt_getSize(int libId, long markerPtr);
-    protected native short ltt_getLargestAlign(int libId, long markerPtr);
-    protected native short ltt_getIntSize(int libId, long markerPtr);
-    protected native short ltt_getLongSize(int libId, long markerPtr);
-    protected native short ltt_getPointerSize(int libId, long markerPtr);
-    protected native short ltt_getSize_tSize(int libId, long markerPtr);
-    protected native void ltt_getAllMarkerFields(int libId, long tracePtr);
-    protected native short ltt_getAlignement(int libId, long markerPtr);
-    protected native long ltt_getNextMarkerPtr(int libId, long markerPtr);
+    protected native String ltt_getName(long markerPtr);   
+    protected native String ltt_getFormatOverview(long markerPtr);
+    @SuppressWarnings("unused")
+    protected native long ltt_getSize(long markerPtr);
+    @SuppressWarnings("unused")
+    protected native short ltt_getLargestAlign(long markerPtr);
+    @SuppressWarnings("unused")
+    protected native short ltt_getIntSize(long markerPtr);
+    @SuppressWarnings("unused")
+    protected native short ltt_getLongSize(long markerPtr);
+    @SuppressWarnings("unused")
+    protected native short ltt_getPointerSize(long markerPtr);
+    @SuppressWarnings("unused")
+    protected native short ltt_getSize_tSize(long markerPtr);
+    protected native void ltt_getAllMarkerFields(long tracePtr);
+    @SuppressWarnings("unused")
+    protected native short ltt_getAlignement(long markerPtr);
+    @SuppressWarnings("unused")
+    protected native long ltt_getNextMarkerPtr(long markerPtr);
 
     // Debug native function, ask LTT to print marker structure
-    protected native void ltt_printMarker(int libId, long markerPtr);
+    protected native void ltt_printMarker(long markerPtr);
+
+       static {
+               System.loadLibrary("lttvtraceread_loader");
+       }
 
     /*
      * Default constructor is forbidden
      */
+    @SuppressWarnings("unused")
     protected JniMarker() {
     }
     
@@ -95,7 +104,7 @@ public abstract class JniMarker extends Jni_C_Common
      * 
      * @exception JniException
      */
-    public JniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException {
+    public JniMarker(Jni_C_Pointer newMarkerPtr) throws JniException {
         thisMarkerPtr = newMarkerPtr;
         markerFieldsArrayList = new ArrayList<JniMarkerField>();
         markerFieldsHashMap = new HashMap<String, JniMarkerField>();
@@ -113,10 +122,10 @@ public abstract class JniMarker extends Jni_C_Common
         if (thisMarkerPtr.getPointer() == NULL) {
             throw new JniMarkerException("Pointer is NULL, trace closed? (populateMarkerInformatOverviewion)");
         } else {
-            name = ltt_getName(thisMarkerPtr.getLibraryId(), thisMarkerPtr.getPointer());
-            formatOverview = ltt_getFormatOverview(thisMarkerPtr.getLibraryId(),  thisMarkerPtr.getPointer());
+            name = ltt_getName( thisMarkerPtr.getPointer() );
+            formatOverview = ltt_getFormatOverview( thisMarkerPtr.getPointer() );
             // To fill the markerFieldArray is a bit different
-            ltt_getAllMarkerFields(thisMarkerPtr.getLibraryId(),  thisMarkerPtr.getPointer());
+            ltt_getAllMarkerFields( thisMarkerPtr.getPointer() );
         }
     }
 
@@ -130,16 +139,17 @@ public abstract class JniMarker extends Jni_C_Common
      * @param markerName        Name of the parent marker
      * @param markerFieldPtr    C Pointer (converted in long) to marker_field C Structure
      */
-       private void addMarkerFieldFromC(String markerFieldName, long markerFieldPtr) {
-        // Create a new Jni_markerField object and insert it in the map
+    @SuppressWarnings("unused")
+    private void addMarkerFieldFromC(String markerFieldName, long markerFieldPtr) {
+        // Create a new Jaf_markerField object and insert it in the map
         // the maker field fill itself with LTT data while being constructed
         try {
-            JniMarkerField newMarkerField = allocateNewJniMarkerField( new Jni_C_Pointer_And_Library_Id(thisMarkerPtr.getLibraryId(), markerFieldPtr));
+            JniMarkerField newMarkerField = allocateNewJniMarkerField( new Jni_C_Pointer(markerFieldPtr) );
             markerFieldsArrayList.add(newMarkerField);
             markerFieldsHashMap.put(markerFieldName, newMarkerField);
             
         } catch (JniException e) {
-            printlnC(thisMarkerPtr.getLibraryId(), "Failed to add marker field " + markerFieldName + " to marker fields list!(addMarkerFieldFromC)\n\tException raised : " + e.toString() );
+            printlnC("Failed to add marker field " + markerFieldName + " to marker fields list!(addMarkerFieldFromC)\n\tException raised : " + e.toString() );
         }
     }
 
@@ -168,9 +178,9 @@ public abstract class JniMarker extends Jni_C_Common
      * 
      * @return The actual (long converted) pointer or NULL
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public Jni_C_Pointer_And_Library_Id getMarkerPtr() {
+    public Jni_C_Pointer getMarkerPtr() {
         return thisMarkerPtr;
     }
     
@@ -185,7 +195,13 @@ public abstract class JniMarker extends Jni_C_Common
      * This function will not throw but will complain loudly if pointer is NULL
      */
     public void printMarkerInformation() {
-        ltt_printMarker(thisMarkerPtr.getLibraryId(), thisMarkerPtr.getPointer());
+
+        // If null pointer, print a warning!
+        if (thisMarkerPtr.getPointer() == NULL) {
+            printlnC("Pointer is NULL, cannot print. (printMarkerInformation)");
+        } else {
+            ltt_printMarker(thisMarkerPtr.getPointer());
+        }
     }
     
     /**
@@ -199,7 +215,7 @@ public abstract class JniMarker extends Jni_C_Common
         Object[] allMarkersField = markerFieldsArrayList.toArray();
 
         for (int pos = 0; pos < allMarkersField.length; pos++) {
-            printlnC(thisMarkerPtr.getLibraryId(), allMarkersField[pos].toString());
+            printlnC(allMarkersField[pos].toString());
         }
     }
     
@@ -215,34 +231,12 @@ public abstract class JniMarker extends Jni_C_Common
 
         returnData += "name                    : " + name + "\n";
         returnData += "formatOverview          : " + formatOverview + "\n";
-        returnData += "markerFieldArrayList    : " + markerFieldsArrayList.hashCode() + " (size : " + markerFieldsArrayList.size() + " )" + "\n";
-        
+        returnData += "markerFieldArrayList    : " + markerFieldsArrayList.toArray() + "\n";
+
         return returnData;
     }
     
     
-    // ****************************
-    // **** ABSTRACT FUNCTIONS ****
-    // You MUST override those in your version specific implementation
-       
-       
-       /**
-     * Function place holder to allocate a new JniMarkerField.<p>
-     * <br>
-     * JniMarkerField constructor is non overridable so we need another overridable function to return the correct version of JniMarkerField.<br>
-     * Effect of this function should be the same (allocate a fresh new JniMarkerField).<br>
-     * <br>
-     * <b>!! Override this with you version specific implementation.</b><br>
-     * 
-     * @param newMarkerFieldPtr                The pointer and library id of an already opened marker_field C Structure
-     * 
-     * @return                                         The newly allocated JniMarkerField of the correct version
-     * 
-     * @throws JniException                    The construction (allocation) failed.
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarkerField
-     */
-    public abstract JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException;
+    public abstract JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException;
     
 }
index e2b13bb88c0365cfe2ef0ae6f09189a2e6f230bb..23187acca59d4e5422ba879160198ac4c4aadfb1 100644 (file)
@@ -1,6 +1,6 @@
 package org.eclipse.linuxtools.lttng.jni;
 
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniMarkerFieldException;
 
@@ -16,35 +16,42 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniMarkerFieldException;
  * <li> the name (field) of in String
  * <li> the marker field format (in C style printf format)
  * </ul>
- * 
- * <b>NOTE</b><p>
- * This class is ABSTRACT, you need to extends it to support your specific LTTng version.<p>
- * 
  */
 public abstract class JniMarkerField extends Jni_C_Common
 {
     // Internal C pointer of the JniEvent used in LTT
-    private Jni_C_Pointer_And_Library_Id thisMarkerFieldPtr = new Jni_C_Pointer_And_Library_Id();
+    private Jni_C_Pointer thisMarkerFieldPtr = new Jni_C_Pointer();
 
     private String field = "";
     private String format = "";
     
     // Native access method
-    protected native String ltt_getField(int libId, long markerFieldPtr);
-    protected native int ltt_getType(int libId, long markerFieldPtr);
-    protected native long ltt_getOffset(int libId, long markerFieldPtr);
-    protected native long ltt_getSize(int libId, long markerFieldPtr);
-    protected native long ltt_getAlignment(int libId, long markerFieldPtr);
-    protected native long ltt_getAttributes(int libId, long markerFieldPtr);
-    protected native int ltt_getStatic_offset(int libId, long markerFieldPtr);
-    protected native String ltt_getFormat(int libId, long markerFieldPtr);
+    protected native String ltt_getField(long markerFieldPtr);
+    @SuppressWarnings("unused")
+    protected native int ltt_getType(long markerFieldPtr);
+    @SuppressWarnings("unused")
+    protected native long ltt_getOffset(long markerFieldPtr);
+    @SuppressWarnings("unused")
+    protected native long ltt_getSize(long markerFieldPtr);
+    @SuppressWarnings("unused")
+    protected native long ltt_getAlignment(long markerFieldPtr);
+    @SuppressWarnings("unused")
+    protected native long ltt_getAttributes(long markerFieldPtr);
+    @SuppressWarnings("unused")
+    protected native int ltt_getStatic_offset(long markerFieldPtr);
+    protected native String ltt_getFormat(long markerFieldPtr);
 
     // Debug native function, ask LTT to print marker structure
-    protected native void ltt_printMarkerField(int libId, long markerFieldPtr);
+    protected native void ltt_printMarkerField(long markerFieldPtr);
+
+       static {
+               System.loadLibrary("lttvtraceread_loader");
+       }
 
     /*
      * Default constructor is forbidden
      */
+    @SuppressWarnings("unused")
     protected JniMarkerField() {
     }
 
@@ -65,10 +72,8 @@ public abstract class JniMarkerField extends Jni_C_Common
      * @param newMarkerFieldPtr  Pointer to a C marker_field structure
      * 
      * @exception JniException
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
      */
-    public JniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException {
+    public JniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
         thisMarkerFieldPtr = newMarkerFieldPtr;
 
         // Populate the marker field
@@ -84,8 +89,8 @@ public abstract class JniMarkerField extends Jni_C_Common
             throw new JniMarkerFieldException(
                     "Pointer is NULL, trace closed? (populateMarkerInformation)");
         } else {
-            field = ltt_getField(thisMarkerFieldPtr.getLibraryId(), thisMarkerFieldPtr.getPointer());
-            format = ltt_getFormat(thisMarkerFieldPtr.getLibraryId(), thisMarkerFieldPtr.getPointer());
+            field = ltt_getField(thisMarkerFieldPtr.getPointer());
+            format = ltt_getFormat(thisMarkerFieldPtr.getPointer());
         }
     }
 
@@ -105,9 +110,9 @@ public abstract class JniMarkerField extends Jni_C_Common
      * 
      * @return The actual (long converted) pointer or NULL
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public Jni_C_Pointer_And_Library_Id getMarkerFieldPtr() {
+    public Jni_C_Pointer getMarkerFieldPtr() {
         return thisMarkerFieldPtr;
     }
     
@@ -116,9 +121,17 @@ public abstract class JniMarkerField extends Jni_C_Common
      * 
      * This function will call Ltt to print, so information printed will be the one from 
      * the C structure, not the one populated in java.<p>
+     * 
+     * This function will not throw but will complain loudly if pointer is NULL
      */
     public void printMarkerFieldInformation() {
-        ltt_printMarkerField(thisMarkerFieldPtr.getLibraryId(), thisMarkerFieldPtr.getPointer());
+
+        // If null pointer, print a warning!
+        if (thisMarkerFieldPtr.getPointer() == NULL) {
+            printlnC("Pointer is NULL, cannot print. (printMarkerFieldInformation)");
+        } else {
+            ltt_printMarkerField(thisMarkerFieldPtr.getPointer());
+        }
     }
     
     /**
@@ -135,5 +148,4 @@ public abstract class JniMarkerField extends Jni_C_Common
         
         return returnData;
     }
-    
 }
index adeafd9ff5f2985325d7bf745a3ecb8e846ade08..22e7ab9dabdf3214fd06845c4e40b0caa8cc0e4a 100644 (file)
@@ -23,14 +23,14 @@ import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
  * JniParser is used to parse an event payload into something usable.<p>
  * 
  * All methods are static, the parser shouldn't be instantiated.
- * 
- * <b>NOTE</b><p>
- * This class is ABSTRACT, you need to extends it to support your specific LTTng version.<p>
- * 
  */
 public abstract class JniParser extends Jni_C_Common
 {
-    protected static native void ltt_getParsedData(int libId, ParsedObjectContent parseddata, long eventPtr, long markerFieldPtr);
+    protected static native void ltt_getParsedData(ParsedObjectContent parseddata, long eventPtr, long markerFieldPtr);
+
+       static {
+               System.loadLibrary("lttvtraceread_loader");
+       }
     
     // *** HACK ***
     // We cannot use "Object" directly as java does not support swapping primitive value
@@ -56,7 +56,7 @@ public abstract class JniParser extends Jni_C_Common
      * 
      * @return                  An Object that contain the JniEvent payload parsed by the C, or null, if if was impossible to parse (i.e., wrong position)
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
      */
     static public Object parseField(JniEvent eventToParse, int fieldPosition) {
         
@@ -68,7 +68,7 @@ public abstract class JniParser extends Jni_C_Common
         JniMarkerField tmpField = eventToParse.requestEventMarker().getMarkerFieldsArrayList().get(fieldPosition);
         
         // Call the parsing function in C. The result will be put in parsedData object
-        ltt_getParsedData(eventToParse.getEventPtr().getLibraryId(), parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer());
+        ltt_getParsedData(parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer() );
         
         return parsedData.getData();
     }
@@ -84,7 +84,7 @@ public abstract class JniParser extends Jni_C_Common
      * 
      * @return                  An Object that contain the JniEvent payload parsed by the C, or null, if if was impossible to parse (i.e., wrong position)
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
      */
     static public Object parseField(JniEvent eventToParse, String fieldName) {
         
@@ -95,7 +95,7 @@ public abstract class JniParser extends Jni_C_Common
             return null;
         }
         
-        ltt_getParsedData(eventToParse.getEventPtr().getLibraryId(), parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer());
+        ltt_getParsedData(parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer() );
         
         return parsedData.getData();
     }
@@ -110,7 +110,7 @@ public abstract class JniParser extends Jni_C_Common
      * @param   eventToParse    The jni event we want to parse.  
      * @return                  An HashMap of Object that contain the is the JniEvent's payload parsed by the C
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
      */
     static public HashMap<String, Object> parseAllFields(JniEvent eventToParse) {
         HashMap<String,JniMarkerField> markerFieldData = eventToParse.requestEventMarker().getMarkerFieldsHashMap();
@@ -130,14 +130,16 @@ public abstract class JniParser extends Jni_C_Common
                //       HashMap<String, Object> parsedDataMap = (HashMap<String, Object>)markerFieldData.clone();
                // Or even safer, use HashMap constructor to do so : 
         HashMap<String, Object> parsedDataMap = new HashMap<String, Object>(markerFieldData);
-               
+                
+        String              newKey             = null; 
         JniMarkerField      newMarkerField  = null;
         Iterator<String>    iterator        = markerFieldData.keySet().iterator();
         
         while ( iterator.hasNext() ) {
-            newMarkerField = markerFieldData.get(iterator.next());
+            newKey = iterator.next();
+            newMarkerField = markerFieldData.get(newKey);
             // Call the C to parse the data
-            ltt_getParsedData(eventToParse.getEventPtr().getLibraryId(), parsedData, eventToParse.getEventPtr().getPointer(), newMarkerField.getMarkerFieldPtr().getPointer());
+            ltt_getParsedData(parsedData, eventToParse.getEventPtr().getPointer(), newMarkerField.getMarkerFieldPtr().getPointer() );
             // Save the result into the HashMap
             parsedDataMap.put(newMarkerField.getField(), parsedData.getData() );
         }
@@ -158,7 +160,8 @@ public abstract class JniParser extends Jni_C_Common
      * @param stringToAdd   The parsed data to add
      * @param formatToAdd   The format of the raw data
      */
-       static private void addStringToParsingFromC(Object contentHolder, String stringToAdd) {
+    @SuppressWarnings("unused")
+    static private void addStringToParsingFromC(Object contentHolder, String stringToAdd) {
         ((ParsedObjectContent)contentHolder).setData( stringToAdd);
     }
 
@@ -174,7 +177,8 @@ public abstract class JniParser extends Jni_C_Common
      * @param pointerToAdd  The parsed data to add (in 64 bits long!)
      * @param formatToAdd   The format of the raw data
      */
-       static private void addLongPointerToParsingFromC(Object contentHolder, long pointerToAdd) {
+    @SuppressWarnings("unused")
+    static private void addLongPointerToParsingFromC(Object contentHolder, long pointerToAdd) {
         ((ParsedObjectContent)contentHolder).setData( new Jni_C_Pointer((long) pointerToAdd));
     }
 
@@ -190,7 +194,8 @@ public abstract class JniParser extends Jni_C_Common
      * @param pointerToAdd  The parsed data to add (converted in 64 bits long!)
      * @param formatToAdd   The format of the raw data
      */
-       static private void addIntPointerToParsingFromC(Object contentHolder, long pointerToAdd) {
+    @SuppressWarnings("unused")
+    static private void addIntPointerToParsingFromC(Object contentHolder, long pointerToAdd) {
         ((ParsedObjectContent)contentHolder).setData( new Jni_C_Pointer((int) pointerToAdd));
     }
 
@@ -206,8 +211,9 @@ public abstract class JniParser extends Jni_C_Common
      * @param shortToAdd    The parsed data to add
      * @param formatToAdd   The format of the raw data
      */
-       static private void addShortToParsingFromC(Object contentHolder, short shortToAdd) {
-        ((ParsedObjectContent)contentHolder).setData( Short.valueOf(shortToAdd));
+    @SuppressWarnings("unused")
+    static private void addShortToParsingFromC(Object contentHolder, short shortToAdd) {
+        ((ParsedObjectContent)contentHolder).setData( new Short(shortToAdd));
     }
 
     /* 
@@ -222,8 +228,9 @@ public abstract class JniParser extends Jni_C_Common
      * @param intToAdd      The parsed data to add
      * @param formatToAdd   The format of the raw data
      */
-       static private void addIntegerToParsingFromC(Object contentHolder, int intToAdd) {
-        ((ParsedObjectContent)contentHolder).setData( Integer.valueOf(intToAdd));
+    @SuppressWarnings("unused")
+    static private void addIntegerToParsingFromC(Object contentHolder, int intToAdd) {
+        ((ParsedObjectContent)contentHolder).setData( new Integer(intToAdd));
     }
 
     /* 
@@ -238,8 +245,9 @@ public abstract class JniParser extends Jni_C_Common
      * @param longToAdd     The parsed data to add
      * @param formatToAdd   The format of the raw data
      */
-       static private void addLongToParsingFromC(Object contentHolder, long longToAdd) {
-        ((ParsedObjectContent)contentHolder).setData( Long.valueOf(longToAdd));
+    @SuppressWarnings("unused")
+    static private void addLongToParsingFromC(Object contentHolder, long longToAdd) {
+        ((ParsedObjectContent)contentHolder).setData( new Long(longToAdd));
     }
 
     /* 
@@ -254,7 +262,8 @@ public abstract class JniParser extends Jni_C_Common
      * @param floatToAdd    The parsed data to add
      * @param formatToAdd   The format of the raw data
      */
-       static private void addFloatToParsingFromC(Object contentHolder, float floatToAdd) {
+    @SuppressWarnings("unused")
+    static private void addFloatToParsingFromC(Object contentHolder, float floatToAdd) {
         ((ParsedObjectContent)contentHolder).setData( new Float(floatToAdd));
     }
 
@@ -271,13 +280,13 @@ public abstract class JniParser extends Jni_C_Common
      * @param doubleToAdd   The parsed data to add
      * @param formatToAdd   The format of the raw data
      */
-       static private void addDoubleToParsingFromC(Object contentHolder, double doubleToAdd) {
+    @SuppressWarnings("unused")
+    static private void addDoubleToParsingFromC(Object contentHolder, double doubleToAdd) {
         ((ParsedObjectContent)contentHolder).setData( new Double(doubleToAdd));
     }
     
 }
 
-
 /**
  * <b><u>ParsedObjectContent</u></b><p>
  * 
@@ -294,4 +303,4 @@ class ParsedObjectContent {
     public void setData(Object newData) {
         parsedData = newData;
     }
-}
+}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTime.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTime.java
new file mode 100644 (file)
index 0000000..b6bcdfe
--- /dev/null
@@ -0,0 +1,178 @@
+package org.eclipse.linuxtools.lttng.jni;
+/*******************************************************************************
+ * Copyright (c) 2009 Ericsson
+ * 
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *   William Bourque (wbourque@gmail.com) - Initial API and implementation
+ *******************************************************************************/
+
+
+/**
+ * <b><u>JniTime</u></b>
+ * <p>
+ * Used to store (event, trace, tracefile, ...) timestamp.
+ * 
+ * Mimic the behavior of the LttTime C structure.
+ */
+public class JniTime extends Jni_C_Common implements Comparable<JniTime>
+{
+    private long time = 0;
+
+    /**
+     * Default constructor.<p>
+     * 
+     * Note : Time will be set to 0.
+     * 
+     */
+    public JniTime() {
+        time = 0;
+    }
+
+    /**
+     * Copy constructor.
+     * 
+     * @param oldTime   Reference to the JniTime you want to copy.           
+     */
+    public JniTime(JniTime oldTime) {
+        time = oldTime.getTime();
+    }
+
+    /**
+     * Constructor with parameters.<p>
+     * 
+     * "LTT style" constructor with Seconds et Nanoseconds
+     * 
+     * @param newSec      Seconds of the JniTime
+     * @param newNanoSec  Nanoseconds of the JniTime
+     */
+    public JniTime(long newSec, long newNanoSec) {
+        time = (newSec * NANO) + newNanoSec;
+    }
+
+    /**
+     * Constructor with parameters.<p>
+     * 
+     * Usual "nanosecond only" constructor.
+     * 
+     * @param newNanoSecTime  Time in nanoseconds
+     */
+    public JniTime(long newNanoSecTime) {
+        time = newNanoSecTime;
+    }
+
+    /**
+     * Second of the time.<p>
+     * 
+     * Returns seconds, i.e. multiple of 1 000 000, of the stored nanoseconds time.
+     * 
+     * @return Second of this time.
+     */
+    public long getSeconds() {
+        return (time / NANO);
+    }
+
+    /**
+     * Getter for the nanosecond of the time.<p>
+     * 
+     * Returns nanoseconds part, i.e. modulo of 1 000 000, of the stored nanoseconds time.
+     * 
+     * @return Nanoseconds of this time
+     */
+    public long getNanoSeconds() {
+        return time % NANO;
+    }
+
+    /**
+     * Full time, in nanoseconds.<p>
+     * 
+     * @return Complete time in nanoseconds
+     */
+    public long getTime() {
+        return time;
+    }
+    
+    /**
+     * Changes the current time for this object<p>
+     * 
+     * @param newTime  New time to set, in nanoseconds.
+     */
+    public void setTime(long newTime) {
+        time = newTime;
+    }
+    
+    /* 
+     * Populate this time object
+     * 
+     * Note: This function is called from C side.
+     * 
+     * @param newTime The time we want to populate
+     */
+    @SuppressWarnings("unused")
+    private void setTimeFromC(long newTime) {
+        time = newTime;
+    }
+    
+    /**
+     * Comparaison operator smaller or equal than "<=" .<p>
+     * 
+     * @param comparedTime  The time we want to compare with this one
+     * 
+     * @return true if compared time is smaller or equal, false otherwise
+     */
+    public boolean isSmallerOrEqual(JniTime comparedTime) {
+
+        // NOTE : We check <= instead of just <
+        // This mean the LEFT OPERAND (comparedTime) always prevails
+        if (this.getTime() <= comparedTime.getTime() ) {
+            return true;
+        } 
+        else {
+            return false;
+        }
+    }
+    
+    /**
+     * compareTo operator.<p>
+     * 
+     * @param right  The time we want to compare with this one
+     * 
+     * @return int of value -1, 0 or 1, as the pased argument is bigger, equal or smaller than this time
+     */
+    public int compareTo(JniTime right) {
+        long leftTime = this.getTime();
+        long rightTime = right.getTime();
+        
+        if ( leftTime < rightTime ) { 
+            return -1;
+        }
+        else if ( leftTime > rightTime ) {
+            return  1;
+        }
+        else {
+            return 0;
+        }
+    }
+    
+    /**
+     * toString() method.
+     * <u>Intended to debug</u><p>
+     * 
+     * NOTE : We output the time in the same format as LTT (seconds and nanosecond separatly)
+     * 
+     * @return String Attributes of the object concatenated in String
+     */
+    @Override
+       public String toString() {
+        String returnData = "";
+
+        returnData += "seconds     : " + this.getSeconds() + "\n";
+        returnData += "nanoSeconds : " + this.getNanoSeconds() + "\n";
+
+        return returnData;
+    }
+}
index 9387662a377a0c304f08b82e5112133eb9e56d68..094f50f497eb3dd0e3216de97c48cee06717dcb1 100644 (file)
@@ -11,12 +11,13 @@ package org.eclipse.linuxtools.lttng.jni;
  *   William Bourque (wbourque@gmail.com) - Initial API and implementation
  *******************************************************************************/
 
+
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.PriorityQueue;
 
 import org.eclipse.linuxtools.lttng.jni.common.JniTime;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniOpenTraceFailedException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniTraceException;
@@ -33,23 +34,19 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileWithoutEventExcept
  * <li>a JniTrace path (a trace <b>directory</b>)
  * <li>a HashMap of tracefiles that exists in this trace
  * </ul>
- * <p>
- * <b>NOTE</b><p>
- * This class is ABSTRACT, you need to extends it to support your specific LTTng version.<br>
- * Please look at the abstract functions to override at the bottom of this file.<p>
  */
 public abstract class JniTrace extends Jni_C_Common {
     
     private final static boolean DEFAULT_LTT_DEBUG = false;
     
     // Internal C pointer of the JniTrace used in LTT
-    private Jni_C_Pointer_And_Library_Id thisTracePtr = new Jni_C_Pointer_And_Library_Id();
+    private Jni_C_Pointer thisTracePtr = new Jni_C_Pointer();
 
     // Data we should populate from LTT
     // Note that all type have been scaled up as there is no "unsigned" in java
     // This might be a problem about "unsigned long" as there is no equivalent
     // in java
-    
+
     private String tracepath = ""; // Path of the trace. Should be a directory (like : /tmp/traceX)
     private int    cpuNumber = 0;
     private long   archType = 0;
@@ -77,45 +74,47 @@ public abstract class JniTrace extends Jni_C_Common {
     // Should we print debug in the C library or not?
     private boolean printLttDebug = DEFAULT_LTT_DEBUG;
     
-    
     // This need to be called prior to any operation
-    protected native int ltt_initializeHandle(String libname);
-    
+    protected native boolean ltt_initializeHandle(String libname);
     // This need to be called at the very end (destructor)
-    protected native boolean ltt_freeHandle(int libId);
+    protected native boolean ltt_freeHandle();
     
     // Open/close native functions
-    protected native long ltt_openTrace(int libId, String pathname, boolean printDebug);
-    protected native void ltt_closeTrace(int libId, long tracePtr);
+    protected native long ltt_openTrace(String pathname, boolean printDebug);
+    protected native void ltt_closeTrace(long tracePtr);
 
     // Native access functions
-    protected native String ltt_getTracepath(int libId, long tracePtr);
-    protected native int    ltt_getCpuNumber(int libId, long tracePtr);
-    protected native long   ltt_getArchType(int libId, long tracePtr);
-    protected native long   ltt_getArchVariant(int libId, long tracePtr);
-    protected native short  ltt_getArchSize(int libId, long tracePtr);
-    protected native short  ltt_getLttMajorVersion(int libId, long tracePtr);
-    protected native short  ltt_getLttMinorVersion(int libId, long tracePtr);
-    protected native short  ltt_getFlightRecorder(int libId, long tracePtr);
-    protected native long   ltt_getFreqScale(int libId, long tracePtr);
-    protected native long   ltt_getStartFreq(int libId, long tracePtr);
-    protected native long   ltt_getStartTimestampCurrentCounter(int libId, long tracePtr);
-    protected native long   ltt_getStartMonotonic(int libId, long tracePtr);
+    protected native String ltt_getTracepath(long tracePtr);
+    protected native int    ltt_getCpuNumber(long tracePtr);
+    protected native long   ltt_getArchType(long tracePtr);
+    protected native long   ltt_getArchVariant(long tracePtr);
+    protected native short  ltt_getArchSize(long tracePtr);
+    protected native short  ltt_getLttMajorVersion(long tracePtr);
+    protected native short  ltt_getLttMinorVersion(long tracePtr);
+    protected native short  ltt_getFlightRecorder(long tracePtr);
+    protected native long   ltt_getFreqScale(long tracePtr);
+    protected native long   ltt_getStartFreq(long tracePtr);
+    protected native long   ltt_getStartTimestampCurrentCounter(long tracePtr);
+    protected native long   ltt_getStartMonotonic(long tracePtr);
     
     // Native function to fill out startTime
-    protected native void ltt_feedStartTime(int libId, long tracePtr, JniTime startTime);
+    protected native void ltt_feedStartTime(long tracePtr, JniTime startTime);
     
     // Native function to fill out startTimeFromTimestampCurrentCounter
-    protected native void ltt_feedStartTimeFromTimestampCurrentCounter(int libId, long tracePtr, JniTime startTime);
+    protected native void ltt_feedStartTimeFromTimestampCurrentCounter(long tracePtr, JniTime startTime);
 
     // Native function to fill out tracefilesMap
-    protected native void ltt_feedAllTracefiles(int libId, long tracePtr);
+    protected native void ltt_feedAllTracefiles(long tracePtr);
     
     // Native function to fill out the start and end time of the trace
-    protected native void ltt_feedTracefileTimeRange(int libId, long tracePtr, JniTime startTime, JniTime endTime);
+    protected native void ltt_feedTracefileTimeRange(long tracePtr, JniTime startTime, JniTime endTime);
     
     // Debug native function, ask LTT to print trace structure
-    protected native void ltt_printTrace(int libId, long tracePtr);
+    protected native void ltt_printTrace(long tracePtr);
+
+       static {
+               System.loadLibrary("lttvtraceread_loader");
+       }
     
     /*
      * Default constructor is forbidden
@@ -148,7 +147,7 @@ public abstract class JniTrace extends Jni_C_Common {
      */
     public JniTrace(String newpath, boolean newPrintDebug) throws JniException {
         tracepath = newpath;
-        thisTracePtr = new Jni_C_Pointer_And_Library_Id();
+        thisTracePtr = new Jni_C_Pointer();
         printLttDebug = newPrintDebug;
         
         openTrace(newpath);
@@ -179,10 +178,10 @@ public abstract class JniTrace extends Jni_C_Common {
         endTime         = oldTrace.endTime;
 
         tracefilesMap = new HashMap<String, JniTracefile>(oldTrace.tracefilesMap.size());
-        ltt_feedAllTracefiles(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
+        tracefilesMap = oldTrace.tracefilesMap;
         
         eventsHeap = new PriorityQueue<JniEvent>( oldTrace.eventsHeap.size());
-        populateEventHeap();
+        eventsHeap = oldTrace.eventsHeap;
         
         printLttDebug = oldTrace.printLttDebug;
     }        
@@ -195,9 +194,9 @@ public abstract class JniTrace extends Jni_C_Common {
      *            
      * @exception JniException
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public JniTrace(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException {
+    public JniTrace(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException {
         thisTracePtr = newPtr;
         printLttDebug = newPrintDebug;
         
@@ -206,14 +205,12 @@ public abstract class JniTrace extends Jni_C_Common {
     }
     
     
-    @Override
-       public void finalize() {
+    public void finalize() {
        // If the trace is open, close it
         if (thisTracePtr.getPointer() != NULL) {
             closeTrace();
         }
         
-        // Tell the C to free the allocated memory
         freeLibrary();
     }
     
@@ -221,7 +218,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * Open an existing trace.<p>
      * 
      * The tracepath is a directory and needs to exist, otherwise
-     * a JniOpenTraceFailedException is throwed.
+     * a JafOpenTraceFailedException is throwed.
      * 
      * @param newPath The <b>directory</b> of the trace to be opened
      * 
@@ -257,29 +254,24 @@ public abstract class JniTrace extends Jni_C_Common {
             closeTrace();
         }
         
-        // Initialization of the library is made here
-        // It is very important that the id is kept!
-        int newLibraryId = initializeLibrary();
-        if ( newLibraryId != -1 ) {
+        if ( initializeLibrary() == true ) {
                // Call the LTT to open the trace
-               // Note that the libraryId is not yet and the pointer
-               long newPtr = ltt_openTrace(newLibraryId, tracepath, printLttDebug);
+               long newPtr = ltt_openTrace(tracepath, printLttDebug);
                
                if (newPtr == NULL) {
-                       thisTracePtr = new Jni_C_Pointer_And_Library_Id();
+                       thisTracePtr = new Jni_C_Pointer(NULL);
                    throw new JniOpenTraceFailedException("Error while opening trace. Is the tracepath correct? (openTrace)");
                }
                
                // This is OUR pointer
-               thisTracePtr = new Jni_C_Pointer_And_Library_Id(newLibraryId, newPtr);
+               thisTracePtr = new Jni_C_Pointer(newPtr);
        
                // Populate the trace with LTT information
                populateTraceInformation();
         }
         else {
-               thisTracePtr = new Jni_C_Pointer_And_Library_Id();
-               throw new JniTraceException("Failed to initialize library! Is the trace version supported?\n" +
-                                                   "Make sure you have the correct LTTv library compiled. (openTrace)");
+               thisTracePtr = new Jni_C_Pointer(NULL);
+               throw new JniTraceException("Failed to initialize library! Trace version not supported? (openTrace)");
         }
     }
         
@@ -291,7 +283,7 @@ public abstract class JniTrace extends Jni_C_Common {
     public void closeTrace() {
        
         if (thisTracePtr.getPointer() != NULL) {
-            ltt_closeTrace(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
+            ltt_closeTrace(thisTracePtr.getPointer());
             
             // Clear the tracefile map
             tracefilesMap.clear();
@@ -302,7 +294,11 @@ public abstract class JniTrace extends Jni_C_Common {
             eventsHeap = null;
             
             // Nullify the pointer
-            thisTracePtr = new Jni_C_Pointer_And_Library_Id();
+            thisTracePtr = new Jni_C_Pointer(NULL);
+            
+            // Ask the garbage collector to make a little pass here, as we could
+            // be left with 100's of unreferenced objects
+            System.gc();
         }
     }
     
@@ -312,7 +308,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * Note : No call to the library will work after this until ltt_initializeHandle is called again
      */
     public void freeLibrary() {
-       ltt_freeHandle(thisTracePtr.getLibraryId());
+       ltt_freeHandle();
     }
     
     /* 
@@ -326,18 +322,18 @@ public abstract class JniTrace extends Jni_C_Common {
         }
 
         // Populate from the LTT library
-        tracepath   = ltt_getTracepath(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        cpuNumber   = ltt_getCpuNumber(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        archType    = ltt_getArchType(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        archVariant = ltt_getArchVariant(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        archSize    = ltt_getArchSize(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        lttMajorVersion = ltt_getLttMajorVersion(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        lttMinorVersion = ltt_getLttMinorVersion(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        flightRecorder  = ltt_getFlightRecorder(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        freqScale   = ltt_getFreqScale(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        startFreq   = ltt_getStartFreq(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        startTimestampCurrentCounter = ltt_getStartTimestampCurrentCounter(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
-        startMonotonic = ltt_getStartMonotonic(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
+        tracepath   = ltt_getTracepath( thisTracePtr.getPointer() );
+        cpuNumber   = ltt_getCpuNumber( thisTracePtr.getPointer() );
+        archType    = ltt_getArchType( thisTracePtr.getPointer() );
+        archVariant = ltt_getArchVariant( thisTracePtr.getPointer() );
+        archSize    = ltt_getArchSize( thisTracePtr.getPointer() );
+        lttMajorVersion = ltt_getLttMajorVersion( thisTracePtr.getPointer() );
+        lttMinorVersion = ltt_getLttMinorVersion( thisTracePtr.getPointer() );
+        flightRecorder  = ltt_getFlightRecorder( thisTracePtr.getPointer() );
+        freqScale   = ltt_getFreqScale( thisTracePtr.getPointer() );
+        startFreq   = ltt_getStartFreq( thisTracePtr.getPointer() );
+        startTimestampCurrentCounter = ltt_getStartTimestampCurrentCounter( thisTracePtr.getPointer() );
+        startMonotonic = ltt_getStartMonotonic( thisTracePtr.getPointer() );
 
         // Creation of time is a bit different, we need to pass the object reference to C
         //
@@ -345,21 +341,21 @@ public abstract class JniTrace extends Jni_C_Common {
         //                       So "startTimeNoAdjustement" is obtain throught "ltt_feedStartTime()" and
         //                       "startTime" is obtained from ltt_feedStartTimeFromTimestampCurrentCounter()
         startTimeNoAdjustement = new JniTime();
-        ltt_feedStartTime(thisTracePtr.getLibraryId(), thisTracePtr.getPointer(), startTimeNoAdjustement);
+        ltt_feedStartTime( thisTracePtr.getPointer(), startTimeNoAdjustement );
         
         startTime = new JniTime();
-        ltt_feedStartTimeFromTimestampCurrentCounter(thisTracePtr.getLibraryId(), thisTracePtr.getPointer(), startTime);
+        ltt_feedStartTimeFromTimestampCurrentCounter( thisTracePtr.getPointer(), startTime );
 
         // Call the fill up function for the tracefiles map
         if ( tracefilesMap== null ) {
             tracefilesMap = new HashMap<String, JniTracefile>();
         }
-        ltt_feedAllTracefiles(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
+        ltt_feedAllTracefiles( thisTracePtr.getPointer() );
         
         // Now, obtain the trace "endTime"
         // Note that we discard "startTime" right away, as we already have it
         endTime = new JniTime();
-        ltt_feedTracefileTimeRange(thisTracePtr.getLibraryId(), thisTracePtr.getPointer(), new JniTime(), endTime);
+        ltt_feedTracefileTimeRange(thisTracePtr.getPointer(), new JniTime(), endTime);
         
         if (eventsHeap == null) {
             eventsHeap = new PriorityQueue<JniEvent>(tracefilesMap.size());
@@ -408,17 +404,17 @@ public abstract class JniTrace extends Jni_C_Common {
         // Create a new tracefile object and insert it in the map
         //    the tracefile fill itself with LTT data while being constructed
         try {
-            newTracefile = allocateNewJniTracefile(new Jni_C_Pointer_And_Library_Id(thisTracePtr.getLibraryId(), tracefilePtr), this);
+            newTracefile = allocateNewJniTracefile( new Jni_C_Pointer(tracefilePtr), this );
             getTracefilesMap().put( (tracefileName + newTracefile.getCpuNumber()), newTracefile);
         }
         catch(JniTracefileWithoutEventException e) {
                if ( printLttDebug == true ) {
-                       printlnC(thisTracePtr.getLibraryId(), "JniTracefile " + tracefileName + " has no event (addTracefileFromC). Ignoring.");
+                       printlnC("JniTracefile " + tracefileName + " has no event (addTracefileFromC). Ignoring.");
                }
         }
         catch(Exception e) {
                if ( printLttDebug == true ) {
-                       printlnC(thisTracePtr.getLibraryId(), "Failed to add tracefile " + tracefileName + " to tracefilesMap!(addTracefileFromC)\n\tException raised : " + e.toString() );
+                       printlnC("Failed to add tracefile " + tracefileName + " to tracefilesMap!(addTracefileFromC)\n\tException raised : " + e.toString() );
                }
         }
     }
@@ -430,7 +426,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * @return The top event in the stack or null if no event is available.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
      */
     public JniEvent findNextEvent() {
         return eventsHeap.peek();
@@ -441,7 +437,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * @return The next event in the trace or null if no event is available.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
      */
     public JniEvent readNextEvent() {
         // Get the "next" event on the top of the heap but DO NOT remove it
@@ -490,8 +486,8 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * @return The next event in the tracefile or null if no event is available.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTracefile
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
      */
     public JniEvent readNextEvent(JniTracefile targetTracefile) {
         JniEvent returnedEvent = null;
@@ -532,7 +528,7 @@ public abstract class JniTrace extends Jni_C_Common {
     * 
     * @param seekTime     The time where we want to seek to
     * 
-    * @see org.eclipse.linuxtools.lttng.jni.common.JniTime
+    * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.JniTime
     */
     public void seekToTime(JniTime seekTime) {
         
@@ -559,8 +555,8 @@ public abstract class JniTrace extends Jni_C_Common {
     * @param targetTracefile   The tracefile object to read from
     * @param seekTime                  The time where we want to seek to
     * 
-    * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-    * @see org.eclipse.linuxtools.lttng.jni.common.JniTime
+    * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTracefile
+    * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.JniTime
     */
     public void seekToTime(JniTime seekTime, JniTracefile targetTracefile) {
         // Invalidate the current read event
@@ -587,8 +583,8 @@ public abstract class JniTrace extends Jni_C_Common {
     * 
     * @return The event just after the seeked time or null if none available.
     * 
-    * @see org.eclipse.linuxtools.lttng.jni.JniEvent
-    * @see org.eclipse.linuxtools.lttng.jni.common.JniTime
+    * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
+    * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.JniTime
     */
     public JniEvent seekAndRead(JniTime seekTime) { 
          JniEvent returnedEvent = null;
@@ -607,14 +603,14 @@ public abstract class JniTrace extends Jni_C_Common {
     * 
     * Calling  readNextEvent() after this function will consider this tracefile moved and is then consistent.<br>
     * 
-    * @param targetTracefile    The tracefile object to read from
+    * @param tracefileName   The tracefile object to read from
     * @param seekTime           The time where we want to seek to
     * 
     * @return The event just after the seeked time or null if none available.
     * 
-    * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-    * @see org.eclipse.linuxtools.lttng.jni.common.JniTime
-    * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+    * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTracefile
+    * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.JniTime
+    * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
     */
     public JniEvent seekAndRead(JniTime seekTime, JniTracefile targetTracefile) { 
         seekToTime(seekTime, targetTracefile);
@@ -628,7 +624,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * @return The tracefile found or null if none.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTracefile
      */
     public JniTracefile requestTracefileByName(String tracefileName) {
         return tracefilesMap.get(tracefileName);
@@ -641,7 +637,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * @return Event of the tracefile or null if none found.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniEvent
      */
     public JniEvent requestEventByName(String tracefileName) {
         JniEvent returnValue = null;
@@ -729,7 +725,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * @return Time of the last event read
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.JniTime
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.JniTime
      */
     public JniTime getCurrentEventTimestamp() {
         JniTime returnedTime = null;
@@ -753,9 +749,9 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * @return The actual (long converted) pointer or NULL.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public Jni_C_Pointer_And_Library_Id getTracePtr() {
+    public Jni_C_Pointer getTracePtr() {
         return thisTracePtr;
     }        
     
@@ -777,7 +773,7 @@ public abstract class JniTrace extends Jni_C_Common {
      * This function will call Ltt to print, so information printed will be the
      * one from the C structure, not the one populated in java.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTracefile
      */
     public void printAllTracefilesInformation() {
         JniTracefile tracefile = null;
@@ -795,9 +791,18 @@ public abstract class JniTrace extends Jni_C_Common {
      * 
      * This function will call Ltt to print, so information printed will be the
      * one from the C structure, not the one populated in java.<p>
+     * <br>
+     * This function will not throw but will complain loudly if pointer is NULL
      */
     public void printTraceInformation() {
-        ltt_printTrace(thisTracePtr.getLibraryId(), thisTracePtr.getPointer());
+
+        // If null pointer, print a warning!
+        if (thisTracePtr.getPointer() == NULL) {
+            printlnC("Pointer is NULL, cannot print. (printTraceInformation)");
+        } 
+        else {
+            ltt_printTrace( thisTracePtr.getPointer() );
+        }
     }
         
     /**
@@ -835,43 +840,8 @@ public abstract class JniTrace extends Jni_C_Common {
         return returnData;
     }
     
+    public abstract boolean initializeLibrary();
     
-    // ****************************
-    // **** ABSTRACT FUNCTIONS ****
-    // You MUST override those in your version specific implementation
-    
-    /**
-     * Function place holder to load the correct C library.<p>
-     * <br>
-     * Can be as simple as calling ltt_initializeHandle(LIBRARY_NAME) with the correct .so instead of LIBRARY_NAME.<br>
-     * You may also want to perform some check or some additionnal validations.<br>
-     * <br>
-     * <b>!! Override this with you version specific implementation.</b><br>
-     * 
-     * @return integer that is the library id, or -1 if the load was unsuccessful
-     */
-    public abstract int initializeLibrary();
-    
-    
-    /**
-     * Function place holder to allocate a new JniTracefile.<p>
-     * 
-     * JniTracefile constructor is non overridable so we need another overridable function to return the correct version of JniTracefile.<br>
-     * Effect of this function should be the same (allocate a fresh new JniTracefile)<br>
-     * <br>
-     * <b>!! Override this with you version specific implementation.</b><br>
-     * 
-     * @param newPtr                   The pointer of an already opened LttTracefile C Structure
-     * @param newParentTrace   The JniTrace parent of this tracefile.
-     * 
-     * @return                                 The newly allocated JniTracefile of the correct version
-     * 
-     * @throws JniException            The construction (allocation) failed.
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
-     * @see org.eclipse.linuxtools.lttng.jni.JniTrace
-     */
-    public abstract JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException;
+    public abstract JniTracefile allocateNewJniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException;
     
-}
+}
\ No newline at end of file
index 842d23b97d820f9a07f8c93b93133e407149a5a8..4b586daa497aef41653389f984ffd9a0ebe03354 100644 (file)
@@ -16,7 +16,6 @@ import java.util.HashMap;
 
 import org.eclipse.linuxtools.lttng.jni.common.JniTime;
 import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniNoSuchEventException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileException;
@@ -35,15 +34,11 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileWithoutEventExcept
  * <li> a reference to a single event object
  * <li> a HashMap of marker associated with this tracefile
  * </ul>
- * <b>NOTE</b><p>
- * This class is ABSTRACT, you need to extends it to support your specific LTTng version.<br>
- * Please look at the abstract functions to override at the bottom of this file.<p>
- * 
  */
-public abstract class JniTracefile extends Jni_C_Common 
-{
+public abstract class JniTracefile extends Jni_C_Common {
+        
     // Internal C pointer of the JniTracefile used in LTT
-    private Jni_C_Pointer_And_Library_Id thisTracefilePtr = new Jni_C_Pointer_And_Library_Id();
+    private Jni_C_Pointer thisTracefilePtr = new Jni_C_Pointer();
     
     // Reference to the parent trace
     private JniTrace parentTrace = null;
@@ -60,7 +55,6 @@ public abstract class JniTracefile extends Jni_C_Common
     private long    creation = 0;
     
     // Internal C pointer for trace and marker
-    // Note : These are real Jni_C_Pointer, not Jni_C_Pointer_And_Library_Id
     private Jni_C_Pointer tracePtr = null;
     private Jni_C_Pointer markerDataPtr = null;
     
@@ -80,7 +74,6 @@ public abstract class JniTracefile extends Jni_C_Common
     private JniEvent   currentEvent = null;
     
     // Internal C pointer for trace and marker
-    // Note : This one is a real Jni_C_Pointer, not Jni_C_Pointer_And_Library_Id
     private Jni_C_Pointer bufferPtr = null;
     
     private long    bufferSize = 0;
@@ -89,41 +82,46 @@ public abstract class JniTracefile extends Jni_C_Common
     private HashMap<Integer, JniMarker> tracefileMarkersMap = null;        
 
     // Native access functions
-    protected native boolean  ltt_getIsCpuOnline(int libId, long tracefilePtr);
-    protected native String   ltt_getTracefilepath(int libId, long tracefilePtr);
-    protected native String   ltt_getTracefilename(int libId, long tracefilePtr);
-    protected native long     ltt_getCpuNumber(int libId, long tracefilePtr);
-    protected native long     ltt_getTid(int libId, long tracefilePtr);
-    protected native long     ltt_getPgid(int libId, long tracefilePtr);
-    protected native long     ltt_getCreation(int libId, long tracefilePtr);
-    protected native long     ltt_getTracePtr(int libId, long tracefilePtr);
-    protected native long     ltt_getMarkerDataPtr(int libId, long tracefilePtr);
-    protected native int      ltt_getCFileDescriptor(int libId, long tracefilePtr);
-    protected native long     ltt_getFileSize(int libId, long tracefilePtr);
-    protected native long     ltt_getBlockNumber(int libId, long tracefilePtr);
-    protected native boolean  ltt_getIsBytesOrderReversed(int libId, long tracefilePtr);
-    protected native boolean  ltt_getIsFloatWordOrdered(int libId, long tracefilePtr);
-    protected native long     ltt_getAlignement(int libId, long tracefilePtr);
-    protected native long     ltt_getBufferHeaderSize(int libId, long tracefilePtr);
-    protected native int      ltt_getBitsOfCurrentTimestampCounter(int libId, long tracefilePtr);
-    protected native int      ltt_getBitsOfEvent(int libId, long tracefilePtr);
-    protected native long     ltt_getCurrentTimestampCounterMask(int libId, long tracefilePtr);
-    protected native long     ltt_getCurrentTimestampCounterMaskNextBit(int libId, long tracefilePtr);
-    protected native long     ltt_getEventsLost(int libId, long tracefilePtr);
-    protected native long     ltt_getSubBufferCorrupt(int libId, long tracefilePtr);
-    protected native long     ltt_getEventPtr(int libId, long tracefilePtr);
-    protected native long     ltt_getBufferPtr(int libId, long tracefilePtr);
-    protected native long     ltt_getBufferSize(int libId, long tracefilePtr);
-    
+    protected native boolean  ltt_getIsCpuOnline(long tracefilePtr);
+    protected native String   ltt_getTracefilepath(long tracefilePtr);
+    protected native String   ltt_getTracefilename(long tracefilePtr);
+    protected native long     ltt_getCpuNumber(long tracefilePtr);
+    protected native long     ltt_getTid(long tracefilePtr);
+    protected native long     ltt_getPgid(long tracefilePtr);
+    protected native long     ltt_getCreation(long tracefilePtr);
+    protected native long     ltt_getTracePtr(long tracefilePtr);
+    protected native long     ltt_getMarkerDataPtr(long tracefilePtr);
+    protected native int      ltt_getCFileDescriptor(long tracefilePtr);
+    protected native long     ltt_getFileSize(long tracefilePtr);
+    protected native long     ltt_getBlockNumber(long tracefilePtr);
+    protected native boolean  ltt_getIsBytesOrderReversed(long tracefilePtr);
+    protected native boolean  ltt_getIsFloatWordOrdered(long tracefilePtr);
+    protected native long     ltt_getAlignement(long tracefilePtr);
+    protected native long     ltt_getBufferHeaderSize(long tracefilePtr);
+    protected native int      ltt_getBitsOfCurrentTimestampCounter(long tracefilePtr);
+    protected native int      ltt_getBitsOfEvent(long tracefilePtr);
+    protected native long     ltt_getCurrentTimestampCounterMask(long tracefilePtr);
+    protected native long     ltt_getCurrentTimestampCounterMaskNextBit(long tracefilePtr);
+    protected native long     ltt_getEventsLost(long tracefilePtr);
+    protected native long     ltt_getSubBufferCorrupt(long tracefilePtr);
+    protected native long     ltt_getEventPtr(long tracefilePtr);
+    protected native long     ltt_getBufferPtr(long tracefilePtr);
+    protected native long     ltt_getBufferSize(long tracefilePtr);
+
     // Method to fill a map with marker object
-    protected native void ltt_feedAllMarkers(int libId, long tracefilePtr);
+    protected native void ltt_feedAllMarkers(long tracefilePtr);
     
     // Debug native function, ask LTT to print tracefile structure
-    protected native void ltt_printTracefile(int libId, long tracefilePtr);
+    protected native void ltt_printTracefile(long tracefilePtr);
+    
+       static {
+               System.loadLibrary("lttvtraceread_loader");
+       }
         
     /*
      * Default constructor is forbidden
      */
+    @SuppressWarnings("unused")
     protected JniTracefile() {
     }
 
@@ -166,25 +164,24 @@ public abstract class JniTracefile extends Jni_C_Common
     /**
      * Constructor, using C pointer.<p>
      * 
-     * @param newPtr                   The pointer of an already opened LttTracefile C Structure
-     * @param newParentTrace   The JniTrace parent of this tracefile.
+     * @param newPtr  The pointer of an already opened LttTracefile C Structure
      * 
      * @exception JniException
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTrace
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTrace
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public JniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException {
-       thisTracefilePtr = newPtr;
+    public JniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
+        thisTracefilePtr = newPtr;
         parentTrace = newParentTrace;
         tracefileMarkersMap = new HashMap<Integer, JniMarker>();
 
         // Retrieve the trace file information and load the first event.
         try {
             populateTracefileInformation();
-        } 
-        catch (JniNoSuchEventException e) {
-            throw new JniTracefileWithoutEventException("JniEvent constructor reported that no event of this type are usable. (Jni_Tracefile)");
+        } catch (JniNoSuchEventException e) {
+            throw new JniTracefileWithoutEventException(
+                    "JniEvent constructor reported that no event of this type are usable. (Jaf_Tracefile)");
         }
     }        
 
@@ -193,9 +190,9 @@ public abstract class JniTracefile extends Jni_C_Common
      * 
      * Note : If the read succeed, the event will be populated.<p>
      *      
-     * @return LTT read status, as defined in Jni_C_Constant
+     * @return LTT read status, as defined in Jni_C_Common
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Common
      */
     public int readNextEvent() {
         return currentEvent.readNextEvent();
@@ -208,9 +205,9 @@ public abstract class JniTracefile extends Jni_C_Common
      * 
      * @param seekTime      The timestamp where to seek.
      * 
-     * @return LTT read status, as defined in Jni_C_Constant
+     * @return LTT read status, as defined in Jni_C_Common
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Common
      */
     public int seekToTime(JniTime seekTime) {
         return currentEvent.seekToTime(seekTime);
@@ -223,38 +220,39 @@ public abstract class JniTracefile extends Jni_C_Common
      */
     private void populateTracefileInformation() throws JniException {
         if (thisTracefilePtr.getPointer() == NULL) {
-            throw new JniTracefileException("Pointer is NULL, trace closed? (populateTracefileInformation)");
+            throw new JniTracefileException(
+                    "Pointer is NULL, trace closed? (populateTracefileInformation)");
         }
 
-        isCpuOnline = ltt_getIsCpuOnline(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer());
-        tracefilePath = ltt_getTracefilepath(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer());
-        tracefileName = ltt_getTracefilename(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer());
-        cpuNumber = ltt_getCpuNumber(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer());
-        tid = ltt_getTid(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        pgid = ltt_getPgid(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        creation = ltt_getCreation(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        tracePtr = new Jni_C_Pointer(ltt_getTracePtr(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer()) );
-        markerDataPtr = new Jni_C_Pointer(ltt_getMarkerDataPtr(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer()) );
-        CFileDescriptor = ltt_getCFileDescriptor(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        fileSize = ltt_getFileSize(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        blocksNumber = ltt_getBlockNumber(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        isBytesOrderReversed = ltt_getIsBytesOrderReversed(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        isFloatWordOrdered = ltt_getIsFloatWordOrdered(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        alignement = ltt_getAlignement(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        bufferHeaderSize = ltt_getBufferHeaderSize(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        bitsOfCurrentTimestampCounter = ltt_getBitsOfCurrentTimestampCounter(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        bitsOfEvent = ltt_getBitsOfEvent(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        currentTimestampCounterMask = ltt_getCurrentTimestampCounterMask(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        currentTimestampCounterMaskNextBit = ltt_getCurrentTimestampCounterMaskNextBit(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        eventsLost = ltt_getEventsLost(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        subBufferCorrupt = ltt_getSubBufferCorrupt(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
-        bufferPtr = new Jni_C_Pointer(ltt_getBufferPtr(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer()) );
-        bufferSize = ltt_getBufferSize(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer());
+        isCpuOnline = ltt_getIsCpuOnline( thisTracefilePtr.getPointer() );
+        tracefilePath = ltt_getTracefilepath( thisTracefilePtr.getPointer() );
+        tracefileName = ltt_getTracefilename( thisTracefilePtr.getPointer() );
+        cpuNumber = ltt_getCpuNumber( thisTracefilePtr.getPointer() );
+        tid = ltt_getTid( thisTracefilePtr.getPointer() );
+        pgid = ltt_getPgid( thisTracefilePtr.getPointer() );
+        creation = ltt_getCreation( thisTracefilePtr.getPointer() );
+        tracePtr = new Jni_C_Pointer(ltt_getTracePtr( thisTracefilePtr.getPointer()) );
+        markerDataPtr = new Jni_C_Pointer(ltt_getMarkerDataPtr( thisTracefilePtr.getPointer()) );
+        CFileDescriptor = ltt_getCFileDescriptor( thisTracefilePtr.getPointer() );
+        fileSize = ltt_getFileSize( thisTracefilePtr.getPointer() );
+        blocksNumber = ltt_getBlockNumber( thisTracefilePtr.getPointer() );
+        isBytesOrderReversed = ltt_getIsBytesOrderReversed( thisTracefilePtr.getPointer() );
+        isFloatWordOrdered = ltt_getIsFloatWordOrdered( thisTracefilePtr.getPointer() );
+        alignement = ltt_getAlignement( thisTracefilePtr.getPointer() );
+        bufferHeaderSize = ltt_getBufferHeaderSize( thisTracefilePtr.getPointer() );
+        bitsOfCurrentTimestampCounter = ltt_getBitsOfCurrentTimestampCounter( thisTracefilePtr.getPointer() );
+        bitsOfEvent = ltt_getBitsOfEvent( thisTracefilePtr.getPointer() );
+        currentTimestampCounterMask = ltt_getCurrentTimestampCounterMask( thisTracefilePtr.getPointer() );
+        currentTimestampCounterMaskNextBit = ltt_getCurrentTimestampCounterMaskNextBit( thisTracefilePtr.getPointer() );
+        eventsLost = ltt_getEventsLost( thisTracefilePtr.getPointer() );
+        subBufferCorrupt = ltt_getSubBufferCorrupt( thisTracefilePtr.getPointer() );
+        bufferPtr = new Jni_C_Pointer(ltt_getBufferPtr( thisTracefilePtr.getPointer()) );
+        bufferSize = ltt_getBufferSize( thisTracefilePtr.getPointer() );
 
         // To fill the map is a bit different
-        ltt_feedAllMarkers(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
+        ltt_feedAllMarkers( thisTracefilePtr.getPointer() );
 
-        Jni_C_Pointer_And_Library_Id tmpEventPointer = new Jni_C_Pointer_And_Library_Id(thisTracefilePtr.getLibraryId(), ltt_getEventPtr(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer()));
+        Jni_C_Pointer tmpEventPointer = new Jni_C_Pointer(ltt_getEventPtr(thisTracefilePtr.getPointer()));
         currentEvent = allocateNewJniEvent(tmpEventPointer , tracefileMarkersMap, this);
     }        
     
@@ -268,15 +266,16 @@ public abstract class JniTracefile extends Jni_C_Common
      * @param markerId          Id of the marker (int)
      * @param markerInfoPtr     C Pointer to a marker_info C structure 
      */
-       private void addMarkersFromC(int markerId, long markerInfoPtr) {
+    @SuppressWarnings("unused")
+    private void addMarkersFromC(int markerId, long markerInfoPtr) {
         // Create a new tracefile object and insert it in the map
         // the tracefile fill itself with LTT data while being constructed
         try {
-            JniMarker newMarker = allocateNewJniMarker( new Jni_C_Pointer_And_Library_Id(thisTracefilePtr.getLibraryId(), markerInfoPtr) );
+            JniMarker newMarker = allocateNewJniMarker( new Jni_C_Pointer(markerInfoPtr) );
 
             tracefileMarkersMap.put(markerId, newMarker);
         } catch (Exception e) {
-            printlnC(thisTracefilePtr.getLibraryId(), "Failed to add marker to tracefileMarkersMap!(addMarkersFromC)\n\tException raised : " + e.toString());
+            printlnC("Failed to add marker to tracefileMarkersMap!(addMarkersFromC)\n\tException raised : " + e.toString());
         }
     }
     
@@ -390,7 +389,7 @@ public abstract class JniTracefile extends Jni_C_Common
      *
      * @return The parent trace
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTrace
+     * @see org.eclipse.linuxtools.lttng.jni.eclipse.linuxtools.lttng.jni.JniTrace
      */
     public JniTrace getParentTrace() {
         return parentTrace;
@@ -404,9 +403,9 @@ public abstract class JniTracefile extends Jni_C_Common
      * 
      * @return The actual (long converted) pointer or NULL.
      * 
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
+     * @see org.eclipse.linuxtools.lttng.jni.common.eclipse.linuxtools.lttng.jni.Jni_C_Pointer
      */
-    public Jni_C_Pointer_And_Library_Id getTracefilePtr() {
+    public Jni_C_Pointer getTracefilePtr() {
         return thisTracefilePtr;
     }
     
@@ -416,9 +415,18 @@ public abstract class JniTracefile extends Jni_C_Common
      * 
      * This function will call Ltt to print, so information printed will be the
      * one from the C structure, not the one populated in java.<p>
+     * 
+     * This function will not throw but will complain loudly if pointer is NULL.
      */
     public void printTracefileInformation() {
-        ltt_printTracefile(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() );
+
+        // If null pointer, print a warning!
+        if (thisTracefilePtr.getPointer() == NULL) {
+            printlnC("Pointer is NULL, cannot print. (printTracefileInformation)");
+        } 
+        else {
+            ltt_printTracefile( thisTracefilePtr.getPointer() );
+        }
     }
     
     /**
@@ -462,52 +470,8 @@ public abstract class JniTracefile extends Jni_C_Common
     }
        
        
-       // ****************************
-    // **** ABSTRACT FUNCTIONS ****
-    // You MUST override those in your version specific implementation
-       
-       
-       /**
-     * Function place holder to allocate a new JniEvent.<p>
-     * <br>
-     * JniEvent constructor is non overridable so we need another overridable function to return the correct version of JniEvent.<br>
-     * Effect of this function should be the same (allocate a fresh new JniEvent).<br>
-     * <br>
-     * <b>!! Override this with you version specific implementation.</b><br>
-     * 
-     * @param newEventPtr                      The pointer of an already opened LttEvent C Structure
-     * @param newMarkersMap                    An already populated HashMap of JniMarker objects for this new event
-     * @param newParentTracefile       The JniTrace parent of this tracefile.
-     * 
-     * @return                                         The newly allocated JniEvent of the correct version
-     * 
-     * @throws JniException                    The construction (allocation) failed.
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniEvent
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     */
-       public abstract JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException;
-    
-       
-       /**
-     * Function place holder to allocate a new JniMarker.<p>
-     * <br>
-     * JniMarker constructor is non overridable so we need another overridable function to return the correct version of JniMarker.<br>
-     * Effect of this function should be the same (allocate a fresh new JniMarker).<br>
-     * <br>
-     * <b>!! Override this with you version specific implementation.</b><br>
-     * 
-     * @param newMarkerPtr                     The pointer of an already opened marker_info C Structure
-     * 
-     * @return                                         The newly allocated JniMarker of the correct version
-     * 
-     * @throws JniException                    The construction (allocation) failed.
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
-     * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id
-     */
-       public abstract JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException;
+       public abstract JniEvent allocateNewJniEvent(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException;
+    public abstract JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException;
        
 }
+
index 2713bd6c842f38c561968f9d19aeea072be3c4b6..00f940f833027c1d90068639ee492bb530d0adda 100644 (file)
@@ -18,17 +18,18 @@ import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant;
 /**
  * <b><u>Jni_C_Common</u></b>
  * <p>
- * Common constants and methods that should be shared between JNI objects.
- * 
- * <b>NOTE</b><p>
- * This class is ABSTRACT, and will be extended by each LTTng structure (Trac, Tracefile, Event, ...)
- * 
+ * Common constants and methods that should be shared between JNI objects
  */
-public abstract class Jni_C_Common extends Jni_C_Constant 
-{
-    // Native console printing function
-    protected native void ltt_printC(int libId, String string_to_print);
+public abstract class Jni_C_Common extends Jni_C_Constant {
     
+    // Native console printing function
+    protected native void ltt_printC(String string_to_print);
+
+    // Load LTTV library (order is important)
+       static {
+               System.loadLibrary("lttvtraceread_loader");
+       }
+
     /**
      * Java-side console printing function.<p>
      * 
@@ -36,10 +37,10 @@ public abstract class Jni_C_Common extends Jni_C_Constant
      * 
      * @param msg   The string to print in C.
      */
-    public void printC(int libId, String msg) {
+    public void printC(String msg) {
         // Need to escape "%" for C printf 
         msg = msg.replaceAll("%", "%%");
-        ltt_printC(libId, msg);
+        ltt_printC(msg);
     }
 
     /**
@@ -49,8 +50,7 @@ public abstract class Jni_C_Common extends Jni_C_Constant
      * 
      * @param msg   The string to print in C.
      */
-    public void printlnC(int libId, String msg) {
-        printC(libId, msg + "\n");
+    public void printlnC(String msg) {
+        printC(msg + "\n");
     }
-    
-}
+}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Pointer.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Pointer.java
new file mode 100644 (file)
index 0000000..7cfec13
--- /dev/null
@@ -0,0 +1,94 @@
+package org.eclipse.linuxtools.lttng.jni;
+
+
+/**
+ * <b><u>Jni_C_Pointer</u></b>
+ * <p>
+ * Class pointer to handle properly "C pointer" <p>
+ * 
+ * Can transparently handle pointer of 32 or 64 bits.
+ */
+public class Jni_C_Pointer extends Jni_C_Common {
+
+    private long ptr = NULL;
+    private boolean isLong = true;
+    
+    /**
+     * Default constructor.<p>
+     * 
+     * Note : Pointer will be set to a 64bits "NULL".
+     */
+    public Jni_C_Pointer() {
+        ptr  = NULL;
+    }
+    
+    /**
+     * Constructor with parameters for 64bits pointers.
+     * 
+     * @param newPtr    long-converted (64 bits) C pointer.
+     */
+    public Jni_C_Pointer(long newPtr) {
+        ptr = newPtr;
+        isLong = true; 
+    }
+    
+    /**
+     * Constructor with parameters for 32bits pointers.
+     * 
+     * @param newPtr    int-converted (32 bits) C pointer.
+     */
+    public Jni_C_Pointer(int newPtr) {
+        ptr = (long)newPtr;
+        isLong = false; 
+    }
+    
+    /**
+     * Get the current pointer.
+     * 
+     * @return  The current pointer, in long.
+     */
+    public long getPointer() {
+        return ptr;
+    }
+    
+    /**
+     * Set the pointer, as a 64bits pointer.
+     * 
+     * @param newPtr    long-converted (64 bits) C pointer.
+     */
+    public void setPointer(long newPtr) {
+        ptr = newPtr;
+        isLong = true;
+    }
+    
+    /**
+     * Set the pointer, as a 64bits pointer.
+     * 
+     * @param newPtr    int-converted (32 bits) C pointer.
+     */
+    public void setPointer(int newPtr) {
+        ptr = newPtr;
+        isLong = false;
+    }
+
+    /**
+     * toString() method. <p>
+     * 
+     * Convert the pointer to a nice looking int/long hexadecimal format. 
+     * 
+     * @return Attributes of the object concatenated in String
+     */
+    @Override
+    public String toString() {
+        String returnData = "0x";
+
+        if (isLong == true) {
+            returnData += Long.toHexString(ptr);
+        }
+        else {
+            returnData += Integer.toHexString((int) ptr);
+        }
+
+        return returnData;
+    }
+}
index 5f9303da5c8cf4b51a3108b8d4e27cca3e8d2aa4..27960f4a2a0d4e0543f50e470a439fe2742a91e3 100644 (file)
@@ -1,15 +1,6 @@
 package org.eclipse.linuxtools.lttng.jni.common;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
+
+
 
 /**
  * <b><u>JniTime</u></b>
@@ -157,36 +148,6 @@ public class JniTime extends Jni_C_Constant implements Comparable<JniTime>
         }
     }
     
-    /**
-     * Overrided equals for JniTime type
-     * 
-     * @param The object we want to compare too
-     * 
-     * @return true if the time is the same, false otherwise.
-     */
-    @Override
-    public boolean equals(Object obj) {
-       boolean returnedValue = false;
-       
-       if ( obj instanceof JniTime ) {
-               if ( ((JniTime)obj).time == this.time ) {
-                       returnedValue = true;
-               }
-       }
-       
-       return returnedValue;
-    }
-    
-    /**
-     * Overridden hash code for JniTime type 
-     * 
-     */
-    @Override
-    public int hashCode() {
-       return this.toString().hashCode();
-    }
-    
-    
     /**
      * toString() method.
      * <u>Intended to debug</u><p>
index 5cf7a60aaf47fc5289b714e0c0bde3e508545e4a..652f80f4c12d82b1a5066ea0ddb9a3b137b7c6fb 100644 (file)
@@ -11,12 +11,11 @@ package org.eclipse.linuxtools.lttng.jni.common;
  *   William Bourque (wbourque@gmail.com) - Initial API and implementation
  *******************************************************************************/
 
+
 /**
  * <b><u>Jni_C_Common</u></b>
  * <p>
- * Common constants and methods that should be shared between JNI objects.<p>
- * 
- * This class is abstract and is intended to be extended by LTTng modules that need the constants.
+ * Common constants and methods that should be shared between JNI objects
  */
 public abstract class Jni_C_Constant {
     
@@ -31,12 +30,6 @@ public abstract class Jni_C_Constant {
     // Timestamps are in nanoseconds, this const ease up the math
     public static final long NANO = 1000000000;
     
-    /**
-     * Default constructor
-     */
-    public Jni_C_Constant() {
-    }
-    
     /**
      * "Alternate" .toString()<p>
      * 
index 3519dfe0489473b67f2ae75d78259e7df8a41adf..0d2d91c9420aec58ffd4c18f4a1e10cc832ed4ab 100644 (file)
@@ -1,15 +1,5 @@
 package org.eclipse.linuxtools.lttng.jni.common;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
+
 
 /**
  * <b><u>Jni_C_Pointer</u></b>
@@ -20,8 +10,8 @@ package org.eclipse.linuxtools.lttng.jni.common;
  */
 public class Jni_C_Pointer extends Jni_C_Constant {
 
-    protected long ptr = NULL;
-    protected boolean isLong = true;
+    private long ptr = NULL;
+    private boolean isLong = true;
     
     /**
      * Default constructor.<p>
index f87ef318a1caae3a9283d9284251ab9a9ec33abe..a63ac732af6589339aca2c3666381a4b6c95d945 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniEventException</u></b>
index ccd8b996fc2a9438e14392a0031ca9f0f8607778..e751ae9a07cd9e78d1e0272cb73dfea5b12aa593 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniEventOutOfRangeException</u></b>
index b6f009b92613dc76067fe948b2409fe80dc1e2ad..ed2e8a6e980daa51c6565fd92aa7be8a3c7bcc70 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniMarkerException</u></b>
index 123e4714c2b81bd5e4482efd1abd344edc2a60d5..fc78821b51db9fcfba25d988039d659d45640ed3 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniMarkerFieldException</u></b>
index 76aaa5e28ffb7788813f70c17d04e50ca2b40ac4..87c66b1e88b17cdaaa114e08421f5ce81bcaad76 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniNoNextEventInTraceException</u></b>
index 478d07953a4a453460b22af64b184c6d4b2ce31c..9317d6db08e4abff17058b3eb92f4c72d62cabd9 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniNoSuchEventException</u></b>
index 963f703b5fb8f9f67193ef0a3b323bbee1f7c395..9eb1ffc83f5048eb413da62a7ba11c537b767638 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniOpenTraceFailedException</u></b>
index b89cd0c78f4eab4c44b2d6eeabd9ae2a7cee0c98..c84162732fe7e2ee7c88557c1bf364f31114422d 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniTraceException</u></b>
index 2eb39165454443c1e591710d8f6edb099877e684..6d07a18e2a761cc75dfcb8bd5727b3ced69458c5 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniTraceVersionException</u></b>
index 54a26a73dd0bcaf8741f8181d4f50bfd1a1b9b76..1dc0d78347eb85ee4acd4d97246dafeb90be52cc 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniTracefileException</u></b>
index e8cc5227d695a0535389f3dbf677d234a98050ca..2af158d95d76309c225451f8920248b771cb3307 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.exception;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 /**
  * <b><u>JniTracefileWithoutEventException</u></b>
index ac1562833115e6af983b995cd9661b476c7b7a0d..01149613e84fc9777d77bf38eb58847eab893786 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni.factory;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniTrace;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
@@ -18,72 +7,45 @@ import org.eclipse.linuxtools.lttng.jni_v2_3.JniTrace_v2_3;
 import org.eclipse.linuxtools.lttng.jni_v2_5.JniTrace_v2_5;
 import org.eclipse.linuxtools.lttng.jni_v2_6.JniTrace_v2_6;
 
-/**
- * <b><u>JniTraceFactory</u></b>
- * <p>
- * This class factory is responsible of returning the correct JniTrace implementation from a (valid) trace path.<p>
- * 
- * The different version supported are listed below and the same version string are expected to be returned by JniTraceVersion.<br>
- * Each version need a different Lttv library so each need its liblttvtraceread-X.Y.so installed and available on the system.
- * 
- */
 public class JniTraceFactory {
        
-       // ***
-       // Version string of the supported library version
-       // These will be used in the switch below to find the correct version
-       // ***
        static final String TraceVersion_v2_3 = "2.3"; 
        static final String TraceVersion_v2_5 = "2.5";
        static final String TraceVersion_v2_6 = "2.6";
        
-       /*
-        * Default constructor is forbidden
-        */
        private JniTraceFactory(){
+               // Default constructor is forbidden
        }
        
-       /**
-        * Factory function : return the correct version of the JniTrace from a given path<p>
-        * NOTE : The correct Lttv library (liblttvtraceread-X.Y.so) need to be installed and accessible otherwise this
-        *                function will return an Exception. 
-        * 
-        * If the path is wrong or if the library is not supported (bad version or missing library) an Exception will be throwed. 
-        * 
-        * @param path                  Path of the trace we want to open
-        * @param show_debug    Should JniTrace print debug or not?
-        * 
-        * @return                              a newly allocated JniTrace of the correct version
-        * 
-        * @throws JniException
-        */
        static public JniTrace getJniTrace(String path, boolean show_debug) throws JniException {
                
                try {
                        JniTraceVersion traceVersion = new JniTraceVersion(path);
                        
-                       if ( traceVersion.getVersionAsString().equals(TraceVersion_v2_6) ) {
-                               return new JniTrace_v2_6(path, show_debug);
+                       if ( traceVersion.toString().equals(TraceVersion_v2_6) ) {
+                               return new JniTrace_v2_6(path);
                        }
-                       else if ( traceVersion.getVersionAsString().equals(TraceVersion_v2_5) ) {
-                               return new JniTrace_v2_5(path, show_debug);
+                       else if ( traceVersion.toString().equals(TraceVersion_v2_5) ) {
+                               return new JniTrace_v2_5(path);
                        }
-                       else if ( traceVersion.getVersionAsString().equals(TraceVersion_v2_3) ) {
-                               return new JniTrace_v2_3(path, show_debug);
+                       else if ( traceVersion.toString().equals(TraceVersion_v2_3) ) {
+                               return new JniTrace_v2_3(path);
                        }
                        else {
-                               String errMsg = "\nERROR : Unrecognized/unsupported trace version." +
-                                                               "\nLibrary reported a trace version " + traceVersion.getVersionAsString() + "." + 
-                                                               "\nMake sure you installed the Lttv library that support this version (look for liblttvtraceread-" + traceVersion.getVersionAsString() + ".so).\n"; 
-                               throw new JniException(errMsg);
+                               throw new JniException("ERROR : Unrecognized/unsupported trace version.");
                        }
                }
                catch (JniTraceVersionException e) {
-                       String errMsg = "\nERROR : Call to JniTraceVersion() failed." +
-                                                       "\nThis usually means that the library (liblttvtraceread_loader.so) could not be found." +
-                                                       "\nMake sure the LTTv library is installed and that your LD_LIBRARY_PATH is set correctly (see help for more details)\n.";
                        
-                       throw new JniException(errMsg);
+                       // *** FIXME ***
+                       // We should probably fail if the trace version can't be found, however unless
+                       //      the C library is ajusted, we will always ends up here. 
+                       // For now, we will default to the trace version 2.5 (what we use for unit tests) so it should still work. 
+                       // ***
+                       
+                       //throw new JniException("ERROR : Call to JniTraceVersion() failed.");
+                       System.out.println("WARNING : Call to JniTraceVersion() failed, defaulting to version 2.5.");
+                       return new JniTrace_v2_5(path);
                }
        }
        
index 4b1e6f0e292f9a3261772e1a649501fc8929fae0..9e2854faf6551481a9a24a9623bd63746ce73845 100644 (file)
 package org.eclipse.linuxtools.lttng.jni.factory;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
-import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 import org.eclipse.linuxtools.lttng.jni.exception.JniTraceVersionException;
 
-/**
- * <b><u>JniTraceVersion</u></b>
- * <p>
- * This class is responsible of returning the correct version number of a trace at a certain given path.<p>
- * 
- * The class will call the C library to get the correct version number from the trace.<p>
- * 
- * Lttv library loader (liblttvtraceread_loader.so) and the default Lttv library (liblttvtraceread.so) must be installed on system and available to java.
- * 
- */
+// *** FIXME ***
+// THIS IS A SKELETON IMPLEMENTATION
+// Nothing here will work as the C library does not support any of those call YET
+// ***
+
 public class JniTraceVersion {
        
-       // Native access functions
        protected native void ltt_getTraceVersion(String tracepath);
        
-       // Variables to store version number
-       private int majorNumber = 0;
-       private int minorNumber = 0;
-       
-       // To store the given tracepath
-       private String tracepath = "";
-       
-       // Was the trace read already?
-       private boolean wasTraceRead = false;
-       
-       /**
-        * Default constructor.<p>
-        * 
-        * Do nothing, readVersionFromTrace(path) will need to be called by the user
-        */
-       public JniTraceVersion() {
-               // Nothing to do 
-       }
-       
-       /**
-     * Constructor that takes a tracepath parameter.<p>
-     * 
-     * This constructor read the version number from the trace, so it might throw.
-     * 
-     * @param newTracepath             The <b>directory</b> of the trace to read.
-     * 
-     * @exception JniException If the library can not be loaded,if the path is wrong or if something go wrong during the read.
-     */
-       public JniTraceVersion(String newTracepath) throws JniTraceVersionException {
-               // Read the version number from the trace 
-               readVersionFromTrace(newTracepath);
+       static {
+               System.loadLibrary("lttvtraceread");
        }
        
-       /**
-     * Copy constructor.
-     * 
-     * @param oldVersion  A reference to the JniTraceVersion to copy.           
-     */
-       public JniTraceVersion(JniTraceVersion oldVersion) {
-               majorNumber = oldVersion.majorNumber;
-               minorNumber = oldVersion.minorNumber;
-       }
+       private int majorNumber = 0;
+       private int minorNumber = 0;
        
-       /*
-        * Read the version from the (already set) tracepath.<p>
-        * 
-        * This version is used internally and will silently dismiss any exceptions.
-        * 
-        */
-       private void readVersionNumberNofail() {
-               try {
-                       readVersionFromTrace(tracepath);
-               }
-               catch(JniTraceVersionException e) { 
-                       // Yes, we do ignore exception.
-               }
+       @SuppressWarnings("unused")
+       private JniTraceVersion() {
        }
        
-       /**
-        * Read the version from the (already set) tracepath.<p>
-        * 
-        * This function throw if the library can not be loaded, if the path is wrong or if something go wrong during the read.
-        * 
-        */
-       public void readVersionNumber() throws JniTraceVersionException {
-               readVersionFromTrace(tracepath);
+       public JniTraceVersion(int newMajor, int newMinor) {
+               majorNumber = newMajor;
+               minorNumber = newMinor;
        }
        
-       /**
-        * Read the version from a given tracepath.<p>
-        * MajorVersion and MinorVersion should be set after a successful execution of this function.<br>
-        * 
-        * This function throw if the library can not be loaded,if the path is wrong or if something go wrong during the read.
-        * 
-        */
-       public void readVersionFromTrace(String newTracepath) throws JniTraceVersionException {
-               
-               // Verify that the tracepath isn't obliviously wrong (null or empty)
-               if ( (newTracepath == null) || (newTracepath.equals("") ) ) {
-                       throw new JniTraceVersionException("ERROR : Tracepath is null or empty! (readVersionNumber)");
-               }
-               else {
-                       // Otherwise set the path in case it was changed
-                       tracepath = newTracepath;
-               }
-               
+       public JniTraceVersion(String tracepath) throws JniTraceVersionException {
                try {
-                       // Load the C library here. 
-                       // If LD_LIBRARY_PATH is not set correctly this will raise a java.lang.UnsatisfiedLinkError
-                       System.loadLibrary("lttvtraceread_loader");
-                       
-                       // Assuming the C library loaded correctly, call the JNI here.
                        ltt_getTraceVersion(tracepath);
-                       
-                       // We can now assume that the trace was read
-                       wasTraceRead = true;
                }
-               // The library was unable to load -> Lttv not installed or bad version of it? 
                catch (java.lang.UnsatisfiedLinkError e) {
-                       throw new JniTraceVersionException("\nERROR : Could not get trace version. Is the library missing?" +
-                                                                                          "\nMake sure your \"LD_LIBRARY_PATH\" is setted correctly (readVersionNumber)\n");
+                       throw new JniTraceVersionException("ERROR : Could not get trace version. Is the library missing?");
                }
-               // Something else failed -> Possibly a bad tracepath was given 
                catch (Exception e) {
-                       throw new JniTraceVersionException("\nERROR : Call to ltt_getTraceVersion failed. (readVersionNumber)\n");
+                       throw new JniTraceVersionException("ERROR : Call to ltt_getTraceVersion failed.");
                }
        }
        
-       /**
-        * Get major version number of the trace.<p>
-        * Note : readVersionFromTrace() will be called if it wasn't done but exception will be silently ignored.
-        * 
-        * @return major version
-        */
+       public JniTraceVersion(JniTraceVersion oldVersion) {
+               majorNumber = oldVersion.majorNumber;
+               minorNumber = oldVersion.minorNumber;
+       }
+       
        public int getMajor() {
-               if ( wasTraceRead == false ) {
-                       readVersionNumberNofail();
-               }
-               
                return majorNumber;
        }
        
-       /**
-        * Get minor version number of the trace.<p>
-        * Note : readVersionFromTrace() will be called if it wasn't done but exception will be silently ignored.
-        * 
-        * @return minor version
-        */
        public int getMinor() {
-               if ( wasTraceRead == false ) {
-                       readVersionNumberNofail();
-               }
-               
                return minorNumber;
        }
        
-       /**
-        * Get full version number of the trace.<p>
-        * Note : readVersionFromTrace() will be called if it wasn't done but exception will be silently ignored.
-        * 
-        * @return Full Version as float
-        */
-       public float getVersionAsFloat()  {
-               if ( wasTraceRead == false ) {
-                       readVersionNumberNofail();
-               }
-               
-               return ((float)majorNumber + ((float)minorNumber)/10);
-       }
-       
-       /**
-        * Get full version number of the trace.<p>
-        * Note : readVersionFromTrace() will be called if it wasn't done but exception will be silently ignored.
-        * 
-        * @return Full Version as string
-        */
-       public String getVersionAsString()  {
-               if ( wasTraceRead == false ) {
-                       readVersionNumberNofail();
-               }
-               
-               return majorNumber + "." + minorNumber;
-       }
-       
-       /**
-        * Get for the current tracepath
-        * 
-        * @return The tracepath was are currently using.
-        */
-       public String getTracepath() {
-               return tracepath;
-       }
-       
-       /**
-        * Set for the tracepath.<p>
-        * NOTE  : Changing this will reset the version number currently loaded.
-        * NOTE2 : readVersionFromTrace() will be called but exception will be silently ignored.
-        * 
-        * @param newtracepath The net tracepath
-        */
-       public void setTracepath(String newtracepath) {
-               majorNumber = 0;
-               minorNumber = 0;
-               wasTraceRead = false;
-               tracepath = newtracepath;
-               
-               // Call the read function. This will fill up all the number if it goes well.
-               readVersionNumberNofail();
-       }
-       
-       /*
-        * This function is be called from the C side to assign the version number the Java variable.
-        */
-       private void setTraceVersionFromC(int newMajor, int newMinor) {
+       @SuppressWarnings("unused")
+    private void setTraceVersionFromC(int newMajor, int newMinor) {
                majorNumber = newMajor;
                minorNumber = newMinor;
     }
        
-    
-       @Override
        public String toString() {
-               return "JniTraceVersion [" + majorNumber + "." + minorNumber + "]";
+               return majorNumber + "." + minorNumber;
        }
        
 }
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent.java
new file mode 100644 (file)
index 0000000..933b68c
--- /dev/null
@@ -0,0 +1,34 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+import java.util.HashMap;
+
+import org.eclipse.linuxtools.lttng.jni.JniMarker;
+import org.eclipse.linuxtools.lttng.jni.JniTracefile;
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniEvent extends org.eclipse.linuxtools.lttng.jni.JniEvent {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+       protected JniEvent() {
+               super();
+    }
+       
+       public JniEvent(JniEvent oldEvent) {
+               super(oldEvent);
+       }
+    
+    
+    
+    public JniEvent(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+       super(newEventPtr, newMarkersMap, newParentTracefile);
+    }
+       
+}
index ac6368eb8808126e03dec4d99f4206e4b2d27e71..63e1809db35560cd7d4941bdef46e642a7ade1eb 100644 (file)
@@ -1,46 +1,29 @@
 package org.eclipse.linuxtools.lttng.jni_v2_3;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import java.util.HashMap;
 
 import org.eclipse.linuxtools.lttng.jni.JniEvent;
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniEvent_v2_3</u></b>
- * <p>
- * JniEvent version to support Lttng traceformat of version 2.3<br>
- * This class extend abstract class JniEvent with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniEvent_v2_3 extends JniEvent {
+
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniEvent_v2_3() {
                super();
     }
        
-       
        public JniEvent_v2_3(JniEvent_v2_3 oldEvent) {
                super(oldEvent);
        }
     
-    public JniEvent_v2_3(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+    
+    
+    public JniEvent_v2_3(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
        super(newEventPtr, newMarkersMap, newParentTracefile);
     }
+
+       
 }
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker.java
new file mode 100644 (file)
index 0000000..f5df48b
--- /dev/null
@@ -0,0 +1,29 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniMarker extends org.eclipse.linuxtools.lttng.jni.JniMarker {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+       protected JniMarker() {
+               super();
+    }
+    
+    
+    public JniMarker(JniMarker oldMarker) {
+       super(oldMarker);
+    }
+    
+    
+    public JniMarker(Jni_C_Pointer newMarkerPtr) throws JniException {
+       super(newMarkerPtr);
+    }
+}
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField.java
new file mode 100644 (file)
index 0000000..0b756d7
--- /dev/null
@@ -0,0 +1,26 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniMarkerField extends org.eclipse.linuxtools.lttng.jni.JniMarkerField {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+       protected JniMarkerField() {
+               super();
+    }
+       
+       
+    public JniMarkerField(JniMarkerField oldMarkerField) {
+       super(oldMarkerField);
+    }
+    
+    
+    public JniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
+       super(newMarkerFieldPtr);
+    }
+       
+}
index c67e0a7de1f7c38486eeac48371d902246f4ae6d..468d6e64c84a8fcafb366d54b64aca24110a44e2 100644 (file)
@@ -1,32 +1,11 @@
 package org.eclipse.linuxtools.lttng.jni_v2_3;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniMarkerField_v2_3</u></b>
- * <p>
- * JniMarkerField version to support Lttng traceformat of version 2.3<br>
- * This class extend abstract class JniMarkerField with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniMarkerField_v2_3 extends JniMarkerField {
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniMarkerField_v2_3() {
                super();
     }
@@ -36,7 +15,9 @@ public class JniMarkerField_v2_3 extends JniMarkerField {
        super(oldMarkerField);
     }
     
-    public JniMarkerField_v2_3(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException {
+    
+    public JniMarkerField_v2_3(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
        super(newMarkerFieldPtr);
     }
+    
 }
index 58ca0655a27687f8bba9bdf33ff6009aa3ff87a7..85bba7a70ef08f70530d8e700a00a26b8c05a4a7 100644 (file)
@@ -1,33 +1,12 @@
 package org.eclipse.linuxtools.lttng.jni_v2_3;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniMarker_v2_3</u></b>
- * <p>
- * JniMarker version to support Lttng traceformat of version 2.3<br>
- * This class extend abstract class JniMarker with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniMarker_v2_3 extends JniMarker {
-       
-       /*
-        * Forbid access to the default constructor
-        */
+
        protected JniMarker_v2_3() {
                super();
     }
@@ -37,22 +16,13 @@ public class JniMarker_v2_3 extends JniMarker {
        super(oldMarker);
     }
     
-    public JniMarker_v2_3(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException {
+    
+    public JniMarker_v2_3(Jni_C_Pointer newMarkerPtr) throws JniException {
        super(newMarkerPtr);
     }
        
     
-    /**
-     * Allocate (call constructor for) a new JniMarkerField.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniMarker
-     * 
-     * @return JniMarkerField  a newly allocated JniMarkerField
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
-     */
-    @Override
-       public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException {
+    public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
        return new JniMarkerField_v2_3(newMarkerFieldPtr);
     }
     
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniParser.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniParser.java
new file mode 100644 (file)
index 0000000..272134d
--- /dev/null
@@ -0,0 +1,12 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+public class JniParser extends org.eclipse.linuxtools.lttng.jni.JniParser {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+       protected JniParser() {
+               super();
+    }
+}
index d00636e4be5232c3058208f212ad95618e1c15ea..675ffc1f599762f3c930d338931db5795e98796a 100644 (file)
@@ -1,30 +1,9 @@
 package org.eclipse.linuxtools.lttng.jni_v2_3;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniParser;
 
-/**
- * <b><u>JniParser_v2_3</u></b>
- * <p>
- * JniParser version to support Lttng traceformat of version 2.3<br>
- * This class extend abstract class JniParser with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniParser_v2_3 extends JniParser {
-       
-       /*
-        * Forbid access to the default constructor
-        */
+
        protected JniParser_v2_3() {
                super();
     }
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTime.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTime.java
new file mode 100644 (file)
index 0000000..b2db2d6
--- /dev/null
@@ -0,0 +1,26 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+
+public class JniTime extends org.eclipse.linuxtools.lttng.jni.JniTime {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+       public JniTime() {
+        super();
+    }
+       
+    public JniTime(JniTime oldTime) {
+       super(oldTime);
+    }
+
+    public JniTime(long newSec, long newNanoSec) {
+       super(newNanoSec);
+    }
+
+    public JniTime(long newNanoSecTime) {
+       super(newNanoSecTime);
+    }
+       
+}
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace.java
new file mode 100644 (file)
index 0000000..d487def
--- /dev/null
@@ -0,0 +1,35 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileWithoutEventException;
+import org.eclipse.linuxtools.lttng.jni_v2_3.JniTracefile;
+import org.eclipse.linuxtools.lttng.jni_v2_3.Jni_C_Pointer;
+
+public class JniTrace extends org.eclipse.linuxtools.lttng.jni.JniTrace {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+       protected JniTrace() {
+               super();
+    }
+       
+    public JniTrace(String newpath, boolean newPrintDebug) throws JniException {
+       super(newpath, newPrintDebug);
+    }
+    
+    
+    public JniTrace(JniTrace oldTrace) {
+       super(oldTrace);
+    }        
+    
+    public JniTrace(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException {
+       super(newPtr, newPrintDebug);
+    }
+    
+    protected JniTracefile createNewTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
+       return new JniTracefile(newPtr, newParentTrace);
+    }
+    
+}
index 5794d57dc5ff443b2c66c2c38d4a8a9a6a98e412..1b364cfc6d0c6f22d65b70eb3e82711553ec4b4d 100644 (file)
@@ -1,45 +1,22 @@
 package org.eclipse.linuxtools.lttng.jni_v2_3;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniTrace;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniTrace_v2_3</u></b>
- * <p>
- * JniTrace version to support Lttng traceformat of version 2.3.<br>
- * This class extend abstract class JniTrace with (possibly) version specific implementation.<br>
- *  
- * It also make sure the correct library is loaded by liblttvlibraryloader.so 
- * <p>
- */
 public class JniTrace_v2_3 extends JniTrace {
        
-       // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load.
-       // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path.
-       //      The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. 
-       private static final String LIBRARY_NAME = "liblttvtraceread-2.3.so";
+       // *** FIXME ***
+       // Eventually, it should be something like this :
+       //      private static final String LIBRARY_NAME = "liblttvtraceread2.3.so";
+       // However, the C library is not ready yet, so we will keep the general one : 
+       private static final String LIBRARY_NAME = "liblttvtraceread.so";
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniTrace_v2_3() {
                super();
     }
     
-       
        public JniTrace_v2_3(String newpath) throws JniException {
                super(newpath);
        }
@@ -53,35 +30,20 @@ public class JniTrace_v2_3 extends JniTrace {
        super(oldTrace);
     }        
     
-    public JniTrace_v2_3(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException {
+    public JniTrace_v2_3(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException {
        super(newPtr, newPrintDebug);
     }
     
     
-    /**
-     * Initialize the C library.<p>
-     * 
-     * Call the library loader with the .so we wish to load.
-     * 
-     * @return         The library id if sucessful, -1 if something went wrong
-     */
-    @Override
-       public int initializeLibrary() {
+    public boolean initializeLibrary() {
        return ltt_initializeHandle(LIBRARY_NAME);
     }
     
     
-    /**
-     * Allocate (call constructor for) a new JniTracefile.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTrace
-     * 
-     * @return JniTracefile    a newly allocated JniTracefile
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTrace
-     */
-    @Override
-       public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException {
+    public JniTracefile allocateNewJniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
        return new JniTracefile_v2_3(newPtr, newParentTrace);
     }
+    
+    
+    
 }
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile.java
new file mode 100644 (file)
index 0000000..a05b4a3
--- /dev/null
@@ -0,0 +1,25 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+import org.eclipse.linuxtools.lttng.jni.JniTrace;
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniTracefile extends org.eclipse.linuxtools.lttng.jni.JniTracefile {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+    protected JniTracefile() {
+       super();
+    }
+    
+    public JniTracefile(JniTracefile oldTracefile) {
+       super(oldTracefile);
+    }
+    
+    public JniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
+       super(newPtr, newParentTrace);
+    }     
+       
+}
index 44254572b4056828ff2e8ec48322a0b98ef78c43..4c645eff946ce22fa30ca8f0ec49b74c51163ecc 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni_v2_3;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import java.util.HashMap;
 
@@ -17,61 +6,31 @@ import org.eclipse.linuxtools.lttng.jni.JniEvent;
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniTrace;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniTracefile_v2_3</u></b>
- * <p>
- * JniTracefile version to support Lttng traceformat of version 2.3<br>
- * This class extend abstract class JniTracefile with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniTracefile_v2_3 extends JniTracefile {
        
-       /*
-        * Forbid access to the default constructor
-        */
     protected JniTracefile_v2_3() {
        super();
     }
     
-    
     public JniTracefile_v2_3(JniTracefile_v2_3 oldTracefile) {
        super(oldTracefile);
     }
     
-    public JniTracefile_v2_3(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException {
+    public JniTracefile_v2_3(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
        super(newPtr, newParentTrace);
     }
        
     
-    /**
-     * Allocate (call constructor for) a new JniEvent.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTracefile
-     * 
-     * @return JniEvent        a newly allocated JniEvent
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     */
-    @Override
-       public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+    public JniEvent allocateNewJniEvent(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
        return new JniEvent_v2_3(newEventPtr, newMarkersMap, newParentTracefile);
     }
     
     
-    /**
-     * Allocate (call constructor for) a new JniMarker.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTracefile
-     * 
-     * @return JniMarker       a newly allocated JniMarker
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     */
-    @Override
-       public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException {
+    public JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException {
        return new JniMarker_v2_3(newMarkerPtr);
     }
+    
 }
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/Jni_C_Common_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/Jni_C_Common_v2_3.java
new file mode 100644 (file)
index 0000000..78df570
--- /dev/null
@@ -0,0 +1,9 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+public class Jni_C_Common_v2_3 extends org.eclipse.linuxtools.lttng.jni.Jni_C_Common {
+
+       static {
+               System.loadLibrary("lttvtraceread2.3");
+       }
+       
+}
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/Jni_C_Pointer.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/Jni_C_Pointer.java
new file mode 100644 (file)
index 0000000..5b2376a
--- /dev/null
@@ -0,0 +1,17 @@
+package org.eclipse.linuxtools.lttng.jni_v2_3;
+
+public class Jni_C_Pointer extends org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer {
+       
+       public Jni_C_Pointer() {
+        super();
+    }
+    
+    public Jni_C_Pointer(long newPtr) {
+        super(newPtr);
+    }
+    
+    public Jni_C_Pointer(int newPtr) {
+       super(newPtr);
+    }
+       
+}
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent.java
new file mode 100644 (file)
index 0000000..fca144d
--- /dev/null
@@ -0,0 +1,31 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+import java.util.HashMap;
+
+import org.eclipse.linuxtools.lttng.jni.JniMarker;
+import org.eclipse.linuxtools.lttng.jni.JniTracefile;
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniEvent extends org.eclipse.linuxtools.lttng.jni.JniEvent {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+       protected JniEvent() {
+               super();
+    }
+       
+       public JniEvent(JniEvent oldEvent) {
+               super(oldEvent);
+       }
+    
+    
+    
+    public JniEvent(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+       super(newEventPtr, newMarkersMap, newParentTracefile);
+    }
+
+       
+}
index 26d2563013e60682560e000a275b634dfb41f2a4..046dd456c30f0ae61ed62e8ddbe96c5e03132d5a 100644 (file)
@@ -1,46 +1,29 @@
 package org.eclipse.linuxtools.lttng.jni_v2_5;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import java.util.HashMap;
 
 import org.eclipse.linuxtools.lttng.jni.JniEvent;
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniEvent_v2_5</u></b>
- * <p>
- * JniEvent version to support Lttng traceformat of version 2.5<br>
- * This class extend abstract class JniEvent with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniEvent_v2_5 extends JniEvent {
+
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniEvent_v2_5() {
                super();
     }
        
-       
        public JniEvent_v2_5(JniEvent_v2_5 oldEvent) {
                super(oldEvent);
        }
     
-    public JniEvent_v2_5(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+    
+    
+    public JniEvent_v2_5(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
        super(newEventPtr, newMarkersMap, newParentTracefile);
     }
+
+       
 }
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker.java
new file mode 100644 (file)
index 0000000..c60177c
--- /dev/null
@@ -0,0 +1,26 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniMarker extends org.eclipse.linuxtools.lttng.jni.JniMarker {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+       protected JniMarker() {
+               super();
+    }
+    
+    
+    public JniMarker(JniMarker oldMarker) {
+       super(oldMarker);
+    }
+    
+    
+    public JniMarker(Jni_C_Pointer newMarkerPtr) throws JniException {
+       super(newMarkerPtr);
+    }
+       
+}
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField.java
new file mode 100644 (file)
index 0000000..77102ac
--- /dev/null
@@ -0,0 +1,27 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniMarkerField extends org.eclipse.linuxtools.lttng.jni.JniMarkerField {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+       
+       protected JniMarkerField() {
+               super();
+    }
+       
+       
+    public JniMarkerField(JniMarkerField oldMarkerField) {
+       super(oldMarkerField);
+    }
+    
+    
+    public JniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
+       super(newMarkerFieldPtr);
+    }
+    
+}
index 8900dff6e4e69bbfa6668051a100e3e616f0871f..0ebcb14f7809751eef0cee47f3ba66f410be968b 100644 (file)
@@ -1,32 +1,11 @@
 package org.eclipse.linuxtools.lttng.jni_v2_5;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniMarkerField_v2_5</u></b>
- * <p>
- * JniMarkerField version to support Lttng traceformat of version 2.5<br>
- * This class extend abstract class JniMarkerField with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniMarkerField_v2_5 extends JniMarkerField {
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniMarkerField_v2_5() {
                super();
     }
@@ -36,7 +15,9 @@ public class JniMarkerField_v2_5 extends JniMarkerField {
        super(oldMarkerField);
     }
     
-    public JniMarkerField_v2_5(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException {
+    
+    public JniMarkerField_v2_5(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
        super(newMarkerFieldPtr);
     }
+    
 }
index d7dafc09a868d08b4fa587c2ac5b556145412fda..0ff3acde8731fea7697713e6901f805a997201e2 100644 (file)
@@ -1,58 +1,28 @@
 package org.eclipse.linuxtools.lttng.jni_v2_5;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniMarker_v2_5</u></b>
- * <p>
- * JniMarker version to support Lttng traceformat of version 2.5<br>
- * This class extend abstract class JniMarker with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniMarker_v2_5 extends JniMarker {
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniMarker_v2_5() {
                super();
     }
     
-       
+    
     public JniMarker_v2_5(JniMarker_v2_5 oldMarker) {
        super(oldMarker);
     }
     
-    public JniMarker_v2_5(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException {
+    
+    public JniMarker_v2_5(Jni_C_Pointer newMarkerPtr) throws JniException {
        super(newMarkerPtr);
     }
        
     
-    /**
-     * Allocate (call constructor for) a new JniMarkerField.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniMarker
-     * 
-     * @return JniMarkerField  a newly allocated JniMarkerField
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
-     */
-    @Override
-       public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException {
+    public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
        return new JniMarkerField_v2_5(newMarkerFieldPtr);
     }
     
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniParser.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniParser.java
new file mode 100644 (file)
index 0000000..762e4f3
--- /dev/null
@@ -0,0 +1,12 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+public class JniParser extends org.eclipse.linuxtools.lttng.jni.JniParser {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+       protected JniParser() {
+               super();
+    }
+}
index 81a62cbb77caa91134acb16ca3c6ee02c01c7d7b..d8f05b2e0b2e840c893fed8d5a8736746385b460 100644 (file)
@@ -1,30 +1,9 @@
 package org.eclipse.linuxtools.lttng.jni_v2_5;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniParser;
 
-/**
- * <b><u>JniParser_v2_5</u></b>
- * <p>
- * JniParser version to support Lttng traceformat of version 2.5<br>
- * This class extend abstract class JniParser with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniParser_v2_5 extends JniParser {
-       
-       /*
-        * Forbid access to the default constructor
-        */
+
        protected JniParser_v2_5() {
                super();
     }
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTime.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTime.java
new file mode 100644 (file)
index 0000000..1ddd0b0
--- /dev/null
@@ -0,0 +1,25 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+public class JniTime extends org.eclipse.linuxtools.lttng.jni.JniTime {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+       public JniTime() {
+        super();
+    }
+       
+    public JniTime(JniTime oldTime) {
+       super(oldTime);
+    }
+
+    public JniTime(long newSec, long newNanoSec) {
+       super(newNanoSec);
+    }
+
+    public JniTime(long newNanoSecTime) {
+       super(newNanoSecTime);
+    }
+       
+}
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace.java
new file mode 100644 (file)
index 0000000..b6d647e
--- /dev/null
@@ -0,0 +1,31 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileWithoutEventException;
+import org.eclipse.linuxtools.lttng.jni_v2_3.JniTracefile;
+
+public class JniTrace extends org.eclipse.linuxtools.lttng.jni.JniTrace {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+       protected JniTrace() {
+               super();
+    }
+    
+       
+    public JniTrace(String newpath, boolean newPrintDebug) throws JniException {
+       super(newpath, newPrintDebug);
+    }
+    
+    
+    public JniTrace(JniTrace oldTrace) {
+       super(oldTrace);
+    }        
+    
+    public JniTrace(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException {
+       super(newPtr, newPrintDebug);
+    }
+}
index ebea39f8772195a79e38a73d9f0ffb93a0faffcf..3d94259bc5047630622413c99c245a1b0e5214c9 100644 (file)
@@ -1,45 +1,22 @@
 package org.eclipse.linuxtools.lttng.jni_v2_5;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniTrace;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniTrace_v2_5</u></b>
- * <p>
- * JniTrace version to support Lttng traceformat of version 2.5.<br>
- * This class extend abstract class JniTrace with (possibly) version specific implementation (none yet).<br>
- *  
- * It also make sure the correct library is loaded by liblttvlibraryloader.so 
- * <p>
- */
 public class JniTrace_v2_5 extends JniTrace {
        
-       // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load.
-       // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path.
-       //      The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. 
-       private static final String LIBRARY_NAME = "liblttvtraceread-2.5.so";
+       // *** FIXME ***
+       // Eventually, it should be something like this :
+       //      private static final String LIBRARY_NAME = "liblttvtraceread2.5.so";
+       // However, the C library is not ready yet, so we will keep the general one : 
+       private static final String LIBRARY_NAME = "liblttvtraceread.so";
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniTrace_v2_5() {
                super();
     }
     
-       
        public JniTrace_v2_5(String newpath) throws JniException {
                super(newpath);
        }
@@ -53,34 +30,16 @@ public class JniTrace_v2_5 extends JniTrace {
        super(oldTrace);
     }        
     
-    public JniTrace_v2_5(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException {
+    public JniTrace_v2_5(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException {
        super(newPtr, newPrintDebug);
     }
     
     
-    /**
-     * Initialize the C library.<p>
-     * 
-     * Call the library loader with the .so we wish to load.
-     * 
-     * @return         True if the load went successful, false otherwise.
-     */
-    @Override
-       public int initializeLibrary() {
+    public boolean initializeLibrary() {
        return ltt_initializeHandle(LIBRARY_NAME);
     }
     
-    /**
-     * Allocate (call constructor for) a new JniTracefile.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTrace
-     * 
-     * @return JniTracefile    a newly allocated JniTracefile
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTrace
-     */
-    @Override
-       public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException {
+    public JniTracefile allocateNewJniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
        return new JniTracefile_v2_5(newPtr, newParentTrace);
     }
     
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile.java
new file mode 100644 (file)
index 0000000..0136c7b
--- /dev/null
@@ -0,0 +1,25 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+import org.eclipse.linuxtools.lttng.jni.JniTrace;
+import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+
+public class JniTracefile extends org.eclipse.linuxtools.lttng.jni.JniTracefile {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+       
+    protected JniTracefile() {
+       super();
+    }
+    
+    public JniTracefile(JniTracefile oldTracefile) {
+       super(oldTracefile);
+    }
+    
+    public JniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
+       super(newPtr, newParentTrace);
+    }   
+       
+}
index 6d63a22edde37a4c67b3a8c0a32facae0fb33561..6f4518bf474767536618f68b75653dcad7726dbe 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni_v2_5;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import java.util.HashMap;
 
@@ -17,61 +6,30 @@ import org.eclipse.linuxtools.lttng.jni.JniEvent;
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniTrace;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniTracefile_v2_5</u></b>
- * <p>
- * JniTracefile version to support Lttng traceformat of version 2.5<br>
- * This class extend abstract class JniTracefile with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniTracefile_v2_5 extends JniTracefile {
        
-       /*
-        * Forbid access to the default constructor
-        */
     protected JniTracefile_v2_5() {
        super();
     }
     
-    
     public JniTracefile_v2_5(JniTracefile_v2_5 oldTracefile) {
        super(oldTracefile);
     }
     
-    public JniTracefile_v2_5(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException {
+    public JniTracefile_v2_5(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
        super(newPtr, newParentTrace);
     }
        
     
-    /**
-     * Allocate (call constructor for) a new JniEvent.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTracefile
-     * 
-     * @return JniEvent        a newly allocated JniEvent
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     */
-    @Override
-       public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+    public JniEvent allocateNewJniEvent(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
        return new JniEvent_v2_5(newEventPtr, newMarkersMap, newParentTracefile);
     }
     
     
-    /**
-     * Allocate (call constructor for) a new JniMarker.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTracefile
-     * 
-     * @return JniMarker       a newly allocated JniMarker
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     */
-    @Override
-       public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException {
+    public JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException {
        return new JniMarker_v2_5(newMarkerPtr);
     }
     
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/Jni_C_Common.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/Jni_C_Common.java
new file mode 100644 (file)
index 0000000..73491b0
--- /dev/null
@@ -0,0 +1,9 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+public class Jni_C_Common extends org.eclipse.linuxtools.lttng.jni.Jni_C_Common {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+
+}
diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/Jni_C_Pointer.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/Jni_C_Pointer.java
new file mode 100644 (file)
index 0000000..0513309
--- /dev/null
@@ -0,0 +1,9 @@
+package org.eclipse.linuxtools.lttng.jni_v2_5;
+
+public class Jni_C_Pointer extends org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer {
+
+       static {
+               System.loadLibrary("lttvtraceread2.5");
+       }
+
+}
index 9c2bd459204de6a45bb4a0531187afca109ac15e..8477403fccbb0272c8df882f4b7c697cdba880fe 100644 (file)
@@ -1,46 +1,27 @@
 package org.eclipse.linuxtools.lttng.jni_v2_6;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import java.util.HashMap;
 
 import org.eclipse.linuxtools.lttng.jni.JniEvent;
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniEvent_v2_6</u></b>
- * <p>
- * JniEvent version to support Lttng traceformat of version 2.6<br>
- * This class extend abstract class JniEvent with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniEvent_v2_6 extends JniEvent {
+
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniEvent_v2_6() {
                super();
     }
        
-       
        public JniEvent_v2_6(JniEvent_v2_6 oldEvent) {
                super(oldEvent);
        }
     
-    public JniEvent_v2_6(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+    
+    
+    public JniEvent_v2_6(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
        super(newEventPtr, newMarkersMap, newParentTracefile);
     }
 
index cdff84ac60f4fb287a0b5252813f2af3d919ce02..67d4dc2d6cfb16c799b8f5f57760d734044079fa 100644 (file)
@@ -1,32 +1,11 @@
 package org.eclipse.linuxtools.lttng.jni_v2_6;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniMarkerField_v2_6</u></b>
- * <p>
- * JniMarkerField version to support Lttng traceformat of version 2.6<br>
- * This class extend abstract class JniMarkerField with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniMarkerField_v2_6 extends JniMarkerField {
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniMarkerField_v2_6() {
                super();
     }
@@ -36,7 +15,9 @@ public class JniMarkerField_v2_6 extends JniMarkerField {
        super(oldMarkerField);
     }
     
-    public JniMarkerField_v2_6(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException {
+    
+    public JniMarkerField_v2_6(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
        super(newMarkerFieldPtr);
     }
+    
 }
index 34ecf1f5f254a0f7af4fae66855c2f6d1172cff8..f20a3cd4da0a1e50ba8368363f597ed18aebe31d 100644 (file)
@@ -1,58 +1,29 @@
 package org.eclipse.linuxtools.lttng.jni_v2_6;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniMarker_v2_6</u></b>
- * <p>
- * JniMarker version to support Lttng traceformat of version 2.6<br>
- * This class extend abstract class JniMarker with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniMarker_v2_6 extends JniMarker {
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniMarker_v2_6() {
                super();
     }
     
-       
+    
     public JniMarker_v2_6(JniMarker_v2_6 oldMarker) {
        super(oldMarker);
     }
     
-    public JniMarker_v2_6(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException {
+    
+    public JniMarker_v2_6(Jni_C_Pointer newMarkerPtr) throws JniException {
        super(newMarkerPtr);
     }
        
     
-    /**
-     * Allocate (call constructor for) a new JniMarkerField.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniMarker
-     * 
-     * @return JniMarkerField  a newly allocated JniMarkerField
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniMarker
-     */
-    @Override
-       public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException {
+    public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException {
        return new JniMarkerField_v2_6(newMarkerFieldPtr);
     }
+    
 }
index 4d3bc77e92019025b828457424e7f65dbfca5013..e6922bdf0d18ab12a798730038b4dd5a4a148efe 100644 (file)
@@ -1,30 +1,9 @@
 package org.eclipse.linuxtools.lttng.jni_v2_6;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniParser;
 
-/**
- * <b><u>JniParser_v2_6</u></b>
- * <p>
- * JniParser version to support Lttng traceformat of version 2.6<br>
- * This class extend abstract class JniParser with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniParser_v2_6 extends JniParser {
-       
-       /*
-        * Forbid access to the default constructor
-        */
+
        protected JniParser_v2_6() {
                super();
     }
index 5339456548f2f1432a297905a71fe68aeb5fc142..85c3c1f000520e30c989f6fcd1b2f8954a3fc162 100644 (file)
@@ -1,45 +1,22 @@
 package org.eclipse.linuxtools.lttng.jni_v2_6;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import org.eclipse.linuxtools.lttng.jni.JniTrace;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniTrace_v2_6</u></b>
- * <p>
- * JniTrace version to support Lttng traceformat of version 2.6.<br>
- * This class extend abstract class JniTrace with (possibly) version specific implementation (none yet).<br>
- *  
- * It also make sure the correct library is loaded by liblttvlibraryloader.so 
- * <p>
- */
 public class JniTrace_v2_6 extends JniTrace {
        
-       // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load.
-       // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path.
-       //      The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. 
-       private static final String LIBRARY_NAME = "liblttvtraceread-2.6.so";
+       // *** FIXME ***
+       // Eventually, it should be something like this :
+       //      private static final String LIBRARY_NAME = "liblttvtraceread2.6.so";
+       // However, the C library is not ready yet, so we will keep the general one : 
+       private static final String LIBRARY_NAME = "liblttvtraceread.so";
        
-       /*
-        * Forbid access to the default constructor
-        */
        protected JniTrace_v2_6() {
                super();
     }
     
-       
        public JniTrace_v2_6(String newpath) throws JniException {
                super(newpath);
        }
@@ -48,39 +25,24 @@ public class JniTrace_v2_6 extends JniTrace {
        super(newpath, newPrintDebug);
     }
     
+    
     public JniTrace_v2_6(JniTrace_v2_6 oldTrace) {
        super(oldTrace);
     }        
     
-    public JniTrace_v2_6(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException {
+    public JniTrace_v2_6(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException {
        super(newPtr, newPrintDebug);
     }
     
     
-    /**
-     * Initialize the C library.<p>
-     * 
-     * Call the library loader with the .so we wish to load.
-     * 
-     * @return         True if the load went successful, false otherwise.
-     */
-    @Override
-       public int initializeLibrary() {
+    public boolean initializeLibrary() {
        return ltt_initializeHandle(LIBRARY_NAME);
     }
     
-    
-    /**
-     * Allocate (call constructor for) a new JniTracefile.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTrace
-     * 
-     * @return JniTracefile    a newly allocated JniTracefile
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTrace
-     */
-    @Override
-       public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException {
+    public JniTracefile allocateNewJniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
        return new JniTracefile_v2_6(newPtr, newParentTrace);
     }
+    
+    
+    
 }
index 2aeebaa28a57115869c53ec185090714f42c0f01..6404ae41b7da56c9422cc58f6a75263da72a8b82 100644 (file)
@@ -1,15 +1,4 @@
 package org.eclipse.linuxtools.lttng.jni_v2_6;
-/*******************************************************************************
- * Copyright (c) 2009 Ericsson
- * 
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *   William Bourque (wbourque@gmail.com) - Initial API and implementation
- *******************************************************************************/
 
 import java.util.HashMap;
 
@@ -17,61 +6,30 @@ import org.eclipse.linuxtools.lttng.jni.JniEvent;
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniTrace;
 import org.eclipse.linuxtools.lttng.jni.JniTracefile;
-import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id;
+import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer;
 import org.eclipse.linuxtools.lttng.jni.exception.JniException;
 
-/**
- * <b><u>JniTracefile_v2_6</u></b>
- * <p>
- * JniTracefile version to support Lttng traceformat of version 2.6<br>
- * This class extend abstract class JniTracefile with (possibly) version specific implementation.<br>
- * <p>
- */
 public class JniTracefile_v2_6 extends JniTracefile {
        
-       /*
-        * Forbid access to the default constructor
-        */
     protected JniTracefile_v2_6() {
        super();
     }
     
-    
     public JniTracefile_v2_6(JniTracefile_v2_6 oldTracefile) {
        super(oldTracefile);
     }
     
-    public JniTracefile_v2_6(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException {
+    public JniTracefile_v2_6(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException {
        super(newPtr, newParentTrace);
     }
        
     
-    /**
-     * Allocate (call constructor for) a new JniEvent.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTracefile
-     * 
-     * @return JniEvent        a newly allocated JniEvent
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     */
-    @Override
-       public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
+    public JniEvent allocateNewJniEvent(Jni_C_Pointer newEventPtr, HashMap<Integer, JniMarker> newMarkersMap, JniTracefile newParentTracefile) throws JniException {
        return new JniEvent_v2_6(newEventPtr, newMarkersMap, newParentTracefile);
     }
     
     
-    /**
-     * Allocate (call constructor for) a new JniMarker.<p>
-     * 
-     * This method is made to bypass limitation related to abstract class, see comment in JniTracefile
-     * 
-     * @return JniMarker       a newly allocated JniMarker
-     * 
-     * @see org.eclipse.linuxtools.lttng.jni.JniTracefile
-     */
-    @Override
-       public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException {
+    public JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException {
        return new JniMarker_v2_6(newMarkerPtr);
     }
     
This page took 0.090944 seconds and 5 git commands to generate.