ART: More refactor for JVMTI run tests (1/3)
Put (most) tests into a new package and give them dedicated
class names (Test9XY).
NOTE: BROKEN WITHOUT A FOLLOW-UP CL TO CHANGE DIRECTORY STRUCTURE
AND FILE NAMES!
Bug: 32072923
Test: None
Change-Id: I291b0543f7782914e446a74f0d9037020c88e5b5
diff --git a/test/901-hello-ti-agent/basics.cc b/test/901-hello-ti-agent/basics.cc
index 20b227a..8695e0c 100644
--- a/test/901-hello-ti-agent/basics.cc
+++ b/test/901-hello-ti-agent/basics.cc
@@ -145,14 +145,14 @@
return JNI_OK;
}
-extern "C" JNIEXPORT void JNICALL Java_Main_setVerboseFlag(
+extern "C" JNIEXPORT void JNICALL Java_art_Test901_setVerboseFlag(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jint iflag, jboolean val) {
jvmtiVerboseFlag flag = static_cast<jvmtiVerboseFlag>(iflag);
jvmtiError result = jvmti_env->SetVerboseFlag(flag, val);
JvmtiErrorToException(env, jvmti_env, result);
}
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_checkLivePhase(
+extern "C" JNIEXPORT jboolean JNICALL Java_art_Test901_checkLivePhase(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jvmtiPhase current_phase;
jvmtiError phase_result = jvmti_env->GetPhase(¤t_phase);
@@ -168,7 +168,7 @@
*err = env->GetClassMethods(klass, &n, &methods);
}
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_checkUnattached(
+extern "C" JNIEXPORT jboolean JNICALL Java_art_Test901_checkUnattached(
JNIEnv* env ATTRIBUTE_UNUSED, jclass Main_klass) {
jvmtiError res = JVMTI_ERROR_NONE;
std::thread t1(CallJvmtiFunction, jvmti_env, Main_klass, &res);
diff --git a/test/901-hello-ti-agent/src/Main.java b/test/901-hello-ti-agent/src/Main.java
index 556e05b..26f7399 100644
--- a/test/901-hello-ti-agent/src/Main.java
+++ b/test/901-hello-ti-agent/src/Main.java
@@ -14,8 +14,12 @@
* limitations under the License.
*/
-public class Main {
- public static void main(String[] args) {
+package art;
+
+public class Test901 {
+ public static void run() {
+ Main.bindAgentJNIForClass(Test901.class);
+
System.out.println("Hello, world!");
if (checkLivePhase()) {
diff --git a/test/902-hello-transformation/src/Main.java b/test/902-hello-transformation/src/Main.java
index 471c82b..ed8a500 100644
--- a/test/902-hello-transformation/src/Main.java
+++ b/test/902-hello-transformation/src/Main.java
@@ -49,6 +49,7 @@
"AgAAABMCAAAAIAAAAQAAAB4CAAAAEAAAAQAAACwCAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/903-hello-tagging/src/Main.java b/test/903-hello-tagging/src/Main.java
index 48896b2..1691a94 100644
--- a/test/903-hello-tagging/src/Main.java
+++ b/test/903-hello-tagging/src/Main.java
@@ -14,12 +14,16 @@
* limitations under the License.
*/
+package art;
+
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
-public class Main {
- public static void main(String[] args) {
+public class Test903 {
+ public static void run() {
+ Main.bindAgentJNIForClass(Test903.class);
+
doTest();
testGetTaggedObjects();
testTags();
@@ -44,10 +48,10 @@
private static WeakReference<Object> test() {
Object o1 = new Object();
- setTag(o1, 1);
+ Main.setTag(o1, 1);
Object o2 = new Object();
- setTag(o2, 2);
+ Main.setTag(o2, 2);
checkTag(o1, 1);
checkTag(o2, 2);
@@ -61,8 +65,8 @@
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
- setTag(o1, 10);
- setTag(o2, 20);
+ Main.setTag(o1, 10);
+ Main.setTag(o2, 20);
checkTag(o1, 10);
checkTag(o2, 20);
@@ -71,7 +75,7 @@
}
private static void checkTag(Object o, long expectedTag) {
- long tag = getTag(o);
+ long tag = Main.getTag(o);
if (expectedTag != tag) {
throw new RuntimeException("Unexpected tag " + tag + ", expected " + expectedTag);
}
@@ -86,7 +90,7 @@
Integer o = new Integer(i);
l.add(o);
if (i % 10 != 0) {
- setTag(o, i % 10);
+ Main.setTag(o, i % 10);
}
}
@@ -169,8 +173,6 @@
}
}
- private static native void setTag(Object o, long tag);
- private static native long getTag(Object o);
private static native Object[] getTaggedObjects(long[] searchTags, boolean returnObjects,
boolean returnTags);
private static native long[] testTagsInDifferentEnvs(Object o, long baseTag, int n);
diff --git a/test/903-hello-tagging/tagging.cc b/test/903-hello-tagging/tagging.cc
index 701b0c3..a2694e7 100644
--- a/test/903-hello-tagging/tagging.cc
+++ b/test/903-hello-tagging/tagging.cc
@@ -33,25 +33,8 @@
namespace art {
namespace Test903HelloTagging {
-extern "C" JNIEXPORT void JNICALL Java_Main_setTag(JNIEnv* env, jclass, jobject obj, jlong tag) {
- jvmtiError ret = jvmti_env->SetTag(obj, tag);
- JvmtiErrorToException(env, jvmti_env, ret);
-}
-
-extern "C" JNIEXPORT jlong JNICALL Java_Main_getTag(JNIEnv* env, jclass, jobject obj) {
- jlong tag = 0;
- jvmtiError ret = jvmti_env->GetTag(obj, &tag);
- if (JvmtiErrorToException(env, jvmti_env, ret)) {
- return 0;
- }
- return tag;
-}
-
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getTaggedObjects(JNIEnv* env,
- jclass,
- jlongArray searchTags,
- jboolean returnObjects,
- jboolean returnTags) {
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test903_getTaggedObjects(
+ JNIEnv* env, jclass, jlongArray searchTags, jboolean returnObjects, jboolean returnTags) {
ScopedLongArrayRO scoped_array(env);
if (searchTags != nullptr) {
scoped_array.reset(searchTags);
@@ -150,7 +133,7 @@
return tag;
}
-extern "C" JNIEXPORT jlongArray JNICALL Java_Main_testTagsInDifferentEnvs(
+extern "C" JNIEXPORT jlongArray JNICALL Java_art_Test903_testTagsInDifferentEnvs(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jlong base_tag, jint count) {
std::unique_ptr<jvmtiEnv*[]> envs = std::unique_ptr<jvmtiEnv*[]>(new jvmtiEnv*[count]);
envs[0] = jvmti_env;
diff --git a/test/904-object-allocation/src/Main.java b/test/904-object-allocation/src/Main.java
index df59179..31e0c8c 100644
--- a/test/904-object-allocation/src/Main.java
+++ b/test/904-object-allocation/src/Main.java
@@ -14,10 +14,14 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test904 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test904.class);
+
// Use a list to ensure objects must be allocated.
ArrayList<Object> l = new ArrayList<>(100);
diff --git a/test/904-object-allocation/tracking.cc b/test/904-object-allocation/tracking.cc
index c829496..8de350b 100644
--- a/test/904-object-allocation/tracking.cc
+++ b/test/904-object-allocation/tracking.cc
@@ -57,7 +57,7 @@
static_cast<size_t>(size));
}
-extern "C" JNIEXPORT void JNICALL Java_Main_setupObjectAllocCallback(
+extern "C" JNIEXPORT void JNICALL Java_art_Test904_setupObjectAllocCallback(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jboolean enable) {
jvmtiEventCallbacks callbacks;
memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
@@ -67,10 +67,8 @@
JvmtiErrorToException(env, jvmti_env, ret);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_enableAllocationTracking(JNIEnv* env,
- jclass,
- jthread thread,
- jboolean enable) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test904_enableAllocationTracking(
+ JNIEnv* env, jclass, jthread thread, jboolean enable) {
jvmtiError ret = jvmti_env->SetEventNotificationMode(
enable ? JVMTI_ENABLE : JVMTI_DISABLE,
JVMTI_EVENT_VM_OBJECT_ALLOC,
diff --git a/test/905-object-free/src/Main.java b/test/905-object-free/src/Main.java
index 0d57629..1ed7a0e 100644
--- a/test/905-object-free/src/Main.java
+++ b/test/905-object-free/src/Main.java
@@ -14,11 +14,14 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
import java.util.Arrays;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test905 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test905.class);
doTest();
}
@@ -67,7 +70,7 @@
private static void stressAllocate(int i) {
Object obj = new Object();
- setTag(obj, i);
+ Main.setTag(obj, i);
setTag2(obj, i + 1);
}
@@ -92,7 +95,7 @@
private static void allocate(ArrayList<Object> l, long tag) {
Object obj = new Object();
l.add(obj);
- setTag(obj, tag);
+ Main.setTag(obj, tag);
}
private static void getAndPrintTags() {
@@ -103,7 +106,6 @@
private static native void setupObjectFreeCallback();
private static native void enableFreeTracking(boolean enable);
- private static native void setTag(Object o, long tag);
private static native long[] getCollectedTags(int index);
private static native void setTag2(Object o, long tag);
}
diff --git a/test/905-object-free/tracking_free.cc b/test/905-object-free/tracking_free.cc
index 59b429c..998194a 100644
--- a/test/905-object-free/tracking_free.cc
+++ b/test/905-object-free/tracking_free.cc
@@ -55,7 +55,7 @@
JvmtiErrorToException(env, jenv, ret);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_setupObjectFreeCallback(
+extern "C" JNIEXPORT void JNICALL Java_art_Test905_setupObjectFreeCallback(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
setupObjectFreeCallback(env, jvmti_env, ObjectFree1);
JavaVM* jvm = nullptr;
@@ -65,9 +65,8 @@
setupObjectFreeCallback(env, jvmti_env2, ObjectFree2);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_enableFreeTracking(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jboolean enable) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test905_enableFreeTracking(
+ JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jboolean enable) {
jvmtiError ret = jvmti_env->SetEventNotificationMode(
enable ? JVMTI_ENABLE : JVMTI_DISABLE,
JVMTI_EVENT_OBJECT_FREE,
@@ -82,9 +81,8 @@
JvmtiErrorToException(env, jvmti_env, ret);
}
-extern "C" JNIEXPORT jlongArray JNICALL Java_Main_getCollectedTags(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jint index) {
+extern "C" JNIEXPORT jlongArray JNICALL Java_art_Test905_getCollectedTags(
+ JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint index) {
std::vector<jlong>& tags = (index == 0) ? collected_tags1 : collected_tags2;
jlongArray ret = env->NewLongArray(tags.size());
if (ret == nullptr) {
@@ -97,10 +95,8 @@
return ret;
}
-extern "C" JNIEXPORT void JNICALL Java_Main_setTag2(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jobject obj,
- jlong tag) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test905_setTag2(
+ JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject obj, jlong tag) {
jvmtiError ret = jvmti_env2->SetTag(obj, tag);
JvmtiErrorToException(env, jvmti_env, ret);
}
diff --git a/test/906-iterate-heap/iterate_heap.cc b/test/906-iterate-heap/iterate_heap.cc
index bb30074..6534b4c 100644
--- a/test/906-iterate-heap/iterate_heap.cc
+++ b/test/906-iterate-heap/iterate_heap.cc
@@ -71,11 +71,12 @@
return true;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_iterateThroughHeapCount(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jint heap_filter,
- jclass klass_filter,
- jint stop_after) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test906_iterateThroughHeapCount(
+ JNIEnv* env,
+ jclass klass ATTRIBUTE_UNUSED,
+ jint heap_filter,
+ jclass klass_filter,
+ jint stop_after) {
class CountIterationConfig : public IterationConfig {
public:
CountIterationConfig(jint _counter, jint _stop_after)
@@ -108,15 +109,15 @@
return config.counter;
}
-
-extern "C" JNIEXPORT jint JNICALL Java_Main_iterateThroughHeapData(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jint heap_filter,
- jclass klass_filter,
- jlongArray class_tags,
- jlongArray sizes,
- jlongArray tags,
- jintArray lengths) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test906_iterateThroughHeapData(
+ JNIEnv* env,
+ jclass klass ATTRIBUTE_UNUSED,
+ jint heap_filter,
+ jclass klass_filter,
+ jlongArray class_tags,
+ jlongArray sizes,
+ jlongArray tags,
+ jintArray lengths) {
class DataIterationConfig : public IterationConfig {
public:
jint Handle(jlong class_tag, jlong size, jlong* tag_ptr, jint length) OVERRIDE {
@@ -154,10 +155,8 @@
return static_cast<jint>(config.class_tags_.size());
}
-extern "C" JNIEXPORT void JNICALL Java_Main_iterateThroughHeapAdd(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jint heap_filter,
- jclass klass_filter) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test906_iterateThroughHeapAdd(
+ JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint heap_filter, jclass klass_filter) {
class AddIterationConfig : public IterationConfig {
public:
AddIterationConfig() {}
@@ -178,7 +177,7 @@
Run(env, heap_filter, klass_filter, &config);
}
-extern "C" JNIEXPORT jstring JNICALL Java_Main_iterateThroughHeapString(
+extern "C" JNIEXPORT jstring JNICALL Java_art_Test906_iterateThroughHeapString(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
struct FindStringCallbacks {
explicit FindStringCallbacks(jlong t) : tag_to_find(t) {}
@@ -234,7 +233,7 @@
return env->NewStringUTF(fsc.data.c_str());
}
-extern "C" JNIEXPORT jstring JNICALL Java_Main_iterateThroughHeapPrimitiveArray(
+extern "C" JNIEXPORT jstring JNICALL Java_art_Test906_iterateThroughHeapPrimitiveArray(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
struct FindArrayCallbacks {
explicit FindArrayCallbacks(jlong t) : tag_to_find(t) {}
@@ -345,7 +344,7 @@
UNREACHABLE();
}
-extern "C" JNIEXPORT jstring JNICALL Java_Main_iterateThroughHeapPrimitiveFields(
+extern "C" JNIEXPORT jstring JNICALL Java_art_Test906_iterateThroughHeapPrimitiveFields(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jlong tag) {
struct FindFieldCallbacks {
explicit FindFieldCallbacks(jlong t) : tag_to_find(t) {}
diff --git a/test/906-iterate-heap/src/Main.java b/test/906-iterate-heap/src/Main.java
index 365ce0f..feebf9c 100644
--- a/test/906-iterate-heap/src/Main.java
+++ b/test/906-iterate-heap/src/Main.java
@@ -14,11 +14,14 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
import java.util.Collections;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test906 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test906.class);
doTest();
}
@@ -251,14 +254,18 @@
static int sI = 6;
}
- private static native void setTag(Object o, long tag);
- private static native long getTag(Object o);
-
private final static int HEAP_FILTER_OUT_TAGGED = 0x4;
private final static int HEAP_FILTER_OUT_UNTAGGED = 0x8;
private final static int HEAP_FILTER_OUT_CLASS_TAGGED = 0x10;
private final static int HEAP_FILTER_OUT_CLASS_UNTAGGED = 0x20;
+ private static void setTag(Object o, long tag) {
+ Main.setTag(o, tag);
+ }
+ private static long getTag(Object o) {
+ return Main.getTag(o);
+ }
+
private static native int iterateThroughHeapCount(int heapFilter,
Class<?> klassFilter, int stopAfter);
private static native int iterateThroughHeapData(int heapFilter,
diff --git a/test/907-get-loaded-classes/get_loaded_classes.cc b/test/907-get-loaded-classes/get_loaded_classes.cc
index 5ec56c4..1eadf15 100644
--- a/test/907-get-loaded-classes/get_loaded_classes.cc
+++ b/test/907-get-loaded-classes/get_loaded_classes.cc
@@ -39,7 +39,7 @@
return reinterpret_cast<jstring>(jni_env->CallObjectMethod(cls, mid));
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getLoadedClasses(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test907_getLoadedClasses(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
jint count = -1;
jclass* classes = nullptr;
diff --git a/test/907-get-loaded-classes/src/Main.java b/test/907-get-loaded-classes/src/Main.java
index 370185a..d654428 100644
--- a/test/907-get-loaded-classes/src/Main.java
+++ b/test/907-get-loaded-classes/src/Main.java
@@ -14,12 +14,15 @@
* limitations under the License.
*/
+package art;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test907 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test907.class);
doTest();
}
@@ -33,7 +36,8 @@
HashSet<String> classesSet = new HashSet<>(Arrays.asList(classes));
String[] shouldBeLoaded = new String[] {
- "java.lang.Object", "java.lang.Class", "java.lang.String", "Main$A", "Main$B", "[LMain$A;"
+ "java.lang.Object", "java.lang.Class", "java.lang.String", "art.Test907$A",
+ "art.Test907$B", "[Lart.Test907$A;"
};
boolean error = false;
diff --git a/test/908-gc-start-finish/gc_callbacks.cc b/test/908-gc-start-finish/gc_callbacks.cc
index f186895..ddd2ba7 100644
--- a/test/908-gc-start-finish/gc_callbacks.cc
+++ b/test/908-gc-start-finish/gc_callbacks.cc
@@ -40,7 +40,7 @@
starts++;
}
-extern "C" JNIEXPORT void JNICALL Java_Main_setupGcCallback(
+extern "C" JNIEXPORT void JNICALL Java_art_Test908_setupGcCallback(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
jvmtiEventCallbacks callbacks;
memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
@@ -51,9 +51,9 @@
JvmtiErrorToException(env, jvmti_env, ret);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_enableGcTracking(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jboolean enable) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test908_enableGcTracking(JNIEnv* env,
+ jclass klass ATTRIBUTE_UNUSED,
+ jboolean enable) {
jvmtiError ret = jvmti_env->SetEventNotificationMode(
enable ? JVMTI_ENABLE : JVMTI_DISABLE,
JVMTI_EVENT_GARBAGE_COLLECTION_START,
@@ -70,15 +70,15 @@
}
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getGcStarts(JNIEnv* env ATTRIBUTE_UNUSED,
- jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test908_getGcStarts(JNIEnv* env ATTRIBUTE_UNUSED,
+ jclass klass ATTRIBUTE_UNUSED) {
jint result = static_cast<jint>(starts);
starts = 0;
return result;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getGcFinishes(JNIEnv* env ATTRIBUTE_UNUSED,
- jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT jint JNICALL Java_art_Test908_getGcFinishes(JNIEnv* env ATTRIBUTE_UNUSED,
+ jclass klass ATTRIBUTE_UNUSED) {
jint result = static_cast<jint>(finishes);
finishes = 0;
return result;
diff --git a/test/908-gc-start-finish/src/Main.java b/test/908-gc-start-finish/src/Main.java
index 05388c9..ceaa98c 100644
--- a/test/908-gc-start-finish/src/Main.java
+++ b/test/908-gc-start-finish/src/Main.java
@@ -14,10 +14,13 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test908 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test908.class);
doTest();
}
diff --git a/test/910-methods/expected.txt b/test/910-methods/expected.txt
index e87929f..8e6b6e7 100644
--- a/test/910-methods/expected.txt
+++ b/test/910-methods/expected.txt
@@ -48,7 +48,7 @@
Is native: false
Is obsolete: false
Is synthetic: false
-class Main$NestedSynthetic
+class art.Test910$NestedSynthetic
4104
Max locals: 1
Argument size: 0
diff --git a/test/910-methods/methods.cc b/test/910-methods/methods.cc
index ded4f09..9c726e1 100644
--- a/test/910-methods/methods.cc
+++ b/test/910-methods/methods.cc
@@ -30,7 +30,7 @@
namespace art {
namespace Test910Methods {
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getMethodName(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test910_getMethodName(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -73,7 +73,7 @@
return ret;
}
-extern "C" JNIEXPORT jclass JNICALL Java_Main_getMethodDeclaringClass(
+extern "C" JNIEXPORT jclass JNICALL Java_art_Test910_getMethodDeclaringClass(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -86,7 +86,7 @@
return declaring_class;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getMethodModifiers(
+extern "C" JNIEXPORT jint JNICALL Java_art_Test910_getMethodModifiers(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -99,7 +99,7 @@
return modifiers;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getMaxLocals(
+extern "C" JNIEXPORT jint JNICALL Java_art_Test910_getMaxLocals(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -112,7 +112,7 @@
return max_locals;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getArgumentsSize(
+extern "C" JNIEXPORT jint JNICALL Java_art_Test910_getArgumentsSize(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -125,7 +125,7 @@
return arguments;
}
-extern "C" JNIEXPORT jlong JNICALL Java_Main_getMethodLocationStart(
+extern "C" JNIEXPORT jlong JNICALL Java_art_Test910_getMethodLocationStart(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -139,7 +139,7 @@
return start;
}
-extern "C" JNIEXPORT jlong JNICALL Java_Main_getMethodLocationEnd(
+extern "C" JNIEXPORT jlong JNICALL Java_art_Test910_getMethodLocationEnd(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -153,7 +153,7 @@
return end;
}
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_isMethodNative(
+extern "C" JNIEXPORT jboolean JNICALL Java_art_Test910_isMethodNative(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -166,7 +166,7 @@
return is_native;
}
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_isMethodObsolete(
+extern "C" JNIEXPORT jboolean JNICALL Java_art_Test910_isMethodObsolete(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
@@ -179,7 +179,7 @@
return is_obsolete;
}
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_isMethodSynthetic(
+extern "C" JNIEXPORT jboolean JNICALL Java_art_Test910_isMethodSynthetic(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject method) {
jmethodID id = env->FromReflectedMethod(method);
diff --git a/test/910-methods/src/Main.java b/test/910-methods/src/Main.java
index 932a1ea..b3490e9 100644
--- a/test/910-methods/src/Main.java
+++ b/test/910-methods/src/Main.java
@@ -14,12 +14,15 @@
* limitations under the License.
*/
+package art;
+
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Arrays;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test910 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test910.class);
doTest();
}
diff --git a/test/911-get-stack-trace/expected.txt b/test/911-get-stack-trace/expected.txt
index feabb20..2318414 100644
--- a/test/911-get-stack-trace/expected.txt
+++ b/test/911-get-stack-trace/expected.txt
@@ -4,72 +4,74 @@
From top
---------
getStackTrace (Ljava/lang/Thread;II)[[Ljava/lang/String; -1 -2
- print (Ljava/lang/Thread;II)V 0 34
- printOrWait (IILControlData;)V 6 39
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- doTest ()V 38 23
- main ([Ljava/lang/String;)V 3 21
+ print (Ljava/lang/Thread;II)V 0 36
+ printOrWait (IILart/ControlData;)V 6 41
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ doTest ()V 38 25
+ run ()V 20 26
+ main ([Ljava/lang/String;)V 0 19
---------
- print (Ljava/lang/Thread;II)V 0 34
- printOrWait (IILControlData;)V 6 39
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- doTest ()V 42 24
- main ([Ljava/lang/String;)V 3 21
+ print (Ljava/lang/Thread;II)V 0 36
+ printOrWait (IILart/ControlData;)V 6 41
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ doTest ()V 42 26
+ run ()V 20 26
+ main ([Ljava/lang/String;)V 0 19
---------
getStackTrace (Ljava/lang/Thread;II)[[Ljava/lang/String; -1 -2
- print (Ljava/lang/Thread;II)V 0 34
- printOrWait (IILControlData;)V 6 39
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
+ print (Ljava/lang/Thread;II)V 0 36
+ printOrWait (IILart/ControlData;)V 6 41
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
---------
- printOrWait (IILControlData;)V 6 39
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
+ printOrWait (IILart/ControlData;)V 6 41
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
From bottom
---------
- main ([Ljava/lang/String;)V 3 21
+ main ([Ljava/lang/String;)V 0 19
---------
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- doTest ()V 65 30
- main ([Ljava/lang/String;)V 3 21
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ doTest ()V 65 32
+ run ()V 20 26
+ main ([Ljava/lang/String;)V 0 19
---------
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ doTest ()V 69 33
################################
### Other thread (suspended) ###
@@ -77,135 +79,135 @@
From top
---------
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 26
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 28
---------
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 26
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 28
---------
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
From bottom
---------
- run ()V 4 26
+ run ()V 4 28
---------
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 28
---------
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
###########################
### Other thread (live) ###
###########################
From top
---------
- printOrWait (IILControlData;)V 44 52
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 59
+ printOrWait (IILart/ControlData;)V 44 54
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 61
---------
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 59
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 61
---------
- printOrWait (IILControlData;)V 44 52
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
+ printOrWait (IILart/ControlData;)V 44 54
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
---------
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
From bottom
---------
- run ()V 4 59
+ run ()V 4 61
---------
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 59
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 61
---------
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
################################
### Other threads (suspended) ###
@@ -261,82 +263,82 @@
---------
AllTraces Thread 0
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 1
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 2
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 3
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 4
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 5
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 6
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 7
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 8
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
AllTraces Thread 9
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
FinalizerDaemon
@@ -356,219 +358,220 @@
---------
main
getAllStackTraces (I)[[Ljava/lang/Object; -1 -2
- printAll (I)V 0 73
- doTest ()V 128 57
- main ([Ljava/lang/String;)V 27 33
+ printAll (I)V 0 75
+ doTest ()V 128 59
+ run ()V 44 38
+ main ([Ljava/lang/String;)V 0 19
---------
AllTraces Thread 0
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 1
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 2
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 3
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 4
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 5
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 6
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 7
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 8
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
AllTraces Thread 9
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 45
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 47
---------
FinalizerDaemon
@@ -588,9 +591,10 @@
---------
main
getAllStackTraces (I)[[Ljava/lang/Object; -1 -2
- printAll (I)V 0 73
- doTest ()V 133 59
- main ([Ljava/lang/String;)V 27 33
+ printAll (I)V 0 75
+ doTest ()V 133 61
+ run ()V 44 38
+ main ([Ljava/lang/String;)V 0 19
########################################
@@ -617,172 +621,175 @@
---------
ThreadListTraces Thread 0
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
ThreadListTraces Thread 2
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
ThreadListTraces Thread 4
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
ThreadListTraces Thread 6
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
ThreadListTraces Thread 8
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
---------
main
getThreadListStackTraces ([Ljava/lang/Thread;I)[[Ljava/lang/Object; -1 -2
- printList ([Ljava/lang/Thread;I)V 0 66
- doTest ()V 116 52
- main ([Ljava/lang/String;)V 35 37
+ printList ([Ljava/lang/Thread;I)V 0 68
+ doTest ()V 116 54
+ run ()V 52 42
+ main ([Ljava/lang/String;)V 0 19
---------
ThreadListTraces Thread 0
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 35
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 37
---------
ThreadListTraces Thread 2
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 35
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 37
---------
ThreadListTraces Thread 4
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 35
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 37
---------
ThreadListTraces Thread 6
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 35
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 37
---------
ThreadListTraces Thread 8
wait ()V -1 -2
- printOrWait (IILControlData;)V 24 45
- baz (IIILControlData;)Ljava/lang/Object; 2 30
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- baz (IIILControlData;)Ljava/lang/Object; 9 32
- bar (IIILControlData;)J 0 24
- foo (IIILControlData;)I 0 19
- run ()V 4 35
+ printOrWait (IILart/ControlData;)V 24 47
+ baz (IIILart/ControlData;)Ljava/lang/Object; 2 32
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
+ bar (IIILart/ControlData;)J 0 26
+ foo (IIILart/ControlData;)I 0 21
+ run ()V 4 37
---------
main
getThreadListStackTraces ([Ljava/lang/Thread;I)[[Ljava/lang/Object; -1 -2
- printList ([Ljava/lang/Thread;I)V 0 66
- doTest ()V 121 54
- main ([Ljava/lang/String;)V 35 37
+ printList ([Ljava/lang/Thread;I)V 0 68
+ doTest ()V 121 56
+ run ()V 52 42
+ main ([Ljava/lang/String;)V 0 19
###################
### Same thread ###
###################
-4
+5
JVMTI_ERROR_ILLEGAL_ARGUMENT
-[public static native java.lang.Object[] Frames.getFrameLocation(java.lang.Thread,int), ffffffff]
-[public static void Frames.doTestSameThread(), 38]
-[public static void Frames.doTest() throws java.lang.Exception, 0]
-[public static void Main.main(java.lang.String[]) throws java.lang.Exception, 2b]
+[public static native java.lang.Object[] art.Frames.getFrameLocation(java.lang.Thread,int), ffffffff]
+[public static void art.Frames.doTestSameThread(), 38]
+[public static void art.Frames.doTest() throws java.lang.Exception, 0]
+[public static void art.Test911.run() throws java.lang.Exception, 3c]
+[public static void Main.main(java.lang.String[]) throws java.lang.Exception, 0]
JVMTI_ERROR_NO_MORE_FRAMES
################################
@@ -791,23 +798,23 @@
18
JVMTI_ERROR_ILLEGAL_ARGUMENT
[public final native void java.lang.Object.wait() throws java.lang.InterruptedException, ffffffff]
-[private static void Recurse.printOrWait(int,int,ControlData), 18]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 2]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[public void Frames$1.run(), 4]
+[private static void art.Recurse.printOrWait(int,int,art.ControlData), 18]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 2]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[public void art.Frames$1.run(), 4]
JVMTI_ERROR_NO_MORE_FRAMES
###########################
@@ -815,22 +822,22 @@
###########################
17
JVMTI_ERROR_ILLEGAL_ARGUMENT
-[private static void Recurse.printOrWait(int,int,ControlData), 2c]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 2]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[private static java.lang.Object Recurse.baz(int,int,int,ControlData), 9]
-[private static long Recurse.bar(int,int,int,ControlData), 0]
-[public static int Recurse.foo(int,int,int,ControlData), 0]
-[public void Frames$2.run(), 4]
+[private static void art.Recurse.printOrWait(int,int,art.ControlData), 2c]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 2]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[private static java.lang.Object art.Recurse.baz(int,int,int,art.ControlData), 9]
+[private static long art.Recurse.bar(int,int,int,art.ControlData), 0]
+[public static int art.Recurse.foo(int,int,int,art.ControlData), 0]
+[public void art.Frames$2.run(), 4]
JVMTI_ERROR_NO_MORE_FRAMES
Done
diff --git a/test/911-get-stack-trace/src/AllTraces.java b/test/911-get-stack-trace/src/AllTraces.java
index 1d9aa96..d73f78b 100644
--- a/test/911-get-stack-trace/src/AllTraces.java
+++ b/test/911-get-stack-trace/src/AllTraces.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
import java.util.List;
diff --git a/test/911-get-stack-trace/src/ControlData.java b/test/911-get-stack-trace/src/ControlData.java
index 76ac4b8..b5f3291 100644
--- a/test/911-get-stack-trace/src/ControlData.java
+++ b/test/911-get-stack-trace/src/ControlData.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
import java.util.concurrent.CountDownLatch;
public class ControlData {
diff --git a/test/911-get-stack-trace/src/Frames.java b/test/911-get-stack-trace/src/Frames.java
index 54d4165..b3d81bf 100644
--- a/test/911-get-stack-trace/src/Frames.java
+++ b/test/911-get-stack-trace/src/Frames.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
import java.util.Arrays;
public class Frames {
diff --git a/test/911-get-stack-trace/src/Main.java b/test/911-get-stack-trace/src/Main.java
index 96a427d..71a5196 100644
--- a/test/911-get-stack-trace/src/Main.java
+++ b/test/911-get-stack-trace/src/Main.java
@@ -14,9 +14,14 @@
* limitations under the License.
*/
-public class Main {
- public static void main(String[] args) throws Exception {
- bindTest911Classes();
+package art;
+
+public class Test911 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(AllTraces.class);
+ Main.bindAgentJNIForClass(Frames.class);
+ Main.bindAgentJNIForClass(PrintThread.class);
+ Main.bindAgentJNIForClass(ThreadListTraces.class);
SameThread.doTest();
@@ -42,6 +47,4 @@
System.out.println("Done");
}
-
- private static native void bindTest911Classes();
}
diff --git a/test/911-get-stack-trace/src/OtherThread.java b/test/911-get-stack-trace/src/OtherThread.java
index 0a78523..675bff5 100644
--- a/test/911-get-stack-trace/src/OtherThread.java
+++ b/test/911-get-stack-trace/src/OtherThread.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
public class OtherThread {
public static void doTestOtherThreadWait() throws Exception {
System.out.println("################################");
diff --git a/test/911-get-stack-trace/src/PrintThread.java b/test/911-get-stack-trace/src/PrintThread.java
index 136fd80..de1da9c 100644
--- a/test/911-get-stack-trace/src/PrintThread.java
+++ b/test/911-get-stack-trace/src/PrintThread.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
diff --git a/test/911-get-stack-trace/src/Recurse.java b/test/911-get-stack-trace/src/Recurse.java
index 439fbaa..438fdfd 100644
--- a/test/911-get-stack-trace/src/Recurse.java
+++ b/test/911-get-stack-trace/src/Recurse.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
public class Recurse {
public static int foo(int x, int start, int max, ControlData data) {
bar(x, start, max, data);
diff --git a/test/911-get-stack-trace/src/SameThread.java b/test/911-get-stack-trace/src/SameThread.java
index f1e19e3..c9afad5 100644
--- a/test/911-get-stack-trace/src/SameThread.java
+++ b/test/911-get-stack-trace/src/SameThread.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
public class SameThread {
public static void doTest() throws Exception {
System.out.println("###################");
diff --git a/test/911-get-stack-trace/src/ThreadListTraces.java b/test/911-get-stack-trace/src/ThreadListTraces.java
index 14868e9..0de93de 100644
--- a/test/911-get-stack-trace/src/ThreadListTraces.java
+++ b/test/911-get-stack-trace/src/ThreadListTraces.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
public class ThreadListTraces {
public static void doTest() throws Exception {
System.out.println("########################################");
diff --git a/test/911-get-stack-trace/stack_trace.cc b/test/911-get-stack-trace/stack_trace.cc
index a499e90..985120c 100644
--- a/test/911-get-stack-trace/stack_trace.cc
+++ b/test/911-get-stack-trace/stack_trace.cc
@@ -37,14 +37,6 @@
using android::base::StringPrintf;
-extern "C" JNIEXPORT void JNICALL Java_Main_bindTest911Classes(
- JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
- BindFunctions(jvmti_env, env, "AllTraces");
- BindFunctions(jvmti_env, env, "Frames");
- BindFunctions(jvmti_env, env, "PrintThread");
- BindFunctions(jvmti_env, env, "ThreadListTraces");
-}
-
static jint FindLineNumber(jint line_number_count,
jvmtiLineNumberEntry* line_number_table,
jlocation location) {
@@ -132,7 +124,7 @@
return CreateObjectArray(env, count, "[Ljava/lang/String;", callback);
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_PrintThread_getStackTrace(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_PrintThread_getStackTrace(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thread, jint start, jint max) {
std::unique_ptr<jvmtiFrameInfo[]> frames(new jvmtiFrameInfo[max]);
@@ -147,7 +139,7 @@
return TranslateJvmtiFrameInfoArray(env, frames.get(), count);
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_AllTraces_getAllStackTraces(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_AllTraces_getAllStackTraces(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jint max) {
jint thread_count;
jvmtiStackInfo* stack_infos;
@@ -175,7 +167,7 @@
return ret;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_ThreadListTraces_getThreadListStackTraces(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_ThreadListTraces_getThreadListStackTraces(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobjectArray jthreads, jint max) {
jint thread_count = env->GetArrayLength(jthreads);
std::unique_ptr<jthread[]> threads(new jthread[thread_count]);
@@ -211,7 +203,7 @@
return ret;
}
-extern "C" JNIEXPORT jint JNICALL Java_Frames_getFrameCount(
+extern "C" JNIEXPORT jint JNICALL Java_art_Frames_getFrameCount(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thread) {
jint count;
jvmtiError result = jvmti_env->GetFrameCount(thread, &count);
@@ -221,7 +213,7 @@
return count;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Frames_getFrameLocation(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Frames_getFrameLocation(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jthread thread, jint depth) {
jmethodID method;
jlocation location;
diff --git a/test/912-classes/src/Main.java b/test/912-classes/src/Main.java
index 643b0807..6c8858a 100644
--- a/test/912-classes/src/Main.java
+++ b/test/912-classes/src/Main.java
@@ -23,6 +23,7 @@
public class Main {
public static void main(String[] args) throws Exception {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
diff --git a/test/913-heaps/heaps.cc b/test/913-heaps/heaps.cc
index 6a47ca1..6a06b29 100644
--- a/test/913-heaps/heaps.cc
+++ b/test/913-heaps/heaps.cc
@@ -44,8 +44,8 @@
using android::base::StringPrintf;
-extern "C" JNIEXPORT void JNICALL Java_Main_forceGarbageCollection(JNIEnv* env ATTRIBUTE_UNUSED,
- jclass klass ATTRIBUTE_UNUSED) {
+extern "C" JNIEXPORT void JNICALL Java_art_Test913_forceGarbageCollection(
+ JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED) {
jvmtiError ret = jvmti_env->ForceGarbageCollection();
if (ret != JVMTI_ERROR_NONE) {
char* err;
@@ -115,14 +115,15 @@
return true;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_followReferences(JNIEnv* env,
- jclass klass ATTRIBUTE_UNUSED,
- jint heap_filter,
- jclass klass_filter,
- jobject initial_object,
- jint stop_after,
- jint follow_set,
- jobject jniRef) {
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test913_followReferences(
+ JNIEnv* env,
+ jclass klass ATTRIBUTE_UNUSED,
+ jint heap_filter,
+ jclass klass_filter,
+ jobject initial_object,
+ jint stop_after,
+ jint follow_set,
+ jobject jniRef) {
class PrintIterationConfig FINAL : public IterationConfig {
public:
PrintIterationConfig(jint _stop_after, jint _follow_set)
@@ -503,7 +504,7 @@
return ret;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_followReferencesString(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test913_followReferencesString(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject initial_object) {
struct FindStringCallbacks {
static jint JNICALL FollowReferencesCallback(
@@ -566,7 +567,7 @@
}
-extern "C" JNIEXPORT jstring JNICALL Java_Main_followReferencesPrimitiveArray(
+extern "C" JNIEXPORT jstring JNICALL Java_art_Test913_followReferencesPrimitiveArray(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject initial_object) {
struct FindArrayCallbacks {
static jint JNICALL FollowReferencesCallback(
@@ -679,7 +680,7 @@
UNREACHABLE();
}
-extern "C" JNIEXPORT jstring JNICALL Java_Main_followReferencesPrimitiveFields(
+extern "C" JNIEXPORT jstring JNICALL Java_art_Test913_followReferencesPrimitiveFields(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jobject initial_object) {
struct FindFieldCallbacks {
static jint JNICALL FollowReferencesCallback(
@@ -746,5 +747,62 @@
return env->NewStringUTF(ffc.data.c_str());
}
+// This is copied from test 908. Consider moving this to the main shim.
+
+static size_t starts = 0;
+static size_t finishes = 0;
+
+static void JNICALL GarbageCollectionFinish(jvmtiEnv* ti_env ATTRIBUTE_UNUSED) {
+ finishes++;
+}
+
+static void JNICALL GarbageCollectionStart(jvmtiEnv* ti_env ATTRIBUTE_UNUSED) {
+ starts++;
+}
+
+extern "C" JNIEXPORT void JNICALL Java_art_Test913_setupGcCallback(
+ JNIEnv* env, jclass klass ATTRIBUTE_UNUSED) {
+ jvmtiEventCallbacks callbacks;
+ memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
+ callbacks.GarbageCollectionFinish = GarbageCollectionFinish;
+ callbacks.GarbageCollectionStart = GarbageCollectionStart;
+
+ jvmtiError ret = jvmti_env->SetEventCallbacks(&callbacks, sizeof(callbacks));
+ JvmtiErrorToException(env, jvmti_env, ret);
+}
+
+extern "C" JNIEXPORT void JNICALL Java_art_Test913_enableGcTracking(JNIEnv* env,
+ jclass klass ATTRIBUTE_UNUSED,
+ jboolean enable) {
+ jvmtiError ret = jvmti_env->SetEventNotificationMode(
+ enable ? JVMTI_ENABLE : JVMTI_DISABLE,
+ JVMTI_EVENT_GARBAGE_COLLECTION_START,
+ nullptr);
+ if (JvmtiErrorToException(env, jvmti_env, ret)) {
+ return;
+ }
+ ret = jvmti_env->SetEventNotificationMode(
+ enable ? JVMTI_ENABLE : JVMTI_DISABLE,
+ JVMTI_EVENT_GARBAGE_COLLECTION_FINISH,
+ nullptr);
+ if (JvmtiErrorToException(env, jvmti_env, ret)) {
+ return;
+ }
+}
+
+extern "C" JNIEXPORT jint JNICALL Java_art_Test913_getGcStarts(JNIEnv* env ATTRIBUTE_UNUSED,
+ jclass klass ATTRIBUTE_UNUSED) {
+ jint result = static_cast<jint>(starts);
+ starts = 0;
+ return result;
+}
+
+extern "C" JNIEXPORT jint JNICALL Java_art_Test913_getGcFinishes(JNIEnv* env ATTRIBUTE_UNUSED,
+ jclass klass ATTRIBUTE_UNUSED) {
+ jint result = static_cast<jint>(finishes);
+ finishes = 0;
+ return result;
+}
+
} // namespace Test913Heaps
} // namespace art
diff --git a/test/913-heaps/src/Main.java b/test/913-heaps/src/Main.java
index 10778ff..c54ecb0 100644
--- a/test/913-heaps/src/Main.java
+++ b/test/913-heaps/src/Main.java
@@ -14,14 +14,18 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test913 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test913.class);
+
doTest();
new TestConfig().doFollowReferencesTest();
@@ -69,7 +73,7 @@
setupGcCallback();
enableGcTracking(true);
- run();
+ runGc();
enableGcTracking(false);
}
@@ -191,7 +195,7 @@
System.out.println(getTag(floatObject));
}
- private static void run() {
+ private static void runGc() {
clearStats();
forceGarbageCollection();
printStats();
@@ -595,15 +599,19 @@
}
}
+ private static void setTag(Object o, long tag) {
+ Main.setTag(o, tag);
+ }
+ private static long getTag(Object o) {
+ return Main.getTag(o);
+ }
+
private static native void setupGcCallback();
private static native void enableGcTracking(boolean enable);
private static native int getGcStarts();
private static native int getGcFinishes();
private static native void forceGarbageCollection();
- public static native void setTag(Object o, long tag);
- public static native long getTag(Object o);
-
public static native String[] followReferences(int heapFilter, Class<?> klassFilter,
Object initialObject, int stopAfter, int followSet, Object jniRef);
public static native String[] followReferencesString(Object initialObject);
diff --git a/test/914-hello-obsolescence/src/Main.java b/test/914-hello-obsolescence/src/Main.java
index 8a14716..2ec7664 100644
--- a/test/914-hello-obsolescence/src/Main.java
+++ b/test/914-hello-obsolescence/src/Main.java
@@ -53,6 +53,7 @@
"AAACIAAAEQAAAKIBAAADIAAAAgAAAJECAAAAIAAAAQAAAJ8CAAAAEAAAAQAAALACAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/915-obsolete-2/src/Main.java b/test/915-obsolete-2/src/Main.java
index 0e3145c..fc73ee8 100644
--- a/test/915-obsolete-2/src/Main.java
+++ b/test/915-obsolete-2/src/Main.java
@@ -79,6 +79,7 @@
"IAAAFwAAAD4CAAADIAAABAAAAAgEAAAAIAAAAQAAACYEAAAAEAAAAQAAADwEAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/916-obsolete-jit/src/Main.java b/test/916-obsolete-jit/src/Main.java
index 2b3296f..3453261 100644
--- a/test/916-obsolete-jit/src/Main.java
+++ b/test/916-obsolete-jit/src/Main.java
@@ -113,6 +113,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform(), new TestWatcher());
}
diff --git a/test/917-fields-transformation/src/Main.java b/test/917-fields-transformation/src/Main.java
index 632a5c8..588af49 100644
--- a/test/917-fields-transformation/src/Main.java
+++ b/test/917-fields-transformation/src/Main.java
@@ -55,6 +55,7 @@
"AAIgAAAMAAAAXAEAAAMgAAACAAAA4QEAAAAgAAABAAAA8AEAAAAQAAABAAAABAIAAA==");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform("Hello", "Goodbye"),
new Transform("start", "end"));
}
diff --git a/test/918-fields/expected.txt b/test/918-fields/expected.txt
index 1a1209c..af78615 100644
--- a/test/918-fields/expected.txt
+++ b/test/918-fields/expected.txt
@@ -6,15 +6,15 @@
class java.lang.Integer
18
false
-[this$0, LMain;, null]
-class Main$Foo
+[this$0, Lart/Test918;, null]
+class art.Test918$Foo
4112
true
[VAL, I, null]
-interface Main$Bar
+interface art.Test918$Bar
25
false
[generics, Ljava/lang/Object;, TT;]
-class Main$Generics
+class art.Test918$Generics
0
false
diff --git a/test/918-fields/fields.cc b/test/918-fields/fields.cc
index 726c5cf..e63acef 100644
--- a/test/918-fields/fields.cc
+++ b/test/918-fields/fields.cc
@@ -28,7 +28,7 @@
namespace art {
namespace Test918Fields {
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getFieldName(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test918_getFieldName(
JNIEnv* env, jclass klass, jobject field) {
jfieldID id = env->FromReflectedField(field);
@@ -80,7 +80,7 @@
return ret;
}
-extern "C" JNIEXPORT jclass JNICALL Java_Main_getFieldDeclaringClass(
+extern "C" JNIEXPORT jclass JNICALL Java_art_Test918_getFieldDeclaringClass(
JNIEnv* env, jclass klass, jobject field) {
jfieldID id = env->FromReflectedField(field);
@@ -97,7 +97,7 @@
return declaring_class;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getFieldModifiers(
+extern "C" JNIEXPORT jint JNICALL Java_art_Test918_getFieldModifiers(
JNIEnv* env, jclass klass, jobject field) {
jfieldID id = env->FromReflectedField(field);
@@ -114,7 +114,7 @@
return modifiers;
}
-extern "C" JNIEXPORT jboolean JNICALL Java_Main_isFieldSynthetic(
+extern "C" JNIEXPORT jboolean JNICALL Java_art_Test918_isFieldSynthetic(
JNIEnv* env, jclass klass, jobject field) {
jfieldID id = env->FromReflectedField(field);
diff --git a/test/918-fields/src/Main.java b/test/918-fields/src/Main.java
index ad0d0c5..89d518c 100644
--- a/test/918-fields/src/Main.java
+++ b/test/918-fields/src/Main.java
@@ -14,11 +14,14 @@
* limitations under the License.
*/
+package art;
+
import java.lang.reflect.Field;
import java.util.Arrays;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test918 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test918.class);
doTest();
}
diff --git a/test/919-obsolete-fields/src/Main.java b/test/919-obsolete-fields/src/Main.java
index ffb9897..34ee2a9 100644
--- a/test/919-obsolete-fields/src/Main.java
+++ b/test/919-obsolete-fields/src/Main.java
@@ -116,6 +116,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
TestWatcher w = new TestWatcher();
doTest(new Transform(w), w);
}
diff --git a/test/920-objects/objects.cc b/test/920-objects/objects.cc
index 5263e75..101ebb9 100644
--- a/test/920-objects/objects.cc
+++ b/test/920-objects/objects.cc
@@ -27,7 +27,7 @@
namespace art {
namespace Test920Objects {
-extern "C" JNIEXPORT jlong JNICALL Java_Main_getObjectSize(
+extern "C" JNIEXPORT jlong JNICALL Java_art_Test920_getObjectSize(
JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED, jobject object) {
jlong size;
@@ -43,7 +43,7 @@
return size;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getObjectHashCode(
+extern "C" JNIEXPORT jint JNICALL Java_art_Test920_getObjectHashCode(
JNIEnv* env ATTRIBUTE_UNUSED, jclass klass ATTRIBUTE_UNUSED, jobject object) {
jint hash;
diff --git a/test/920-objects/src/Main.java b/test/920-objects/src/Main.java
index 5dbe1a7..708e417 100644
--- a/test/920-objects/src/Main.java
+++ b/test/920-objects/src/Main.java
@@ -14,13 +14,14 @@
* limitations under the License.
*/
+package art;
+
import java.lang.reflect.Field;
import java.util.Arrays;
-public class Main {
- public static void main(String[] args) throws Exception {
- System.loadLibrary(args[1]);
-
+public class Test920 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test920.class);
doTest();
}
diff --git a/test/921-hello-failure/src/Main.java b/test/921-hello-failure/src/Main.java
index 6779ed8..d9a4948 100644
--- a/test/921-hello-failure/src/Main.java
+++ b/test/921-hello-failure/src/Main.java
@@ -18,6 +18,8 @@
public class Main {
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
+
Verification.doTest(new Transform());
NewName.doTest(new Transform());
DifferentAccess.doTest(new Transform());
diff --git a/test/922-properties/properties.cc b/test/922-properties/properties.cc
index 896e4c3..6af45f5 100644
--- a/test/922-properties/properties.cc
+++ b/test/922-properties/properties.cc
@@ -29,7 +29,7 @@
namespace art {
namespace Test922Properties {
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getSystemProperties(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test922_getSystemProperties(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jint count;
char** properties;
@@ -54,7 +54,7 @@
return ret;
}
-extern "C" JNIEXPORT jstring JNICALL Java_Main_getSystemProperty(
+extern "C" JNIEXPORT jstring JNICALL Java_art_Test922_getSystemProperty(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jstring key) {
ScopedUtfChars string(env, key);
if (string.c_str() == nullptr) {
@@ -74,7 +74,7 @@
return ret;
}
-extern "C" JNIEXPORT void JNICALL Java_Main_setSystemProperty(
+extern "C" JNIEXPORT void JNICALL Java_art_Test922_setSystemProperty(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jstring key, jstring value) {
ScopedUtfChars key_string(env, key);
if (key_string.c_str() == nullptr) {
diff --git a/test/922-properties/src/Main.java b/test/922-properties/src/Main.java
index 8ad742f..4b2204a 100644
--- a/test/922-properties/src/Main.java
+++ b/test/922-properties/src/Main.java
@@ -14,11 +14,14 @@
* limitations under the License.
*/
+package art;
+
import java.util.Set;
import java.util.TreeSet;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test922 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test922.class);
doTest();
}
diff --git a/test/923-monitors/monitors.cc b/test/923-monitors/monitors.cc
index 6369a74..9afe22d 100644
--- a/test/923-monitors/monitors.cc
+++ b/test/923-monitors/monitors.cc
@@ -37,7 +37,7 @@
return reinterpret_cast<jrawMonitorID>(static_cast<uintptr_t>(l));
}
-extern "C" JNIEXPORT jlong JNICALL Java_Main_createRawMonitor(
+extern "C" JNIEXPORT jlong JNICALL Java_art_Test923_createRawMonitor(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jrawMonitorID id;
jvmtiError result = jvmti_env->CreateRawMonitor("dummy", &id);
@@ -47,37 +47,37 @@
return MonitorToLong(id);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_destroyRawMonitor(
+extern "C" JNIEXPORT void JNICALL Java_art_Test923_destroyRawMonitor(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
jvmtiError result = jvmti_env->DestroyRawMonitor(LongToMonitor(l));
JvmtiErrorToException(env, jvmti_env, result);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_rawMonitorEnter(
+extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorEnter(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
jvmtiError result = jvmti_env->RawMonitorEnter(LongToMonitor(l));
JvmtiErrorToException(env, jvmti_env, result);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_rawMonitorExit(
+extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorExit(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
jvmtiError result = jvmti_env->RawMonitorExit(LongToMonitor(l));
JvmtiErrorToException(env, jvmti_env, result);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_rawMonitorWait(
+extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorWait(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l, jlong millis) {
jvmtiError result = jvmti_env->RawMonitorWait(LongToMonitor(l), millis);
JvmtiErrorToException(env, jvmti_env, result);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_rawMonitorNotify(
+extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorNotify(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
jvmtiError result = jvmti_env->RawMonitorNotify(LongToMonitor(l));
JvmtiErrorToException(env, jvmti_env, result);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_rawMonitorNotifyAll(
+extern "C" JNIEXPORT void JNICALL Java_art_Test923_rawMonitorNotifyAll(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jlong l) {
jvmtiError result = jvmti_env->RawMonitorNotifyAll(LongToMonitor(l));
JvmtiErrorToException(env, jvmti_env, result);
diff --git a/test/923-monitors/src/Main.java b/test/923-monitors/src/Main.java
index ef00728..02e86a6 100644
--- a/test/923-monitors/src/Main.java
+++ b/test/923-monitors/src/Main.java
@@ -14,13 +14,16 @@
* limitations under the License.
*/
+package art;
+
import java.util.concurrent.CountDownLatch;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test923 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test923.class);
doTest();
}
diff --git a/test/924-threads/src/Main.java b/test/924-threads/src/Main.java
index 7328560..160bf8e 100644
--- a/test/924-threads/src/Main.java
+++ b/test/924-threads/src/Main.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
@@ -24,8 +26,9 @@
import java.util.List;
import java.util.Map;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test924 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test924.class);
doTest();
}
diff --git a/test/924-threads/threads.cc b/test/924-threads/threads.cc
index a8b37ec..701ab1d 100644
--- a/test/924-threads/threads.cc
+++ b/test/924-threads/threads.cc
@@ -34,7 +34,7 @@
// private static native Thread getCurrentThread();
// private static native Object[] getThreadInfo(Thread t);
-extern "C" JNIEXPORT jthread JNICALL Java_Main_getCurrentThread(
+extern "C" JNIEXPORT jthread JNICALL Java_art_Test924_getCurrentThread(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jthread thread = nullptr;
jvmtiError result = jvmti_env->GetCurrentThread(&thread);
@@ -44,7 +44,7 @@
return thread;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getThreadInfo(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test924_getThreadInfo(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread) {
jvmtiThreadInfo info;
memset(&info, 0, sizeof(jvmtiThreadInfo));
@@ -92,7 +92,7 @@
return ret;
}
-extern "C" JNIEXPORT jint JNICALL Java_Main_getThreadState(
+extern "C" JNIEXPORT jint JNICALL Java_art_Test924_getThreadState(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread) {
jint state;
jvmtiError result = jvmti_env->GetThreadState(thread, &state);
@@ -102,7 +102,7 @@
return state;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getAllThreads(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test924_getAllThreads(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jint thread_count;
jthread* threads;
@@ -122,7 +122,7 @@
return ret;
}
-extern "C" JNIEXPORT jlong JNICALL Java_Main_getTLS(
+extern "C" JNIEXPORT jlong JNICALL Java_art_Test924_getTLS(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread) {
void* tls;
jvmtiError result = jvmti_env->GetThreadLocalStorage(thread, &tls);
@@ -132,7 +132,7 @@
return static_cast<jlong>(reinterpret_cast<uintptr_t>(tls));
}
-extern "C" JNIEXPORT void JNICALL Java_Main_setTLS(
+extern "C" JNIEXPORT void JNICALL Java_art_Test924_setTLS(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthread thread, jlong val) {
const void* tls = reinterpret_cast<void*>(static_cast<uintptr_t>(val));
jvmtiError result = jvmti_env->SetThreadLocalStorage(thread, tls);
@@ -168,7 +168,7 @@
ThreadEvent(jvmti_env, jni_env, thread, false);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_enableThreadEvents(
+extern "C" JNIEXPORT void JNICALL Java_art_Test924_enableThreadEvents(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jboolean b) {
if (b == JNI_FALSE) {
jvmtiError ret = jvmti_env->SetEventNotificationMode(JVMTI_DISABLE,
diff --git a/test/925-threadgroups/src/Main.java b/test/925-threadgroups/src/Main.java
index bf7441f..14ca7a7 100644
--- a/test/925-threadgroups/src/Main.java
+++ b/test/925-threadgroups/src/Main.java
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+package art;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
@@ -21,8 +23,9 @@
import java.util.Iterator;
import java.util.List;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test925 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test925.class);
doTest();
}
diff --git a/test/925-threadgroups/threadgroups.cc b/test/925-threadgroups/threadgroups.cc
index d555553..cc053bc 100644
--- a/test/925-threadgroups/threadgroups.cc
+++ b/test/925-threadgroups/threadgroups.cc
@@ -35,7 +35,7 @@
// // Returns an array where element 0 is an array of threads and element 1 is an array of groups.
// private static native Object[] getThreadGroupChildren();
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getTopThreadGroups(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test925_getTopThreadGroups(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jthreadGroup* groups;
jint group_count;
@@ -54,7 +54,7 @@
return ret;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getThreadGroupInfo(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test925_getThreadGroupInfo(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthreadGroup group) {
jvmtiThreadGroupInfo info;
jvmtiError result = jvmti_env->GetThreadGroupInfo(group, &info);
@@ -86,7 +86,7 @@
return CreateObjectArray(env, 4, "java/lang/Object", callback);
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getThreadGroupChildren(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test925_getThreadGroupChildren(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED, jthreadGroup group) {
jint thread_count;
jthread* threads;
diff --git a/test/926-multi-obsolescence/src/Main.java b/test/926-multi-obsolescence/src/Main.java
index 6d9f96c..2440908 100644
--- a/test/926-multi-obsolescence/src/Main.java
+++ b/test/926-multi-obsolescence/src/Main.java
@@ -92,6 +92,7 @@
"AACUAQAAAiAAABEAAACiAQAAAyAAAAIAAACXAgAAACAAAAEAAAClAgAAABAAAAEAAAC0AgAA"));
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform(), new Transform2());
}
diff --git a/test/927-timers/src/Main.java b/test/927-timers/src/Main.java
index b67f66d..1ed0160 100644
--- a/test/927-timers/src/Main.java
+++ b/test/927-timers/src/Main.java
@@ -14,10 +14,13 @@
* limitations under the License.
*/
+package art;
+
import java.util.Arrays;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test927 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test927.class);
doTest();
}
diff --git a/test/927-timers/timers.cc b/test/927-timers/timers.cc
index 55d3921..9eaac71 100644
--- a/test/927-timers/timers.cc
+++ b/test/927-timers/timers.cc
@@ -31,7 +31,7 @@
namespace art {
namespace Test926Timers {
-extern "C" JNIEXPORT jint JNICALL Java_Main_getAvailableProcessors(
+extern "C" JNIEXPORT jint JNICALL Java_art_Test927_getAvailableProcessors(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jint count;
jvmtiError result = jvmti_env->GetAvailableProcessors(&count);
@@ -41,7 +41,7 @@
return count;
}
-extern "C" JNIEXPORT jlong JNICALL Java_Main_getTime(
+extern "C" JNIEXPORT jlong JNICALL Java_art_Test927_getTime(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jlong time;
jvmtiError result = jvmti_env->GetTime(&time);
@@ -51,7 +51,7 @@
return time;
}
-extern "C" JNIEXPORT jobjectArray JNICALL Java_Main_getTimerInfo(
+extern "C" JNIEXPORT jobjectArray JNICALL Java_art_Test927_getTimerInfo(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jvmtiTimerInfo info;
jvmtiError result = jvmti_env->GetTimerInfo(&info);
diff --git a/test/928-jni-table/jni_table.cc b/test/928-jni-table/jni_table.cc
index 26a6707..9a8b7fe 100644
--- a/test/928-jni-table/jni_table.cc
+++ b/test/928-jni-table/jni_table.cc
@@ -39,7 +39,7 @@
return gOriginalEnv->NewGlobalRef(env, o);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_doJNITableTest(
+extern "C" JNIEXPORT void JNICALL Java_art_Test928_doJNITableTest(
JNIEnv* env, jclass klass) {
// Get the current table, as the delegate.
jvmtiError getorig_result = jvmti_env->GetJNIFunctionTable(&gOriginalEnv);
diff --git a/test/928-jni-table/src/Main.java b/test/928-jni-table/src/Main.java
index fd61b7d..3f3935d 100644
--- a/test/928-jni-table/src/Main.java
+++ b/test/928-jni-table/src/Main.java
@@ -14,8 +14,11 @@
* limitations under the License.
*/
-public class Main {
- public static void main(String[] args) throws Exception {
+package art;
+
+public class Test928 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test928.class);
doJNITableTest();
System.out.println("Done");
diff --git a/test/929-search/src/Main.java b/test/929-search/src/Main.java
index bbeb081..4073c3f 100644
--- a/test/929-search/src/Main.java
+++ b/test/929-search/src/Main.java
@@ -18,6 +18,7 @@
public class Main {
public static void main(String[] args) throws Exception {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
diff --git a/test/930-hello-retransform/src/Main.java b/test/930-hello-retransform/src/Main.java
index 0063c82..da59c74 100644
--- a/test/930-hello-retransform/src/Main.java
+++ b/test/930-hello-retransform/src/Main.java
@@ -49,6 +49,7 @@
"AgAAABMCAAAAIAAAAQAAAB4CAAAAEAAAAQAAACwCAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/931-agent-thread/agent_thread.cc b/test/931-agent-thread/agent_thread.cc
index f9af8cf..577a97e 100644
--- a/test/931-agent-thread/agent_thread.cc
+++ b/test/931-agent-thread/agent_thread.cc
@@ -89,7 +89,7 @@
CHECK(wait_result == PTHREAD_BARRIER_SERIAL_THREAD || wait_result == 0);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_testAgentThread(
+extern "C" JNIEXPORT void JNICALL Java_art_Test931_testAgentThread(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
// Create a Thread object.
ScopedLocalRef<jobject> thread_name(env, env->NewStringUTF("Agent Thread"));
diff --git a/test/931-agent-thread/src/Main.java b/test/931-agent-thread/src/Main.java
index a7639fb..bc096a7 100644
--- a/test/931-agent-thread/src/Main.java
+++ b/test/931-agent-thread/src/Main.java
@@ -14,10 +14,13 @@
* limitations under the License.
*/
+package art;
+
import java.util.Arrays;
-public class Main {
- public static void main(String[] args) throws Exception {
+public class Test931 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test931.class);
testAgentThread();
System.out.println("Done");
diff --git a/test/932-transform-saves/src/Main.java b/test/932-transform-saves/src/Main.java
index d960322..14e5da0 100644
--- a/test/932-transform-saves/src/Main.java
+++ b/test/932-transform-saves/src/Main.java
@@ -79,6 +79,7 @@
"AgAAABMCAAAAIAAAAQAAAB4CAAAAEAAAAQAAACwCAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/933-misc-events/misc_events.cc b/test/933-misc-events/misc_events.cc
index 2b74c40..27dab8b 100644
--- a/test/933-misc-events/misc_events.cc
+++ b/test/933-misc-events/misc_events.cc
@@ -37,7 +37,7 @@
saw_dump_request.store(true, std::memory_order::memory_order_relaxed);
}
-extern "C" JNIEXPORT void JNICALL Java_Main_testSigQuit(
+extern "C" JNIEXPORT void JNICALL Java_art_Test933_testSigQuit(
JNIEnv* env, jclass Main_klass ATTRIBUTE_UNUSED) {
jvmtiEventCallbacks callbacks;
memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
diff --git a/test/933-misc-events/src/Main.java b/test/933-misc-events/src/Main.java
index 89801a3..afebbf8 100644
--- a/test/933-misc-events/src/Main.java
+++ b/test/933-misc-events/src/Main.java
@@ -14,8 +14,11 @@
* limitations under the License.
*/
-public class Main {
- public static void main(String[] args) throws Exception {
+package art;
+
+public class Test933 {
+ public static void run() throws Exception {
+ Main.bindAgentJNIForClass(Test933.class);
testSigQuit();
System.out.println("Done");
diff --git a/test/934-load-transform/src/Main.java b/test/934-load-transform/src/Main.java
index de312b0..606ce78 100644
--- a/test/934-load-transform/src/Main.java
+++ b/test/934-load-transform/src/Main.java
@@ -66,6 +66,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
// Don't pop transformations. Make sure that even if 2 threads race to define the class both
// will get the same result.
setPopRetransformations(false);
diff --git a/test/935-non-retransformable/src/Main.java b/test/935-non-retransformable/src/Main.java
index 82ba197..df92561 100644
--- a/test/935-non-retransformable/src/Main.java
+++ b/test/935-non-retransformable/src/Main.java
@@ -74,6 +74,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
setPopRetransformations(false);
addCommonTransformationResult("Transform", CLASS_BYTES, DEX_BYTES);
enableCommonRetransformation(true);
diff --git a/test/936-search-onload/src/Main.java b/test/936-search-onload/src/Main.java
index 2e7a871..8d40753 100644
--- a/test/936-search-onload/src/Main.java
+++ b/test/936-search-onload/src/Main.java
@@ -18,6 +18,7 @@
public class Main {
public static void main(String[] args) throws Exception {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
diff --git a/test/937-hello-retransform-package/src/Main.java b/test/937-hello-retransform-package/src/Main.java
index 4b9271b..866f75d 100644
--- a/test/937-hello-retransform-package/src/Main.java
+++ b/test/937-hello-retransform-package/src/Main.java
@@ -53,6 +53,7 @@
"YgEAAAMgAAACAAAAGwIAAAAgAAABAAAAJgIAAAAQAAABAAAANAIAAA==");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/938-load-transform-bcp/src/Main.java b/test/938-load-transform-bcp/src/Main.java
index 5484899..21b841f 100644
--- a/test/938-load-transform-bcp/src/Main.java
+++ b/test/938-load-transform-bcp/src/Main.java
@@ -96,6 +96,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
setPopRetransformations(false);
addCommonTransformationResult("java/util/OptionalLong", CLASS_BYTES, DEX_BYTES);
enableCommonRetransformation(true);
diff --git a/test/939-hello-transformation-bcp/src/Main.java b/test/939-hello-transformation-bcp/src/Main.java
index bdf7f59..0e1f845 100644
--- a/test/939-hello-transformation-bcp/src/Main.java
+++ b/test/939-hello-transformation-bcp/src/Main.java
@@ -110,6 +110,7 @@
"AABHBgAABCAAAAIAAACVBgAAACAAAAEAAACtBgAAABAAAAEAAAD4BgAA");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
// OptionalLong is a class that is unlikely to be used by the time this test starts and is not
// likely to be changed in any meaningful way in the future.
OptionalLong ol = OptionalLong.of(0xDEADBEEF);
diff --git a/test/940-recursive-obsolete/src/Main.java b/test/940-recursive-obsolete/src/Main.java
index 3766906..724f82d 100644
--- a/test/940-recursive-obsolete/src/Main.java
+++ b/test/940-recursive-obsolete/src/Main.java
@@ -70,6 +70,7 @@
"1gMAAAAQAAABAAAA5AMAAA==");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/941-recurive-obsolete-jit/src/Main.java b/test/941-recurive-obsolete-jit/src/Main.java
index f6d6416..d88bb9b 100644
--- a/test/941-recurive-obsolete-jit/src/Main.java
+++ b/test/941-recurive-obsolete-jit/src/Main.java
@@ -99,6 +99,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/942-private-recursive/src/Main.java b/test/942-private-recursive/src/Main.java
index 8cbab7b..cac75c0 100644
--- a/test/942-private-recursive/src/Main.java
+++ b/test/942-private-recursive/src/Main.java
@@ -75,6 +75,7 @@
"IAAAAQAAABAEAAAAEAAAAQAAACQEAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/943-private-recursive-jit/src/Main.java b/test/943-private-recursive-jit/src/Main.java
index 8fa534d..f380c06 100644
--- a/test/943-private-recursive-jit/src/Main.java
+++ b/test/943-private-recursive-jit/src/Main.java
@@ -109,6 +109,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/944-transform-classloaders/src/Main.java b/test/944-transform-classloaders/src/Main.java
index 4911e00..b558660 100644
--- a/test/944-transform-classloaders/src/Main.java
+++ b/test/944-transform-classloaders/src/Main.java
@@ -203,6 +203,8 @@
}
private static void doTest() throws Exception {
+ art.Main.bindAgentJNIForClass(Main.class);
+
Transform t = new Transform();
Transform2 t2 = new Transform2();
diff --git a/test/945-obsolete-native/src/Main.java b/test/945-obsolete-native/src/Main.java
index 5e2154e..a7901cd 100644
--- a/test/945-obsolete-native/src/Main.java
+++ b/test/945-obsolete-native/src/Main.java
@@ -55,6 +55,7 @@
"AA==");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
bindTest945ObsoleteNative();
doTest(new Transform());
}
diff --git a/test/946-obsolete-throw/expected.txt b/test/946-obsolete-throw/expected.txt
index 91dd7df..71d5182 100644
--- a/test/946-obsolete-throw/expected.txt
+++ b/test/946-obsolete-throw/expected.txt
@@ -5,10 +5,10 @@
transforming calling function
Received error : java.lang.Error: Throwing exception into an obsolete method!
java.lang.Error: Throwing exception into an obsolete method!
- at Main$DoRedefinitionClass.run(Main.java:64)
+ at Main$DoRedefinitionClass.run(Main.java:65)
at Transform.sayHi(Transform.java:27)
- at Main.doTest(Main.java:71)
- at Main.main(Main.java:56)
+ at Main.doTest(Main.java:72)
+ at Main.main(Main.java:57)
Hello - Transformed
Not doing anything here
Goodbye - Transformed
diff --git a/test/946-obsolete-throw/src/Main.java b/test/946-obsolete-throw/src/Main.java
index 21fe972..077ad72 100644
--- a/test/946-obsolete-throw/src/Main.java
+++ b/test/946-obsolete-throw/src/Main.java
@@ -53,6 +53,7 @@
"AAACIAAAEQAAAKIBAAADIAAAAgAAAJECAAAAIAAAAQAAAJ8CAAAAEAAAAQAAALACAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/947-reflect-method/src/Main.java b/test/947-reflect-method/src/Main.java
index a229dd4..da746ac 100644
--- a/test/947-reflect-method/src/Main.java
+++ b/test/947-reflect-method/src/Main.java
@@ -51,6 +51,7 @@
"AgAAABMCAAAAIAAAAQAAAB4CAAAAEAAAAQAAACwCAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/948-change-annotations/src/Main.java b/test/948-change-annotations/src/Main.java
index 30bfbf9..a290396 100644
--- a/test/948-change-annotations/src/Main.java
+++ b/test/948-change-annotations/src/Main.java
@@ -55,6 +55,7 @@
"AAQgAAACAAAAmwIAAAAgAAABAAAApwIAAAAQAAABAAAAuAIAAA==");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new RemoveAnnotationsTest());
doTest(new AddAnnotationsTest());
doTest(new ChangeAnnotationValues());
diff --git a/test/949-in-memory-transform/src/Main.java b/test/949-in-memory-transform/src/Main.java
index 2ffabf5..1a6b224 100644
--- a/test/949-in-memory-transform/src/Main.java
+++ b/test/949-in-memory-transform/src/Main.java
@@ -83,6 +83,7 @@
"AgAAABMCAAAAIAAAAQAAAB4CAAAAEAAAAQAAACwCAAA=");
public static void main(String[] args) throws Exception {
+ art.Main.bindAgentJNIForClass(Main.class);
ClassLoader loader;
try {
// Art uses this classloader to do in-memory dex files. There is no support for defineClass
diff --git a/test/950-redefine-intrinsic/src/Main.java b/test/950-redefine-intrinsic/src/Main.java
index 30cd3ab..2578d6e 100644
--- a/test/950-redefine-intrinsic/src/Main.java
+++ b/test/950-redefine-intrinsic/src/Main.java
@@ -425,6 +425,7 @@
}
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(10000);
}
diff --git a/test/951-threaded-obsolete/src/Main.java b/test/951-threaded-obsolete/src/Main.java
index 98e7236..a82090e 100644
--- a/test/951-threaded-obsolete/src/Main.java
+++ b/test/951-threaded-obsolete/src/Main.java
@@ -54,6 +54,7 @@
"AAACIAAAEQAAAKIBAAADIAAAAgAAAJECAAAAIAAAAQAAAJ8CAAAAEAAAAQAAALACAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
// Semaphores to let each thread know where the other is. We could use barriers but semaphores
// mean we don't need to have the worker thread be waiting around.
final Semaphore sem_redefine_start = new Semaphore(0);
diff --git a/test/980-redefine-object/src/Main.java b/test/980-redefine-object/src/Main.java
index 348951c..a50215e 100644
--- a/test/980-redefine-object/src/Main.java
+++ b/test/980-redefine-object/src/Main.java
@@ -288,6 +288,7 @@
System.getenv("DEX_LOCATION") + "/980-redefine-object-ex.jar";
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
diff --git a/test/981-dedup-original-dex/src/Main.java b/test/981-dedup-original-dex/src/Main.java
index 1e063cf..288f7ce 100644
--- a/test/981-dedup-original-dex/src/Main.java
+++ b/test/981-dedup-original-dex/src/Main.java
@@ -117,6 +117,7 @@
"AyAAAAIAAAAWAgAAACAAAAEAAAAhAgAAABAAAAEAAAAwAgAA");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
try {
doTest();
} catch (Exception e) {
diff --git a/test/982-ok-no-retransform/src/Main.java b/test/982-ok-no-retransform/src/Main.java
index 7bb4a46..33e50d7 100644
--- a/test/982-ok-no-retransform/src/Main.java
+++ b/test/982-ok-no-retransform/src/Main.java
@@ -18,6 +18,7 @@
public class Main {
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
diff --git a/test/983-source-transform-verify/src/Main.java b/test/983-source-transform-verify/src/Main.java
index 5f42d29..ad081a2 100644
--- a/test/983-source-transform-verify/src/Main.java
+++ b/test/983-source-transform-verify/src/Main.java
@@ -18,6 +18,7 @@
public class Main {
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
diff --git a/test/984-obsolete-invoke/src/Main.java b/test/984-obsolete-invoke/src/Main.java
index 1a8d9bc..418d64d 100644
--- a/test/984-obsolete-invoke/src/Main.java
+++ b/test/984-obsolete-invoke/src/Main.java
@@ -54,6 +54,7 @@
"AAACIAAAEQAAAKIBAAADIAAAAgAAAJECAAAAIAAAAQAAAJ8CAAAAEAAAAQAAALACAAA=");
public static void main(String[] args) {
+ art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
diff --git a/test/Android.bp b/test/Android.bp
index b79006f..9a8e174 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -245,6 +245,7 @@
defaults: ["libartagent-defaults"],
srcs: [
// These are the ART-independent parts.
+ "ti-agent/agent_common.cc",
"ti-agent/agent_startup.cc",
"ti-agent/jni_binder.cc",
"ti-agent/jvmti_helper.cc",
diff --git a/test/ti-agent/agent_common.cc b/test/ti-agent/agent_common.cc
new file mode 100644
index 0000000..9a91258
--- /dev/null
+++ b/test/ti-agent/agent_common.cc
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "android-base/logging.h"
+#include "android-base/macros.h"
+
+#include "jvmti_helper.h"
+#include "test_env.h"
+
+namespace art {
+
+// Common JNI functions.
+
+extern "C" JNIEXPORT void JNICALL Java_art_Main_setTag(
+ JNIEnv* env, jclass, jobject obj, jlong tag) {
+ jvmtiError ret = jvmti_env->SetTag(obj, tag);
+ JvmtiErrorToException(env, jvmti_env, ret);
+}
+
+extern "C" JNIEXPORT jlong JNICALL Java_art_Main_getTag(JNIEnv* env, jclass, jobject obj) {
+ jlong tag = 0;
+ jvmtiError ret = jvmti_env->GetTag(obj, &tag);
+ if (JvmtiErrorToException(env, jvmti_env, ret)) {
+ return 0;
+ }
+ return tag;
+}
+
+} // namespace art
diff --git a/test/ti-agent/agent_startup.cc b/test/ti-agent/agent_startup.cc
index b55db7b..be73de5 100644
--- a/test/ti-agent/agent_startup.cc
+++ b/test/ti-agent/agent_startup.cc
@@ -21,28 +21,30 @@
#include "jni_binder.h"
#include "jvmti_helper.h"
+#include "scoped_utf_chars.h"
+#include "test_env.h"
namespace art {
-static constexpr const char* kMainClass = "Main";
+static constexpr const char* kMainClass = "art/Main";
static StartCallback gCallback = nullptr;
// TODO: Check this. This may not work on device. The classloader containing the app's classes
// may not have been created at this point (i.e., if it's not the system classloader).
-static void JNICALL VMInitCallback(jvmtiEnv* jvmti_env,
+static void JNICALL VMInitCallback(jvmtiEnv* callback_jvmti_env,
JNIEnv* jni_env,
jthread thread ATTRIBUTE_UNUSED) {
// Bind kMainClass native methods.
- BindFunctions(jvmti_env, jni_env, kMainClass);
+ BindFunctions(callback_jvmti_env, jni_env, kMainClass);
if (gCallback != nullptr) {
- gCallback(jvmti_env, jni_env);
+ gCallback(callback_jvmti_env, jni_env);
gCallback = nullptr;
}
// And delete the jvmtiEnv.
- jvmti_env->DisposeEnvironment();
+ callback_jvmti_env->DisposeEnvironment();
}
// Install a phase callback that will bind JNI functions on VMInit.
@@ -76,20 +78,32 @@
CHECK_EQ(0, vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6))
<< "Could not get JNIEnv";
- jvmtiEnv* jvmti_env;
- CHECK_EQ(0, vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0))
+ jvmtiEnv* bind_jvmti_env;
+ CHECK_EQ(0, vm->GetEnv(reinterpret_cast<void**>(&bind_jvmti_env), JVMTI_VERSION_1_0))
<< "Could not get jvmtiEnv";
- SetAllCapabilities(jvmti_env);
+ SetAllCapabilities(bind_jvmti_env);
- BindFunctions(jvmti_env, env, kMainClass);
+ BindFunctions(bind_jvmti_env, env, kMainClass);
if (callback != nullptr) {
- callback(jvmti_env, env);
+ callback(bind_jvmti_env, env);
}
- if (jvmti_env->DisposeEnvironment() != JVMTI_ERROR_NONE) {
+ if (bind_jvmti_env->DisposeEnvironment() != JVMTI_ERROR_NONE) {
LOG(FATAL) << "Could not dispose temporary jvmtiEnv";
}
}
+// Utility functions for art.Main shim.
+extern "C" JNIEXPORT void JNICALL Java_art_Main_bindAgentJNI(
+ JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jstring className, jobject classLoader) {
+ ScopedUtfChars name(env, className);
+ BindFunctions(jvmti_env, env, name.c_str(), classLoader);
+}
+
+extern "C" JNIEXPORT void JNICALL Java_art_Main_bindAgentJNIForClass(
+ JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jclass bindClass) {
+ BindFunctionsOnClass(jvmti_env, env, bindClass);
+}
+
} // namespace art