From c85e8cb280ae57f44d7635a08cd5c5af5d9cb481 Mon Sep 17 00:00:00 2001 From: William Bourque Date: Mon, 19 Apr 2010 22:21:22 +0000 Subject: [PATCH] Big change in JNI to support multiple trace version in the same Experiment. To use this, the latest C library is needed --- .../linuxtools/lttng/jni/JniEvent.java | 89 +++++----- .../linuxtools/lttng/jni/JniMarker.java | 61 +++---- .../linuxtools/lttng/jni/JniMarkerField.java | 44 ++--- .../linuxtools/lttng/jni/JniParser.java | 8 +- .../linuxtools/lttng/jni/JniTrace.java | 135 ++++++++------- .../linuxtools/lttng/jni/JniTracefile.java | 159 +++++++++--------- .../linuxtools/lttng/jni/Jni_C_Common.java | 16 +- .../lttng/jni/common/Jni_C_Pointer.java | 4 +- .../lttng/jni_v2_3/JniEvent_v2_3.java | 4 +- .../lttng/jni_v2_3/JniMarkerField_v2_3.java | 4 +- .../lttng/jni_v2_3/JniMarker_v2_3.java | 6 +- .../lttng/jni_v2_3/JniTrace_v2_3.java | 9 +- .../lttng/jni_v2_3/JniTracefile_v2_3.java | 7 +- .../lttng/jni_v2_5/JniEvent_v2_5.java | 4 +- .../lttng/jni_v2_5/JniMarkerField_v2_5.java | 4 +- .../lttng/jni_v2_5/JniMarker_v2_5.java | 6 +- .../lttng/jni_v2_5/JniTrace_v2_5.java | 8 +- .../lttng/jni_v2_5/JniTracefile_v2_5.java | 8 +- .../lttng/jni_v2_6/JniEvent_v2_6.java | 4 +- .../lttng/jni_v2_6/JniMarkerField_v2_6.java | 4 +- .../lttng/jni_v2_6/JniMarker_v2_6.java | 6 +- .../lttng/jni_v2_6/JniTrace_v2_6.java | 8 +- .../lttng/jni_v2_6/JniTracefile_v2_6.java | 8 +- 23 files changed, 288 insertions(+), 318 deletions(-) diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java index e620c4d75c..bb86731f9c 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java @@ -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; +import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; import org.eclipse.linuxtools.lttng.jni.exception.JniEventException; import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.exception.JniNoSuchEventException; @@ -37,14 +37,15 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniNoSuchEventException; * This class is ABSTRACT, you need to extends it to support your specific LTTng version.

* */ -public abstract class JniEvent extends Jni_C_Common implements Comparable { +public abstract class JniEvent extends Jni_C_Common implements Comparable +{ // 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 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 thisEventPtr = new Jni_C_Pointer(); + private Jni_C_Pointer_And_Library_Id thisEventPtr = new Jni_C_Pointer_And_Library_Id(); // Reference to the parent tracefile private JniTracefile parentTracefile = null; @@ -57,33 +58,34 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable newMarkersMap, JniTracefile newParentTracefile) throws JniException { - + public JniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + // Basic test to make sure we didn't get null/empty value if ((newEventPtr.getPointer() == NULL) || (newMarkersMap == null) @@ -163,7 +165,7 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable getMarkersMap() { @@ -368,10 +370,10 @@ public abstract class JniEvent extends Jni_C_Common implements Comparable - * - * This function will not throw but will complain loudly if pointer is NULL. */ public void printEventInformation() { - - // If null pointer, print a warning! - if (thisEventPtr.getPointer() == NULL) { - printlnC("Pointer is NULL, cannot print. (printEventInformation)"); - } - else { - ltt_printEvent(thisEventPtr.getPointer()); - } + ltt_printEvent(thisEventPtr.getLibraryId(), thisEventPtr.getPointer()); } /** diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarker.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarker.java index f6b1fb8ac0..00029641b8 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarker.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarker.java @@ -11,11 +11,10 @@ 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; +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.JniMarkerException; @@ -42,7 +41,7 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniMarkerException; public abstract class JniMarker extends Jni_C_Common { // Internal C pointer of the JniEvent used in LTT - private Jni_C_Pointer thisMarkerPtr = new Jni_C_Pointer(); + private Jni_C_Pointer_And_Library_Id thisMarkerPtr = new Jni_C_Pointer_And_Library_Id(); private String name = ""; private String formatOverview = ""; @@ -54,20 +53,20 @@ public abstract class JniMarker extends Jni_C_Common private ArrayList markerFieldsArrayList = null; // Native access method - protected native String ltt_getName(long markerPtr); - protected native String ltt_getFormatOverview(long markerPtr); - protected native long ltt_getSize(long markerPtr); - protected native short ltt_getLargestAlign(long markerPtr); - protected native short ltt_getIntSize(long markerPtr); - protected native short ltt_getLongSize(long markerPtr); - protected native short ltt_getPointerSize(long markerPtr); - protected native short ltt_getSize_tSize(long markerPtr); - protected native void ltt_getAllMarkerFields(long tracePtr); - protected native short ltt_getAlignement(long markerPtr); - protected native long ltt_getNextMarkerPtr(long markerPtr); + 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); // Debug native function, ask LTT to print marker structure - protected native void ltt_printMarker(long markerPtr); + protected native void ltt_printMarker(int libId, long markerPtr); /* * Default constructor is forbidden @@ -96,7 +95,7 @@ public abstract class JniMarker extends Jni_C_Common * * @exception JniException */ - public JniMarker(Jni_C_Pointer newMarkerPtr) throws JniException { + public JniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { thisMarkerPtr = newMarkerPtr; markerFieldsArrayList = new ArrayList(); markerFieldsHashMap = new HashMap(); @@ -114,10 +113,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.getPointer() ); - formatOverview = ltt_getFormatOverview( thisMarkerPtr.getPointer() ); + name = ltt_getName(thisMarkerPtr.getLibraryId(), thisMarkerPtr.getPointer()); + formatOverview = ltt_getFormatOverview(thisMarkerPtr.getLibraryId(), thisMarkerPtr.getPointer()); // To fill the markerFieldArray is a bit different - ltt_getAllMarkerFields( thisMarkerPtr.getPointer() ); + ltt_getAllMarkerFields(thisMarkerPtr.getLibraryId(), thisMarkerPtr.getPointer()); } } @@ -135,12 +134,12 @@ public abstract class JniMarker extends Jni_C_Common // 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(markerFieldPtr) ); + JniMarkerField newMarkerField = allocateNewJniMarkerField( new Jni_C_Pointer_And_Library_Id(thisMarkerPtr.getLibraryId(), markerFieldPtr)); markerFieldsArrayList.add(newMarkerField); markerFieldsHashMap.put(markerFieldName, newMarkerField); } catch (JniException e) { - printlnC("Failed to add marker field " + markerFieldName + " to marker fields list!(addMarkerFieldFromC)\n\tException raised : " + e.toString() ); + printlnC(thisMarkerPtr.getLibraryId(), "Failed to add marker field " + markerFieldName + " to marker fields list!(addMarkerFieldFromC)\n\tException raised : " + e.toString() ); } } @@ -169,9 +168,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 + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public Jni_C_Pointer getMarkerPtr() { + public Jni_C_Pointer_And_Library_Id getMarkerPtr() { return thisMarkerPtr; } @@ -186,13 +185,7 @@ public abstract class JniMarker extends Jni_C_Common * This function will not throw but will complain loudly if pointer is NULL */ public void printMarkerInformation() { - - // If null pointer, print a warning! - if (thisMarkerPtr.getPointer() == NULL) { - printlnC("Pointer is NULL, cannot print. (printMarkerInformation)"); - } else { - ltt_printMarker(thisMarkerPtr.getPointer()); - } + ltt_printMarker(thisMarkerPtr.getLibraryId(), thisMarkerPtr.getPointer()); } /** @@ -206,7 +199,7 @@ public abstract class JniMarker extends Jni_C_Common Object[] allMarkersField = markerFieldsArrayList.toArray(); for (int pos = 0; pos < allMarkersField.length; pos++) { - printlnC(allMarkersField[pos].toString()); + printlnC(thisMarkerPtr.getLibraryId(), allMarkersField[pos].toString()); } } @@ -241,15 +234,15 @@ public abstract class JniMarker extends Jni_C_Common *
* !! Override this with you version specific implementation.
* - * @param newMarkerFieldPtr The pointer of an already opened marker_field C Structure + * @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 + * @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 newMarkerFieldPtr) throws JniException; + public abstract JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException; } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java index 009e6e7180..e2b13bb88c 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java @@ -1,6 +1,6 @@ package org.eclipse.linuxtools.lttng.jni; -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.JniMarkerFieldException; @@ -24,23 +24,23 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniMarkerFieldException; public abstract class JniMarkerField extends Jni_C_Common { // Internal C pointer of the JniEvent used in LTT - private Jni_C_Pointer thisMarkerFieldPtr = new Jni_C_Pointer(); + private Jni_C_Pointer_And_Library_Id thisMarkerFieldPtr = new Jni_C_Pointer_And_Library_Id(); private String field = ""; private String format = ""; // Native access method - protected native String ltt_getField(long markerFieldPtr); - protected native int ltt_getType(long markerFieldPtr); - protected native long ltt_getOffset(long markerFieldPtr); - protected native long ltt_getSize(long markerFieldPtr); - protected native long ltt_getAlignment(long markerFieldPtr); - protected native long ltt_getAttributes(long markerFieldPtr); - protected native int ltt_getStatic_offset(long markerFieldPtr); - protected native String ltt_getFormat(long markerFieldPtr); + 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); // Debug native function, ask LTT to print marker structure - protected native void ltt_printMarkerField(long markerFieldPtr); + protected native void ltt_printMarkerField(int libId, long markerFieldPtr); /* * Default constructor is forbidden @@ -66,9 +66,9 @@ public abstract class JniMarkerField extends Jni_C_Common * * @exception JniException * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public JniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException { + public JniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { thisMarkerFieldPtr = newMarkerFieldPtr; // Populate the marker field @@ -84,8 +84,8 @@ public abstract class JniMarkerField extends Jni_C_Common throw new JniMarkerFieldException( "Pointer is NULL, trace closed? (populateMarkerInformation)"); } else { - field = ltt_getField(thisMarkerFieldPtr.getPointer()); - format = ltt_getFormat(thisMarkerFieldPtr.getPointer()); + field = ltt_getField(thisMarkerFieldPtr.getLibraryId(), thisMarkerFieldPtr.getPointer()); + format = ltt_getFormat(thisMarkerFieldPtr.getLibraryId(), thisMarkerFieldPtr.getPointer()); } } @@ -105,9 +105,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 + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public Jni_C_Pointer getMarkerFieldPtr() { + public Jni_C_Pointer_And_Library_Id getMarkerFieldPtr() { return thisMarkerFieldPtr; } @@ -116,17 +116,9 @@ 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.

- * - * This function will not throw but will complain loudly if pointer is NULL */ public void printMarkerFieldInformation() { - - // If null pointer, print a warning! - if (thisMarkerFieldPtr.getPointer() == NULL) { - printlnC("Pointer is NULL, cannot print. (printMarkerFieldInformation)"); - } else { - ltt_printMarkerField(thisMarkerFieldPtr.getPointer()); - } + ltt_printMarkerField(thisMarkerFieldPtr.getLibraryId(), thisMarkerFieldPtr.getPointer()); } /** diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java index 27dcba8c90..90902c2c8a 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java @@ -30,7 +30,7 @@ import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer; */ public abstract class JniParser extends Jni_C_Common { - protected static native void ltt_getParsedData(ParsedObjectContent parseddata, long eventPtr, long markerFieldPtr); + protected static native void ltt_getParsedData(int libId, ParsedObjectContent parseddata, long eventPtr, long markerFieldPtr); // *** HACK *** // We cannot use "Object" directly as java does not support swapping primitive value @@ -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(parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer() ); + ltt_getParsedData(eventToParse.getEventPtr().getLibraryId(), parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer()); return parsedData.getData(); } @@ -95,7 +95,7 @@ public abstract class JniParser extends Jni_C_Common return null; } - ltt_getParsedData(parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer() ); + ltt_getParsedData(eventToParse.getEventPtr().getLibraryId(), parsedData, eventToParse.getEventPtr().getPointer(), tmpField.getMarkerFieldPtr().getPointer()); return parsedData.getData(); } @@ -139,7 +139,7 @@ public abstract class JniParser extends Jni_C_Common newKey = iterator.next(); newMarkerField = markerFieldData.get(newKey); // Call the C to parse the data - ltt_getParsedData(parsedData, eventToParse.getEventPtr().getPointer(), newMarkerField.getMarkerFieldPtr().getPointer() ); + ltt_getParsedData(eventToParse.getEventPtr().getLibraryId(), parsedData, eventToParse.getEventPtr().getPointer(), newMarkerField.getMarkerFieldPtr().getPointer()); // Save the result into the HashMap parsedDataMap.put(newMarkerField.getField(), parsedData.getData() ); } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java index 89d37953e7..7ed77f365a 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java @@ -16,7 +16,7 @@ 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; +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.JniOpenTraceFailedException; import org.eclipse.linuxtools.lttng.jni.exception.JniTraceException; @@ -43,7 +43,7 @@ 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 thisTracePtr = new Jni_C_Pointer(); + private Jni_C_Pointer_And_Library_Id thisTracePtr = new Jni_C_Pointer_And_Library_Id(); // Data we should populate from LTT // Note that all type have been scaled up as there is no "unsigned" in java @@ -77,43 +77,45 @@ 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 boolean ltt_initializeHandle(String libname); + protected native int ltt_initializeHandle(String libname); + // This need to be called at the very end (destructor) - protected native boolean ltt_freeHandle(); + protected native boolean ltt_freeHandle(int libId); // Open/close native functions - protected native long ltt_openTrace(String pathname, boolean printDebug); - protected native void ltt_closeTrace(long tracePtr); + protected native long ltt_openTrace(int libId, String pathname, boolean printDebug); + protected native void ltt_closeTrace(int libId, long tracePtr); // Native access functions - 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); + 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); // Native function to fill out startTime - protected native void ltt_feedStartTime(long tracePtr, JniTime startTime); + protected native void ltt_feedStartTime(int libId, long tracePtr, JniTime startTime); // Native function to fill out startTimeFromTimestampCurrentCounter - protected native void ltt_feedStartTimeFromTimestampCurrentCounter(long tracePtr, JniTime startTime); + protected native void ltt_feedStartTimeFromTimestampCurrentCounter(int libId, long tracePtr, JniTime startTime); // Native function to fill out tracefilesMap - protected native void ltt_feedAllTracefiles(long tracePtr); + protected native void ltt_feedAllTracefiles(int libId, long tracePtr); // Native function to fill out the start and end time of the trace - protected native void ltt_feedTracefileTimeRange(long tracePtr, JniTime startTime, JniTime endTime); + protected native void ltt_feedTracefileTimeRange(int libId, long tracePtr, JniTime startTime, JniTime endTime); // Debug native function, ask LTT to print trace structure - protected native void ltt_printTrace(long tracePtr); + protected native void ltt_printTrace(int libId, long tracePtr); /* * Default constructor is forbidden @@ -146,7 +148,7 @@ public abstract class JniTrace extends Jni_C_Common { */ public JniTrace(String newpath, boolean newPrintDebug) throws JniException { tracepath = newpath; - thisTracePtr = new Jni_C_Pointer(); + thisTracePtr = new Jni_C_Pointer_And_Library_Id(); printLttDebug = newPrintDebug; openTrace(newpath); @@ -193,9 +195,9 @@ public abstract class JniTrace extends Jni_C_Common { * * @exception JniException * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public JniTrace(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException { + public JniTrace(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { thisTracePtr = newPtr; printLttDebug = newPrintDebug; @@ -255,23 +257,27 @@ public abstract class JniTrace extends Jni_C_Common { closeTrace(); } - if ( initializeLibrary() == true ) { + // Initialization of the library is made here + // It is very important that the id is kept! + int newLibraryId = initializeLibrary(); + if ( newLibraryId != -1 ) { // Call the LTT to open the trace - long newPtr = ltt_openTrace(tracepath, printLttDebug); + // Note that the libraryId is not yet and the pointer + long newPtr = ltt_openTrace(newLibraryId, tracepath, printLttDebug); if (newPtr == NULL) { - thisTracePtr = new Jni_C_Pointer(NULL); + thisTracePtr = new Jni_C_Pointer_And_Library_Id(); throw new JniOpenTraceFailedException("Error while opening trace. Is the tracepath correct? (openTrace)"); } // This is OUR pointer - thisTracePtr = new Jni_C_Pointer(newPtr); + thisTracePtr = new Jni_C_Pointer_And_Library_Id(newLibraryId, newPtr); // Populate the trace with LTT information populateTraceInformation(); } else { - thisTracePtr = new Jni_C_Pointer(NULL); + 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)"); } @@ -285,7 +291,7 @@ public abstract class JniTrace extends Jni_C_Common { public void closeTrace() { if (thisTracePtr.getPointer() != NULL) { - ltt_closeTrace(thisTracePtr.getPointer()); + ltt_closeTrace(thisTracePtr.getLibraryId(), thisTracePtr.getPointer()); // Clear the tracefile map tracefilesMap.clear(); @@ -296,7 +302,7 @@ public abstract class JniTrace extends Jni_C_Common { eventsHeap = null; // Nullify the pointer - thisTracePtr = new Jni_C_Pointer(NULL); + thisTracePtr = new Jni_C_Pointer_And_Library_Id(); // Ask the garbage collector to make a little pass here, as we could // be left with 100's of unreferenced objects @@ -310,7 +316,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(); + ltt_freeHandle(thisTracePtr.getLibraryId()); } /* @@ -324,18 +330,18 @@ public abstract class JniTrace extends Jni_C_Common { } // Populate from the LTT library - 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() ); + 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()); // Creation of time is a bit different, we need to pass the object reference to C // @@ -343,21 +349,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.getPointer(), startTimeNoAdjustement ); + ltt_feedStartTime(thisTracePtr.getLibraryId(), thisTracePtr.getPointer(), startTimeNoAdjustement); startTime = new JniTime(); - ltt_feedStartTimeFromTimestampCurrentCounter( thisTracePtr.getPointer(), startTime ); + ltt_feedStartTimeFromTimestampCurrentCounter(thisTracePtr.getLibraryId(), thisTracePtr.getPointer(), startTime); // Call the fill up function for the tracefiles map if ( tracefilesMap== null ) { tracefilesMap = new HashMap(); } - ltt_feedAllTracefiles( thisTracePtr.getPointer() ); + ltt_feedAllTracefiles(thisTracePtr.getLibraryId(), 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.getPointer(), new JniTime(), endTime); + ltt_feedTracefileTimeRange(thisTracePtr.getLibraryId(), thisTracePtr.getPointer(), new JniTime(), endTime); if (eventsHeap == null) { eventsHeap = new PriorityQueue(tracefilesMap.size()); @@ -406,17 +412,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(tracefilePtr), this ); + newTracefile = allocateNewJniTracefile(new Jni_C_Pointer_And_Library_Id(thisTracePtr.getLibraryId(), tracefilePtr), this); getTracefilesMap().put( (tracefileName + newTracefile.getCpuNumber()), newTracefile); } catch(JniTracefileWithoutEventException e) { if ( printLttDebug == true ) { - printlnC("JniTracefile " + tracefileName + " has no event (addTracefileFromC). Ignoring."); + printlnC(thisTracePtr.getLibraryId(), "JniTracefile " + tracefileName + " has no event (addTracefileFromC). Ignoring."); } } catch(Exception e) { if ( printLttDebug == true ) { - printlnC("Failed to add tracefile " + tracefileName + " to tracefilesMap!(addTracefileFromC)\n\tException raised : " + e.toString() ); + printlnC(thisTracePtr.getLibraryId(), "Failed to add tracefile " + tracefileName + " to tracefilesMap!(addTracefileFromC)\n\tException raised : " + e.toString() ); } } } @@ -751,9 +757,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 + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public Jni_C_Pointer getTracePtr() { + public Jni_C_Pointer_And_Library_Id getTracePtr() { return thisTracePtr; } @@ -793,18 +799,9 @@ 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.

- *
- * This function will not throw but will complain loudly if pointer is NULL */ public void printTraceInformation() { - - // If null pointer, print a warning! - if (thisTracePtr.getPointer() == NULL) { - printlnC("Pointer is NULL, cannot print. (printTraceInformation)"); - } - else { - ltt_printTrace( thisTracePtr.getPointer() ); - } + ltt_printTrace(thisTracePtr.getLibraryId(), thisTracePtr.getPointer()); } /** @@ -855,9 +852,9 @@ public abstract class JniTrace extends Jni_C_Common { *
* !! Override this with you version specific implementation.
* - * @return boolean saying if the initialization was successful. + * @return integer that is the library id, or -1 if the load was unsuccessful */ - public abstract boolean initializeLibrary(); + public abstract int initializeLibrary(); /** @@ -876,9 +873,9 @@ public abstract class JniTrace extends Jni_C_Common { * @throws JniException The construction (allocation) failed. * * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer + * @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 newPtr, JniTrace newParentTrace) throws JniException; + public abstract JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException; } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java index 3424b37936..a7796f8aca 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java @@ -16,6 +16,7 @@ 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; @@ -39,10 +40,10 @@ import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileWithoutEventExcept * Please look at the abstract functions to override at the bottom of this file.

* */ -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 thisTracefilePtr = new Jni_C_Pointer(); + private Jni_C_Pointer_And_Library_Id thisTracefilePtr = new Jni_C_Pointer_And_Library_Id(); // Reference to the parent trace private JniTrace parentTrace = null; @@ -59,6 +60,7 @@ 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; @@ -78,6 +80,7 @@ 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; @@ -86,37 +89,37 @@ public abstract class JniTracefile extends Jni_C_Common { private HashMap tracefileMarkersMap = null; // Native access functions - 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); - + 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); + // Method to fill a map with marker object - protected native void ltt_feedAllMarkers(long tracefilePtr); + protected native void ltt_feedAllMarkers(int libId, long tracefilePtr); // Debug native function, ask LTT to print tracefile structure - protected native void ltt_printTracefile(long tracefilePtr); + protected native void ltt_printTracefile(int libId, long tracefilePtr); /* * Default constructor is forbidden @@ -169,19 +172,19 @@ public abstract class JniTracefile extends Jni_C_Common { * @exception JniException * * @see org.eclipse.linuxtools.lttng.jni.JniTrace - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public JniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException { - thisTracefilePtr = newPtr; + public JniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { + thisTracefilePtr = newPtr; parentTrace = newParentTrace; tracefileMarkersMap = new HashMap(); // 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. (Jaf_Tracefile)"); + } + catch (JniNoSuchEventException e) { + throw new JniTracefileWithoutEventException("JniEvent constructor reported that no event of this type are usable. (Jaf_Tracefile)"); } } @@ -220,39 +223,38 @@ 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.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() ); + 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()); // To fill the map is a bit different - ltt_feedAllMarkers( thisTracefilePtr.getPointer() ); + ltt_feedAllMarkers(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() ); - Jni_C_Pointer tmpEventPointer = new Jni_C_Pointer(ltt_getEventPtr(thisTracefilePtr.getPointer())); + Jni_C_Pointer_And_Library_Id tmpEventPointer = new Jni_C_Pointer_And_Library_Id(thisTracefilePtr.getLibraryId(), ltt_getEventPtr(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer())); currentEvent = allocateNewJniEvent(tmpEventPointer , tracefileMarkersMap, this); } @@ -270,11 +272,11 @@ public abstract class JniTracefile 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 { - JniMarker newMarker = allocateNewJniMarker( new Jni_C_Pointer(markerInfoPtr) ); + JniMarker newMarker = allocateNewJniMarker( new Jni_C_Pointer_And_Library_Id(thisTracefilePtr.getLibraryId(), markerInfoPtr) ); tracefileMarkersMap.put(markerId, newMarker); } catch (Exception e) { - printlnC("Failed to add marker to tracefileMarkersMap!(addMarkersFromC)\n\tException raised : " + e.toString()); + printlnC(thisTracefilePtr.getLibraryId(), "Failed to add marker to tracefileMarkersMap!(addMarkersFromC)\n\tException raised : " + e.toString()); } } @@ -402,9 +404,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 + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public Jni_C_Pointer getTracefilePtr() { + public Jni_C_Pointer_And_Library_Id getTracefilePtr() { return thisTracefilePtr; } @@ -414,18 +416,9 @@ 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.

- * - * This function will not throw but will complain loudly if pointer is NULL. */ public void printTracefileInformation() { - - // If null pointer, print a warning! - if (thisTracefilePtr.getPointer() == NULL) { - printlnC("Pointer is NULL, cannot print. (printTracefileInformation)"); - } - else { - ltt_printTracefile( thisTracefilePtr.getPointer() ); - } + ltt_printTracefile(thisTracefilePtr.getLibraryId(), thisTracefilePtr.getPointer() ); } /** @@ -491,11 +484,11 @@ public abstract class JniTracefile extends Jni_C_Common { * @throws JniException The construction (allocation) failed. * * @see org.eclipse.linuxtools.lttng.jni.JniEvent - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer + * @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 newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException; + public abstract JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException; /** @@ -513,8 +506,8 @@ public abstract class JniTracefile extends Jni_C_Common { * @throws JniException The construction (allocation) failed. * * @see org.eclipse.linuxtools.lttng.jni.JniMarker - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer + * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ - public abstract JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException; + public abstract JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException; } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java index 6b4e1773d8..2713bd6c84 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java @@ -24,11 +24,11 @@ import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant; * This class is ABSTRACT, and will be extended by each LTTng structure (Trac, Tracefile, Event, ...) * */ -public abstract class Jni_C_Common extends Jni_C_Constant { - +public abstract class Jni_C_Common extends Jni_C_Constant +{ // Native console printing function - protected native void ltt_printC(String string_to_print); - + protected native void ltt_printC(int libId, String string_to_print); + /** * Java-side console printing function.

* @@ -36,10 +36,10 @@ public abstract class Jni_C_Common extends Jni_C_Constant { * * @param msg The string to print in C. */ - public void printC(String msg) { + public void printC(int libId, String msg) { // Need to escape "%" for C printf msg = msg.replaceAll("%", "%%"); - ltt_printC(msg); + ltt_printC(libId, msg); } /** @@ -49,8 +49,8 @@ public abstract class Jni_C_Common extends Jni_C_Constant { * * @param msg The string to print in C. */ - public void printlnC(String msg) { - printC(msg + "\n"); + public void printlnC(int libId, String msg) { + printC(libId, msg + "\n"); } } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java index 0dca5ded52..3519dfe048 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java @@ -20,8 +20,8 @@ package org.eclipse.linuxtools.lttng.jni.common; */ public class Jni_C_Pointer extends Jni_C_Constant { - private long ptr = NULL; - private boolean isLong = true; + protected long ptr = NULL; + protected boolean isLong = true; /** * Default constructor.

diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java index 2570b398c5..ac6368eb88 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java @@ -16,7 +16,7 @@ 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; +import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; import org.eclipse.linuxtools.lttng.jni.exception.JniException; /** @@ -40,7 +40,7 @@ public class JniEvent_v2_3 extends JniEvent { super(oldEvent); } - public JniEvent_v2_3(Jni_C_Pointer newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + public JniEvent_v2_3(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap 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/JniMarkerField_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField_v2_3.java index 956178ac40..c67e0a7de1 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField_v2_3.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField_v2_3.java @@ -12,7 +12,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_3; *******************************************************************************/ import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -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; /** @@ -36,7 +36,7 @@ public class JniMarkerField_v2_3 extends JniMarkerField { super(oldMarkerField); } - public JniMarkerField_v2_3(Jni_C_Pointer newMarkerFieldPtr) throws JniException { + public JniMarkerField_v2_3(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { super(newMarkerFieldPtr); } } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java index c6a81d42c7..58ca0655a2 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java @@ -13,7 +13,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_3; import org.eclipse.linuxtools.lttng.jni.JniMarker; import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -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; /** @@ -37,7 +37,7 @@ public class JniMarker_v2_3 extends JniMarker { super(oldMarker); } - public JniMarker_v2_3(Jni_C_Pointer newMarkerPtr) throws JniException { + public JniMarker_v2_3(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { super(newMarkerPtr); } @@ -52,7 +52,7 @@ public class JniMarker_v2_3 extends JniMarker { * @see org.eclipse.linuxtools.lttng.jni.JniMarker */ @Override - public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException { + public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id 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/JniTrace_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace_v2_3.java index 8f76574841..79218108fc 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace_v2_3.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace_v2_3.java @@ -14,6 +14,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_3; import org.eclipse.linuxtools.lttng.jni.JniTrace; import org.eclipse.linuxtools.lttng.jni.JniTracefile; 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; /** @@ -53,7 +54,7 @@ public class JniTrace_v2_3 extends JniTrace { super(oldTrace); } - public JniTrace_v2_3(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException { + public JniTrace_v2_3(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { super(newPtr, newPrintDebug); } @@ -63,10 +64,10 @@ public class JniTrace_v2_3 extends JniTrace { * * Call the library loader with the .so we wish to load. * - * @return True if the load went successful, false otherwise. + * @return The library id if sucessful, -1 if something went wrong */ @Override - public boolean initializeLibrary() { + public int initializeLibrary() { return ltt_initializeHandle(LIBRARY_NAME); } @@ -81,7 +82,7 @@ public class JniTrace_v2_3 extends JniTrace { * @see org.eclipse.linuxtools.lttng.jni.JniTrace */ @Override - public JniTracefile allocateNewJniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException { + public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id 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_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile_v2_3.java index 0c3bf162b0..64cf5033ba 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile_v2_3.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile_v2_3.java @@ -18,6 +18,7 @@ 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; +import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; import org.eclipse.linuxtools.lttng.jni.exception.JniException; /** @@ -41,7 +42,7 @@ public class JniTracefile_v2_3 extends JniTracefile { super(oldTracefile); } - public JniTracefile_v2_3(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException { + public JniTracefile_v2_3(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { super(newPtr, newParentTrace); } @@ -56,7 +57,7 @@ public class JniTracefile_v2_3 extends JniTracefile { * @see org.eclipse.linuxtools.lttng.jni.JniTracefile */ @Override - public JniEvent allocateNewJniEvent(Jni_C_Pointer newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { return new JniEvent_v2_3(newEventPtr, newMarkersMap, newParentTracefile); } @@ -71,7 +72,7 @@ public class JniTracefile_v2_3 extends JniTracefile { * @see org.eclipse.linuxtools.lttng.jni.JniTracefile */ @Override - public JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException { + public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { return new JniMarker_v2_3(newMarkerPtr); } } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java index 5ba218655d..26d2563013 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java @@ -16,7 +16,7 @@ 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; +import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; import org.eclipse.linuxtools.lttng.jni.exception.JniException; /** @@ -40,7 +40,7 @@ public class JniEvent_v2_5 extends JniEvent { super(oldEvent); } - public JniEvent_v2_5(Jni_C_Pointer newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + public JniEvent_v2_5(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap 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/JniMarkerField_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField_v2_5.java index 10a54f86c1..8900dff6e4 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField_v2_5.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField_v2_5.java @@ -12,7 +12,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_5; *******************************************************************************/ import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -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; /** @@ -36,7 +36,7 @@ public class JniMarkerField_v2_5 extends JniMarkerField { super(oldMarkerField); } - public JniMarkerField_v2_5(Jni_C_Pointer newMarkerFieldPtr) throws JniException { + public JniMarkerField_v2_5(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { super(newMarkerFieldPtr); } } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java index 9d049f72b4..d7dafc09a8 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java @@ -13,7 +13,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_5; import org.eclipse.linuxtools.lttng.jni.JniMarker; import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -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; /** @@ -37,7 +37,7 @@ public class JniMarker_v2_5 extends JniMarker { super(oldMarker); } - public JniMarker_v2_5(Jni_C_Pointer newMarkerPtr) throws JniException { + public JniMarker_v2_5(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { super(newMarkerPtr); } @@ -52,7 +52,7 @@ public class JniMarker_v2_5 extends JniMarker { * @see org.eclipse.linuxtools.lttng.jni.JniMarker */ @Override - public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException { + public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id 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/JniTrace_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace_v2_5.java index dad8de4959..ebea39f877 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace_v2_5.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace_v2_5.java @@ -13,7 +13,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_5; import org.eclipse.linuxtools.lttng.jni.JniTrace; import org.eclipse.linuxtools.lttng.jni.JniTracefile; -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; /** @@ -53,7 +53,7 @@ public class JniTrace_v2_5 extends JniTrace { super(oldTrace); } - public JniTrace_v2_5(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException { + public JniTrace_v2_5(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { super(newPtr, newPrintDebug); } @@ -66,7 +66,7 @@ public class JniTrace_v2_5 extends JniTrace { * @return True if the load went successful, false otherwise. */ @Override - public boolean initializeLibrary() { + public int initializeLibrary() { return ltt_initializeHandle(LIBRARY_NAME); } @@ -80,7 +80,7 @@ public class JniTrace_v2_5 extends JniTrace { * @see org.eclipse.linuxtools.lttng.jni.JniTrace */ @Override - public JniTracefile allocateNewJniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException { + public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id 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_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile_v2_5.java index ff136fa56c..6d63a22edd 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile_v2_5.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile_v2_5.java @@ -17,7 +17,7 @@ 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; +import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; import org.eclipse.linuxtools.lttng.jni.exception.JniException; /** @@ -41,7 +41,7 @@ public class JniTracefile_v2_5 extends JniTracefile { super(oldTracefile); } - public JniTracefile_v2_5(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException { + public JniTracefile_v2_5(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { super(newPtr, newParentTrace); } @@ -56,7 +56,7 @@ public class JniTracefile_v2_5 extends JniTracefile { * @see org.eclipse.linuxtools.lttng.jni.JniTracefile */ @Override - public JniEvent allocateNewJniEvent(Jni_C_Pointer newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { return new JniEvent_v2_5(newEventPtr, newMarkersMap, newParentTracefile); } @@ -71,7 +71,7 @@ public class JniTracefile_v2_5 extends JniTracefile { * @see org.eclipse.linuxtools.lttng.jni.JniTracefile */ @Override - public JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException { + public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { return new JniMarker_v2_5(newMarkerPtr); } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java index e34f876931..9c2bd45920 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java @@ -16,7 +16,7 @@ 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; +import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; import org.eclipse.linuxtools.lttng.jni.exception.JniException; /** @@ -40,7 +40,7 @@ public class JniEvent_v2_6 extends JniEvent { super(oldEvent); } - public JniEvent_v2_6(Jni_C_Pointer newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + public JniEvent_v2_6(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { super(newEventPtr, newMarkersMap, newParentTracefile); } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java index 3482c8146e..cdff84ac60 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java @@ -12,7 +12,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_6; *******************************************************************************/ import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -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; /** @@ -36,7 +36,7 @@ public class JniMarkerField_v2_6 extends JniMarkerField { super(oldMarkerField); } - public JniMarkerField_v2_6(Jni_C_Pointer newMarkerFieldPtr) throws JniException { + public JniMarkerField_v2_6(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { super(newMarkerFieldPtr); } } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java index b070a27b9e..34ecf1f5f2 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java @@ -13,7 +13,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_6; import org.eclipse.linuxtools.lttng.jni.JniMarker; import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -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; /** @@ -37,7 +37,7 @@ public class JniMarker_v2_6 extends JniMarker { super(oldMarker); } - public JniMarker_v2_6(Jni_C_Pointer newMarkerPtr) throws JniException { + public JniMarker_v2_6(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { super(newMarkerPtr); } @@ -52,7 +52,7 @@ public class JniMarker_v2_6 extends JniMarker { * @see org.eclipse.linuxtools.lttng.jni.JniMarker */ @Override - public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer newMarkerFieldPtr) throws JniException { + public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { return new JniMarkerField_v2_6(newMarkerFieldPtr); } } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java index ca366ec148..5339456548 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java @@ -13,7 +13,7 @@ package org.eclipse.linuxtools.lttng.jni_v2_6; import org.eclipse.linuxtools.lttng.jni.JniTrace; import org.eclipse.linuxtools.lttng.jni.JniTracefile; -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; /** @@ -52,7 +52,7 @@ public class JniTrace_v2_6 extends JniTrace { super(oldTrace); } - public JniTrace_v2_6(Jni_C_Pointer newPtr, boolean newPrintDebug) throws JniException { + public JniTrace_v2_6(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { super(newPtr, newPrintDebug); } @@ -65,7 +65,7 @@ public class JniTrace_v2_6 extends JniTrace { * @return True if the load went successful, false otherwise. */ @Override - public boolean initializeLibrary() { + public int initializeLibrary() { return ltt_initializeHandle(LIBRARY_NAME); } @@ -80,7 +80,7 @@ public class JniTrace_v2_6 extends JniTrace { * @see org.eclipse.linuxtools.lttng.jni.JniTrace */ @Override - public JniTracefile allocateNewJniTracefile(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException { + public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { return new JniTracefile_v2_6(newPtr, newParentTrace); } } diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java index 8f3dc52ed5..2aeebaa28a 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java @@ -17,7 +17,7 @@ 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; +import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; import org.eclipse.linuxtools.lttng.jni.exception.JniException; /** @@ -41,7 +41,7 @@ public class JniTracefile_v2_6 extends JniTracefile { super(oldTracefile); } - public JniTracefile_v2_6(Jni_C_Pointer newPtr, JniTrace newParentTrace) throws JniException { + public JniTracefile_v2_6(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { super(newPtr, newParentTrace); } @@ -56,7 +56,7 @@ public class JniTracefile_v2_6 extends JniTracefile { * @see org.eclipse.linuxtools.lttng.jni.JniTracefile */ @Override - public JniEvent allocateNewJniEvent(Jni_C_Pointer newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { return new JniEvent_v2_6(newEventPtr, newMarkersMap, newParentTracefile); } @@ -71,7 +71,7 @@ public class JniTracefile_v2_6 extends JniTracefile { * @see org.eclipse.linuxtools.lttng.jni.JniTracefile */ @Override - public JniMarker allocateNewJniMarker(Jni_C_Pointer newMarkerPtr) throws JniException { + public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { return new JniMarker_v2_6(newMarkerPtr); } -- 2.34.1