Remove GLTrace support
GLTrace is defunct, it does not support newer GL features, breaks
security requirements, and has no supported tooling now that Eclipse
is at end of life.
Bug 22329852
Change-Id: I64c58464f8c2c7ae6125f5d5c7884e3fd34d68ea
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 4a13136..081518f 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -120,7 +120,7 @@
out.println(
"usage: am [subcommand] [options]\n" +
"usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]\n" +
- " [--sampling INTERVAL] [-R COUNT] [-S] [--opengl-trace]\n" +
+ " [--sampling INTERVAL] [-R COUNT] [-S]\n" +
" [--track-allocation] [--user <USER_ID> | current] <INTENT>\n" +
" am startservice [--user <USER_ID> | current] <INTENT>\n" +
" am stopservice [--user <USER_ID> | current] <INTENT>\n" +
@@ -182,7 +182,6 @@
" -R: repeat the activity launch <COUNT> times. Prior to each repeat,\n" +
" the top activity will be finished.\n" +
" -S: force stop the target app before starting the activity\n" +
- " --opengl-trace: enable tracing of OpenGL functions\n" +
" --track-allocation: enable tracking of object allocations\n" +
" --user <USER_ID> | current: Specify which user to run as; if not\n" +
" specified then run as the current user.\n" +
@@ -739,8 +738,6 @@
mRepeat = Integer.parseInt(nextArgRequired());
} else if (opt.equals("-S")) {
mStopOption = true;
- } else if (opt.equals("--opengl-trace")) {
- mStartFlags |= ActivityManager.START_FLAG_OPENGL_TRACES;
} else if (opt.equals("--track-allocation")) {
mStartFlags |= ActivityManager.START_FLAG_TRACK_ALLOCATION;
} else if (opt.equals("--user")) {
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 61a9a84..3bfeff0 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -204,17 +204,10 @@
/**
* Flag for IActivityManaqer.startActivity: launch the app for
- * OpenGL tracing.
- * @hide
- */
- public static final int START_FLAG_OPENGL_TRACES = 1<<2;
-
- /**
- * Flag for IActivityManaqer.startActivity: launch the app for
* allocation tracking.
* @hide
*/
- public static final int START_FLAG_TRACK_ALLOCATION = 1<<3;
+ public static final int START_FLAG_TRACK_ALLOCATION = 1<<2;
/**
* Result for IActivityManaqer.broadcastIntent: success!
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 9f24de8..765783b 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -448,7 +448,6 @@
IUiAutomationConnection instrumentationUiAutomationConnection;
int debugMode;
boolean enableBinderTracking;
- boolean enableOpenGlTrace;
boolean trackAllocation;
boolean restrictedBackupMode;
boolean persistent;
@@ -774,10 +773,9 @@
ProfilerInfo profilerInfo, Bundle instrumentationArgs,
IInstrumentationWatcher instrumentationWatcher,
IUiAutomationConnection instrumentationUiConnection, int debugMode,
- boolean enableBinderTracking, boolean enableOpenGlTrace,
- boolean trackAllocation, boolean isRestrictedBackupMode,
- boolean persistent, Configuration config, CompatibilityInfo compatInfo,
- Map<String, IBinder> services, Bundle coreSettings) {
+ boolean enableBinderTracking, boolean trackAllocation,
+ boolean isRestrictedBackupMode, boolean persistent, Configuration config,
+ CompatibilityInfo compatInfo, Map<String, IBinder> services, Bundle coreSettings) {
if (services != null) {
// Setup the service cache in the ServiceManager
@@ -833,7 +831,6 @@
data.instrumentationUiAutomationConnection = instrumentationUiConnection;
data.debugMode = debugMode;
data.enableBinderTracking = enableBinderTracking;
- data.enableOpenGlTrace = enableOpenGlTrace;
data.trackAllocation = trackAllocation;
data.restrictedBackupMode = isRestrictedBackupMode;
data.persistent = persistent;
@@ -4677,11 +4674,6 @@
}
}
- // Enable OpenGL tracing if required
- if (data.enableOpenGlTrace) {
- GLUtils.setTracingLevel(1);
- }
-
// Allow application-generated systrace messages if we're debuggable.
boolean isAppDebuggable = (data.appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
Trace.setAppTracingAllowed(isAppDebuggable);
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index bead625..bfd9ca5 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -294,7 +294,6 @@
IUiAutomationConnection.Stub.asInterface(binder);
int testMode = data.readInt();
boolean enableBinderTracking = data.readInt() != 0;
- boolean openGlTrace = data.readInt() != 0;
boolean trackAllocation = data.readInt() != 0;
boolean restrictedBackupMode = (data.readInt() != 0);
boolean persistent = (data.readInt() != 0);
@@ -304,8 +303,8 @@
Bundle coreSettings = data.readBundle();
bindApplication(packageName, info, providers, testName, profilerInfo, testArgs,
testWatcher, uiAutomationConnection, testMode, enableBinderTracking,
- openGlTrace, trackAllocation, restrictedBackupMode, persistent, config,
- compatInfo, services, coreSettings);
+ trackAllocation, restrictedBackupMode, persistent, config, compatInfo, services,
+ coreSettings);
return true;
}
@@ -1020,10 +1019,9 @@
List<ProviderInfo> providers, ComponentName testName, ProfilerInfo profilerInfo,
Bundle testArgs, IInstrumentationWatcher testWatcher,
IUiAutomationConnection uiAutomationConnection, int debugMode,
- boolean enableBinderTracking, boolean openGlTrace, boolean trackAllocation,
- boolean restrictedBackupMode, boolean persistent, Configuration config,
- CompatibilityInfo compatInfo, Map<String, IBinder> services,
- Bundle coreSettings) throws RemoteException {
+ boolean enableBinderTracking, boolean trackAllocation, boolean restrictedBackupMode,
+ boolean persistent, Configuration config, CompatibilityInfo compatInfo,
+ Map<String, IBinder> services, Bundle coreSettings) throws RemoteException {
Parcel data = Parcel.obtain();
data.writeInterfaceToken(IApplicationThread.descriptor);
data.writeString(packageName);
@@ -1046,7 +1044,6 @@
data.writeStrongInterface(uiAutomationConnection);
data.writeInt(debugMode);
data.writeInt(enableBinderTracking ? 1 : 0);
- data.writeInt(openGlTrace ? 1 : 0);
data.writeInt(trackAllocation ? 1 : 0);
data.writeInt(restrictedBackupMode ? 1 : 0);
data.writeInt(persistent ? 1 : 0);
diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java
index 2d78e19..99e8853 100644
--- a/core/java/android/app/IApplicationThread.java
+++ b/core/java/android/app/IApplicationThread.java
@@ -96,10 +96,10 @@
void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
ComponentName testName, ProfilerInfo profilerInfo, Bundle testArguments,
IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection,
- int debugMode, boolean enableBinderTracking, boolean openGlTrace,
- boolean trackAllocation, boolean restrictedBackupMode, boolean persistent,
- Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
- Bundle coreSettings) throws RemoteException;
+ int debugMode, boolean enableBinderTracking, boolean trackAllocation,
+ boolean restrictedBackupMode, boolean persistent, Configuration config,
+ CompatibilityInfo compatInfo, Map<String, IBinder> services, Bundle coreSettings)
+ throws RemoteException;
void scheduleExit() throws RemoteException;
void scheduleSuicide() throws RemoteException;
void scheduleConfigurationChanged(Configuration config) throws RemoteException;
diff --git a/core/java/android/ddm/DdmHandleViewDebug.java b/core/java/android/ddm/DdmHandleViewDebug.java
index be48633..5539dc9 100644
--- a/core/java/android/ddm/DdmHandleViewDebug.java
+++ b/core/java/android/ddm/DdmHandleViewDebug.java
@@ -16,7 +16,6 @@
package android.ddm;
-import android.opengl.GLUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewDebug;
@@ -41,9 +40,6 @@
* Support for these features are advertised via {@link DdmHandleHello}.
*/
public class DdmHandleViewDebug extends ChunkHandler {
- /** Enable/Disable tracing of OpenGL calls. */
- public static final int CHUNK_VUGL = type("VUGL");
-
/** List {@link ViewRootImpl}'s of this process. */
private static final int CHUNK_VULW = type("VULW");
@@ -97,7 +93,6 @@
private DdmHandleViewDebug() {}
public static void register() {
- DdmServer.registerHandler(CHUNK_VUGL, sInstance);
DdmServer.registerHandler(CHUNK_VULW, sInstance);
DdmServer.registerHandler(CHUNK_VURT, sInstance);
DdmServer.registerHandler(CHUNK_VUOP, sInstance);
@@ -115,9 +110,7 @@
public Chunk handleChunk(Chunk request) {
int type = request.type;
- if (type == CHUNK_VUGL) {
- return handleOpenGlTrace(request);
- } else if (type == CHUNK_VULW) {
+ if (type == CHUNK_VULW) {
return listWindows();
}
@@ -165,12 +158,6 @@
}
}
- private Chunk handleOpenGlTrace(Chunk request) {
- ByteBuffer in = wrapChunk(request);
- GLUtils.setTracingLevel(in.getInt());
- return null; // empty response
- }
-
/** Returns the list of windows owned by this client. */
private Chunk listWindows() {
String[] windowNames = WindowManagerGlobal.getInstance().getViewRootNames();
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index e045f5f..d4735ec 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -643,12 +643,6 @@
// ---------------------------------------------------------------------------
-extern void setGLDebugLevel(int level);
-void setTracingLevel(JNIEnv *env, jclass clazz, jint level)
-{
- setGLDebugLevel(level);
-}
-
static int checkFormat(SkColorType colorType, int format, int type)
{
switch(colorType) {
@@ -1103,7 +1097,6 @@
{ "native_getType", "(Landroid/graphics/Bitmap;)I", (void*) util_getType },
{ "native_texImage2D", "(IIILandroid/graphics/Bitmap;II)I", (void*)util_texImage2D },
{ "native_texSubImage2D", "(IIIILandroid/graphics/Bitmap;II)I", (void*)util_texSubImage2D },
- { "setTracingLevel", "(I)V", (void*)setTracingLevel },
};
static const JNINativeMethod gEtc1Methods[] = {
diff --git a/opengl/java/android/opengl/GLUtils.java b/opengl/java/android/opengl/GLUtils.java
index 4d890c9..d097335 100644
--- a/opengl/java/android/opengl/GLUtils.java
+++ b/opengl/java/android/opengl/GLUtils.java
@@ -261,12 +261,6 @@
}
}
- /**
- * Set OpenGL Tracing level for this application.
- * @hide
- */
- native public static void setTracingLevel(int level);
-
native private static int native_getInternalFormat(Bitmap bitmap);
native private static int native_getType(Bitmap bitmap);
native private static int native_texImage2D(int target, int level, int internalformat,
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 617264c..acbb855 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -1225,7 +1225,6 @@
int mSamplingInterval = 0;
boolean mAutoStopProfiler = false;
int mProfileType = 0;
- String mOpenGlTraceApp = null;
final ProcessMap<Pair<Long, String>> mMemWatchProcesses = new ProcessMap<>();
String mMemWatchDumpProcName;
String mMemWatchDumpFile;
@@ -6141,11 +6140,6 @@
samplingInterval = mSamplingInterval;
profileAutoStop = mAutoStopProfiler;
}
- boolean enableOpenGlTrace = false;
- if (mOpenGlTraceApp != null && mOpenGlTraceApp.equals(processName)) {
- enableOpenGlTrace = true;
- mOpenGlTraceApp = null;
- }
boolean enableTrackAllocation = false;
if (mTrackAllocationApp != null && mTrackAllocationApp.equals(processName)) {
enableTrackAllocation = true;
@@ -6179,9 +6173,9 @@
thread.bindApplication(processName, appInfo, providers, app.instrumentationClass,
profilerInfo, app.instrumentationArguments, app.instrumentationWatcher,
app.instrumentationUiAutomationConnection, testMode,
- mBinderTransactionTrackingEnabled, enableOpenGlTrace,
- enableTrackAllocation, isRestrictedBackupMode || !normalMode,
- app.persistent, new Configuration(mConfiguration), app.compat,
+ mBinderTransactionTrackingEnabled, enableTrackAllocation,
+ isRestrictedBackupMode || !normalMode, app.persistent,
+ new Configuration(mConfiguration), app.compat,
getCommonServicesLocked(app.isolated),
mCoreSettingsObserver.getCoreSettingsLocked());
updateLruProcessLocked(app, false, null);
@@ -10779,19 +10773,6 @@
}
}
- void setOpenGlTraceApp(ApplicationInfo app, String processName) {
- synchronized (this) {
- boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
- if (!isDebuggable) {
- if ((app.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
- throw new SecurityException("Process not debuggable: " + app.packageName);
- }
- }
-
- mOpenGlTraceApp = processName;
- }
- }
-
void setTrackAllocationApp(ApplicationInfo app, String processName) {
synchronized (this) {
boolean isDebuggable = "1".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
@@ -13906,15 +13887,6 @@
pw.print(" mMemWatchDumpPid="); pw.print(mMemWatchDumpPid);
pw.print(" mMemWatchDumpUid="); pw.println(mMemWatchDumpUid);
}
- if (mOpenGlTraceApp != null) {
- if (dumpPackage == null || dumpPackage.equals(mOpenGlTraceApp)) {
- if (needSep) {
- pw.println();
- needSep = false;
- }
- pw.println(" mOpenGlTraceApp=" + mOpenGlTraceApp);
- }
- }
if (mTrackAllocationApp != null) {
if (dumpPackage == null || dumpPackage.equals(mTrackAllocationApp)) {
if (needSep) {
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index ac7b9b1..16b5ced0 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -911,10 +911,6 @@
mService.setDebugApp(aInfo.processName, true, false);
}
- if ((startFlags & ActivityManager.START_FLAG_OPENGL_TRACES) != 0) {
- mService.setOpenGlTraceApp(aInfo.applicationInfo, aInfo.processName);
- }
-
if ((startFlags & ActivityManager.START_FLAG_TRACK_ALLOCATION) != 0) {
mService.setTrackAllocationApp(aInfo.applicationInfo, aInfo.processName);
}