Loading core/java/android/os/Trace.java +10 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.os; import dalvik.annotation.optimization.FastNative; /** * Writes trace events to the system trace buffer. These trace events can be * collected and visualized using the Systrace tool. Loading Loading @@ -91,13 +93,19 @@ public final class Trace { private static volatile long sEnabledTags = TRACE_TAG_NOT_READY; private static native long nativeGetEnabledTags(); private static native void nativeSetAppTracingAllowed(boolean allowed); private static native void nativeSetTracingEnabled(boolean allowed); @FastNative private static native void nativeTraceCounter(long tag, String name, int value); @FastNative private static native void nativeTraceBegin(long tag, String name); @FastNative private static native void nativeTraceEnd(long tag); @FastNative private static native void nativeAsyncTraceBegin(long tag, String name, int cookie); @FastNative private static native void nativeAsyncTraceEnd(long tag, String name, int cookie); private static native void nativeSetAppTracingAllowed(boolean allowed); private static native void nativeSetTracingEnabled(boolean allowed); static { // We configure two separate change callbacks, one in Trace.cpp and one here. The Loading core/jni/android_os_Trace.cpp +14 −11 Original line number Diff line number Diff line Loading @@ -110,27 +110,30 @@ static const JNINativeMethod gTraceMethods[] = { { "nativeGetEnabledTags", "()J", (void*)android_os_Trace_nativeGetEnabledTags }, { "nativeSetAppTracingAllowed", "(Z)V", (void*)android_os_Trace_nativeSetAppTracingAllowed }, { "nativeSetTracingEnabled", "(Z)V", (void*)android_os_Trace_nativeSetTracingEnabled }, // ----------- @FastNative ---------------- { "nativeTraceCounter", "!(JLjava/lang/String;I)V", "(JLjava/lang/String;I)V", (void*)android_os_Trace_nativeTraceCounter }, { "nativeTraceBegin", "!(JLjava/lang/String;)V", "(JLjava/lang/String;)V", (void*)android_os_Trace_nativeTraceBegin }, { "nativeTraceEnd", "!(J)V", "(J)V", (void*)android_os_Trace_nativeTraceEnd }, { "nativeAsyncTraceBegin", "!(JLjava/lang/String;I)V", "(JLjava/lang/String;I)V", (void*)android_os_Trace_nativeAsyncTraceBegin }, { "nativeAsyncTraceEnd", "!(JLjava/lang/String;I)V", "(JLjava/lang/String;I)V", (void*)android_os_Trace_nativeAsyncTraceEnd }, { "nativeSetAppTracingAllowed", "(Z)V", (void*)android_os_Trace_nativeSetAppTracingAllowed }, { "nativeSetTracingEnabled", "(Z)V", (void*)android_os_Trace_nativeSetTracingEnabled }, }; int register_android_os_Trace(JNIEnv* env) { Loading Loading
core/java/android/os/Trace.java +10 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.os; import dalvik.annotation.optimization.FastNative; /** * Writes trace events to the system trace buffer. These trace events can be * collected and visualized using the Systrace tool. Loading Loading @@ -91,13 +93,19 @@ public final class Trace { private static volatile long sEnabledTags = TRACE_TAG_NOT_READY; private static native long nativeGetEnabledTags(); private static native void nativeSetAppTracingAllowed(boolean allowed); private static native void nativeSetTracingEnabled(boolean allowed); @FastNative private static native void nativeTraceCounter(long tag, String name, int value); @FastNative private static native void nativeTraceBegin(long tag, String name); @FastNative private static native void nativeTraceEnd(long tag); @FastNative private static native void nativeAsyncTraceBegin(long tag, String name, int cookie); @FastNative private static native void nativeAsyncTraceEnd(long tag, String name, int cookie); private static native void nativeSetAppTracingAllowed(boolean allowed); private static native void nativeSetTracingEnabled(boolean allowed); static { // We configure two separate change callbacks, one in Trace.cpp and one here. The Loading
core/jni/android_os_Trace.cpp +14 −11 Original line number Diff line number Diff line Loading @@ -110,27 +110,30 @@ static const JNINativeMethod gTraceMethods[] = { { "nativeGetEnabledTags", "()J", (void*)android_os_Trace_nativeGetEnabledTags }, { "nativeSetAppTracingAllowed", "(Z)V", (void*)android_os_Trace_nativeSetAppTracingAllowed }, { "nativeSetTracingEnabled", "(Z)V", (void*)android_os_Trace_nativeSetTracingEnabled }, // ----------- @FastNative ---------------- { "nativeTraceCounter", "!(JLjava/lang/String;I)V", "(JLjava/lang/String;I)V", (void*)android_os_Trace_nativeTraceCounter }, { "nativeTraceBegin", "!(JLjava/lang/String;)V", "(JLjava/lang/String;)V", (void*)android_os_Trace_nativeTraceBegin }, { "nativeTraceEnd", "!(J)V", "(J)V", (void*)android_os_Trace_nativeTraceEnd }, { "nativeAsyncTraceBegin", "!(JLjava/lang/String;I)V", "(JLjava/lang/String;I)V", (void*)android_os_Trace_nativeAsyncTraceBegin }, { "nativeAsyncTraceEnd", "!(JLjava/lang/String;I)V", "(JLjava/lang/String;I)V", (void*)android_os_Trace_nativeAsyncTraceEnd }, { "nativeSetAppTracingAllowed", "(Z)V", (void*)android_os_Trace_nativeSetAppTracingAllowed }, { "nativeSetTracingEnabled", "(Z)V", (void*)android_os_Trace_nativeSetTracingEnabled }, }; int register_android_os_Trace(JNIEnv* env) { Loading