summaryrefslogtreecommitdiffstats
path: root/tools/eclipse
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2009-09-02 20:06:08 -0700
committerXavier Ducrohet <xav@android.com>2009-09-03 16:01:27 -0700
commit3ce85131be916ea334012276d136a28cf111d123 (patch)
tree6d8660e34ab0b75f6d7e8db2ea20a13a76126d8f /tools/eclipse
parent2b6f5d17a3c3eff47cb804b1a6210cfd8a640a3d (diff)
downloadandroid_development-3ce85131be916ea334012276d136a28cf111d123.tar.gz
android_development-3ce85131be916ea334012276d136a28cf111d123.tar.bz2
android_development-3ce85131be916ea334012276d136a28cf111d123.zip
Add method profiling support to DDMS.
New button allows to start/stop tracing. When clicking stop, DDMS downloads the trace file and starts Traceview. Also refactored some common parts of the HPROF and tracing handlers into a common class. The goal is to have a default, extensible implementation of the HPROF handler that DDMS and the plug-in can reuse. This will reduce duplicated code. Change-Id: Ifc48926c7f6f1c3ea49a4aa94053664be83cbb06
Diffstat (limited to 'tools/eclipse')
-rw-r--r--tools/eclipse/plugins/.gitignore2
-rw-r--r--tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java9
-rw-r--r--tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java41
-rw-r--r--tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java205
-rwxr-xr-xtools/eclipse/scripts/create_ddms_symlinks.sh2
5 files changed, 135 insertions, 124 deletions
diff --git a/tools/eclipse/plugins/.gitignore b/tools/eclipse/plugins/.gitignore
index cc105d221..6c13a2bd0 100644
--- a/tools/eclipse/plugins/.gitignore
+++ b/tools/eclipse/plugins/.gitignore
@@ -40,6 +40,8 @@ com.android.ide.eclipse.ddms/icons/pull.png
com.android.ide.eclipse.ddms/icons/push.png
com.android.ide.eclipse.ddms/icons/save.png
com.android.ide.eclipse.ddms/icons/thread.png
+com.android.ide.eclipse.ddms/icons/tracing_start.png
+com.android.ide.eclipse.ddms/icons/tracing_stop.png
com.android.ide.eclipse.ddms/icons/up.png
com.android.ide.eclipse.ddms/icons/v.png
com.android.ide.eclipse.ddms/icons/w.png
diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java
index b834bcf92..eab0c6c9b 100644
--- a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java
@@ -24,6 +24,7 @@ import com.android.ddmlib.Log;
import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener;
import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
+import com.android.ddmlib.ClientData.DebuggerStatus;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.internal.launch.AndroidLaunchConfiguration.TargetMode;
import com.android.ide.eclipse.adt.internal.launch.DelayedLaunchInfo.InstallRetryMode;
@@ -1382,7 +1383,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener
* @param client the updated client.
* @param changeMask the bit mask describing the changed properties. It can contain
* any of the following values: {@link Client#CHANGE_INFO}, {@link Client#CHANGE_NAME}
- * {@link Client#CHANGE_DEBUGGER_INTEREST}, {@link Client#CHANGE_THREAD_MODE},
+ * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
* {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
* {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
*
@@ -1445,7 +1446,7 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener
}
// check if it's already waiting for a debugger, and if so we connect to it.
- if (client.getClientData().getDebuggerConnectionStatus() == ClientData.DEBUGGER_WAITING) {
+ if (client.getClientData().getDebuggerConnectionStatus() == DebuggerStatus.WAITING) {
// search for this client in the list;
synchronized (sListLock) {
int index = mUnknownClientsWaitingForDebugger.indexOf(client);
@@ -1461,10 +1462,10 @@ public final class AndroidLaunchController implements IDebugBridgeChangeListener
// if it's not home, it could be an app that is now in debugger mode that we're waiting for
// lets check it
- if ((changeMask & Client.CHANGE_DEBUGGER_INTEREST) == Client.CHANGE_DEBUGGER_INTEREST) {
+ if ((changeMask & Client.CHANGE_DEBUGGER_STATUS) == Client.CHANGE_DEBUGGER_STATUS) {
ClientData clientData = client.getClientData();
String applicationName = client.getClientData().getClientDescription();
- if (clientData.getDebuggerConnectionStatus() == ClientData.DEBUGGER_WAITING) {
+ if (clientData.getDebuggerConnectionStatus() == DebuggerStatus.WAITING) {
// Get the application name, and make sure its valid.
if (applicationName == null) {
// looks like we don't have the client yet, so we keep it around for when its
diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java b/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
index 631b391a3..76b005e9d 100644
--- a/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
@@ -18,6 +18,7 @@ package com.android.ide.eclipse.ddms;
import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.Client;
+import com.android.ddmlib.DdmConstants;
import com.android.ddmlib.DdmPreferences;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.Log;
@@ -56,20 +57,6 @@ import java.util.Calendar;
public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeListener,
IUiSelectionListener {
- public final static int PLATFORM_UNKNOWN = 0;
- public final static int PLATFORM_LINUX = 1;
- public final static int PLATFORM_WINDOWS = 2;
- public final static int PLATFORM_DARWIN = 3;
-
- /**
- * Returns current platform, one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN},
- * {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.
- */
- public final static int CURRENT_PLATFORM = currentPlatform();
-
- /** hprof-conv executable (with extension for the current OS) */
- public final static String FN_HPROF_CONVERTER = (CURRENT_PLATFORM == PLATFORM_WINDOWS) ?
- "hprof-conv.exe" : "hprof-conv"; //$NON-NLS-1$ //$NON-NLS-2$
// The plug-in ID
public static final String PLUGIN_ID = "com.android.ide.eclipse.ddms"; // $NON-NLS-1$
@@ -312,8 +299,11 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL
File toolsFolder = adb.getParentFile();
sToolsFolder = toolsFolder.getAbsolutePath();
- File hprofConverter = new File(toolsFolder, FN_HPROF_CONVERTER);
+ File hprofConverter = new File(toolsFolder, DdmConstants.FN_HPROF_CONVERTER);
sHprofConverter = hprofConverter.getAbsolutePath();
+
+ File traceview = new File(toolsFolder, DdmConstants.FN_TRACEVIEW);
+ DdmUiPreferences.setTraceviewLocation(traceview.getAbsolutePath());
}
/**
@@ -598,25 +588,4 @@ public final class DdmsPlugin extends AbstractUIPlugin implements IDeviceChangeL
return String.format("[%1$tF %1$tT - %2$s]", c, tag);
}
-
-
- /**
- * Returns current platform
- *
- * @return one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN},
- * {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.
- */
- public static int currentPlatform() {
- String os = System.getProperty("os.name"); //$NON-NLS-1$
- if (os.startsWith("Mac OS")) { //$NON-NLS-1$
- return PLATFORM_DARWIN;
- } else if (os.startsWith("Windows")) { //$NON-NLS-1$
- return PLATFORM_WINDOWS;
- } else if (os.startsWith("Linux")) { //$NON-NLS-1$
- return PLATFORM_LINUX;
- }
-
- return PLATFORM_UNKNOWN;
- }
-
}
diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java b/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java
index 50eee2633..71efb50d6 100644
--- a/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java
+++ b/tools/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java
@@ -22,11 +22,14 @@ import com.android.ddmlib.Client;
import com.android.ddmlib.ClientData;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.SyncService;
+import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
import com.android.ddmlib.ClientData.IHprofDumpHandler;
+import com.android.ddmlib.ClientData.MethodProfilingStatus;
import com.android.ddmlib.SyncService.SyncResult;
+import com.android.ddmuilib.handler.BaseFileHandler;
+import com.android.ddmuilib.handler.MethodProfilingHandler;
import com.android.ddmuilib.DevicePanel;
import com.android.ddmuilib.ScreenShotDialog;
-import com.android.ddmuilib.SyncProgressMonitor;
import com.android.ddmuilib.DevicePanel.IUiSelectionListener;
import com.android.ide.eclipse.ddms.DdmsPlugin;
import com.android.ide.eclipse.ddms.DdmsPlugin.IDebugLauncher;
@@ -34,7 +37,6 @@ import com.android.ide.eclipse.ddms.preferences.PreferenceInitializer;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -42,13 +44,10 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
@@ -59,9 +58,8 @@ import org.eclipse.ui.part.ViewPart;
import java.io.File;
import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-public class DeviceView extends ViewPart implements IUiSelectionListener {
+public class DeviceView extends ViewPart implements IUiSelectionListener, IClientChangeListener {
private final static boolean USE_SELECTED_DEBUG_PORT = true;
@@ -70,7 +68,9 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
private static DeviceView sThis;
+ private Shell mParentShell;
private DevicePanel mDeviceList;
+
private Action mResetAdbAction;
private Action mCaptureAction;
private Action mUpdateThreadAction;
@@ -79,29 +79,29 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
private Action mKillAppAction;
private Action mDebugAction;
private Action mHprofAction;
+ private Action mTracingAction;
private IDebugLauncher mDebugLauncher;
- public class HProfHandler implements IHprofDumpHandler {
+ private ImageDescriptor mTracingStartImage;
+ private ImageDescriptor mTracingStopImage;
+
+ public class HProfHandler extends BaseFileHandler implements IHprofDumpHandler {
public final static String ACTION_SAVE ="hprof.save"; //$NON-NLS-1$
public final static String ACTION_OPEN = "hprof.open"; //$NON-NLS-1$
public final static String DOT_HPROF = ".hprof"; //$NON-NLS-1$
- private final Shell mParentShell;
-
HProfHandler(Shell parentShell) {
- mParentShell = parentShell;
+ super(parentShell);
}
public void onFailure(final Client client) {
mParentShell.getDisplay().asyncExec(new Runnable() {
public void run() {
try {
- MessageDialog.openError(mParentShell, "HPROF Error",
- String.format(
- "Unable to create HPROF file for application '%1$s'.\n" +
- "Check logcat for more information.",
- client.getClientData().getClientDescription()));
+ displayError("Unable to create HPROF file for application '%1$s'.\n" +
+ "Check logcat for more information.",
+ client.getClientData().getClientDescription());
} finally {
// this will make sure the dump hprof button is re-enabled for the
// current selection. as the client is finished dumping an hprof file
@@ -111,7 +111,7 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
});
}
- public void onSuccess(final String remoteFile, final Client client) {
+ public void onSuccess(final String remoteFilePath, final Client client) {
mParentShell.getDisplay().asyncExec(new Runnable() {
public void run() {
final IDevice device = client.getDevice();
@@ -122,26 +122,35 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
// get from the preference what action to take
IPreferenceStore store = DdmsPlugin.getDefault().getPreferenceStore();
String value = store.getString(PreferenceInitializer.ATTR_HPROF_ACTION);
+
+ SyncResult result = null;
if (ACTION_OPEN.equals(value)) {
File temp = File.createTempFile("android", DOT_HPROF); //$NON-NLS-1$
String tempPath = temp.getAbsolutePath();
- pull(sync, tempPath, remoteFile);
-
- open(tempPath);
+ result = pull(sync, tempPath, remoteFilePath);
+ if (result != null && result.getCode() == SyncService.RESULT_OK) {
+ open(tempPath);
+ }
} else {
// default action is ACTION_SAVE
- promptAndPull(device, client, sync, remoteFile);
+ result = promptAndPull(sync,
+ client.getClientData().getClientDescription() + DOT_HPROF,
+ remoteFilePath, "Save HPROF file");
+
+ }
+
+ if (result != null && result.getCode() != SyncService.RESULT_OK) {
+ displayError(
+ "Unable to download HPROF file from device '%1$s'.\n\n%2$s",
+ device.getSerialNumber(), result.getMessage());
}
} else {
- MessageDialog.openError(mParentShell, "HPROF Error",
- String.format(
- "Unable to download HPROF file from device '%1$s'.",
- device.getSerialNumber()));
+ displayError("Unable to download HPROF file from device '%1$s'.",
+ device.getSerialNumber());
}
} catch (Exception e) {
- MessageDialog.openError(mParentShell, "HPROF Error",
- String.format("Unable to download HPROF file from device '%1$s'.",
- device.getSerialNumber()));
+ displayError("Unable to download HPROF file from device '%1$s'.",
+ device.getSerialNumber());
} finally {
// this will make sure the dump hprof button is re-enabled for the
@@ -152,48 +161,6 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
});
}
- private void promptAndPull(final IDevice device, final Client client,
- final SyncService sync, final String remoteFile) {
- try {
- FileDialog fileDialog = new FileDialog(mParentShell, SWT.SAVE);
-
- fileDialog.setText("Save HPROF file");
- fileDialog.setFileName(
- client.getClientData().getClientDescription() + DOT_HPROF);
-
- final String localFileName = fileDialog.open();
- if (localFileName != null) {
- pull(sync, localFileName, remoteFile);
- }
- } catch (Exception e) {
- MessageDialog.openError(mParentShell, "HPROF Error",
- String.format("Unable to download HPROF file from device '%1$s'.",
- device.getSerialNumber()));
- }
- }
-
- private void pull(final SyncService sync,
- final String localFileName, final String remoteFile)
- throws InvocationTargetException, InterruptedException {
- new ProgressMonitorDialog(mParentShell).run(true, true,
- new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- SyncResult result = sync.pullFile(remoteFile, localFileName,
- new SyncProgressMonitor(monitor, String.format(
- "Pulling %1$s from the device",
- remoteFile)));
-
- if (result.getCode() != SyncService.RESULT_OK) {
- MessageDialog.openError(mParentShell, "HPROF Error",
- String.format("Failed to pull %1$s: %2$s", remoteFile,
- result.getMessage()));
- }
-
- sync.close();
- }
- });
- }
-
private void open(String path) throws IOException, InterruptedException, PartInitException {
// make a temp file to convert the hprof into something
// readable by normal tools
@@ -215,6 +182,11 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
fileStore);
}
}
+
+ private void displayError(String format, Object... args) {
+ MessageDialog.openError(mParentShell, "HPROF Error",
+ String.format(format, args));
+ }
}
@@ -244,7 +216,10 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
@Override
public void createPartControl(Composite parent) {
- ClientData.setHprofDumpHandler(new HProfHandler(parent.getShell()));
+ mParentShell = parent.getShell();
+ ClientData.setHprofDumpHandler(new HProfHandler(mParentShell));
+ AndroidDebugBridge.addClientChangeListener(this);
+ ClientData.setMethodProfilingHandler(new MethodProfilingHandler(mParentShell));
mDeviceList = new DevicePanel(DdmsPlugin.getImageLoader(), USE_SELECTED_DEBUG_PORT);
mDeviceList.createPanel(parent);
@@ -350,6 +325,20 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
mUpdateThreadAction.setImageDescriptor(DdmsPlugin.getImageLoader()
.loadDescriptor(DevicePanel.ICON_THREAD));
+ mTracingAction = new Action() {
+ @Override
+ public void run() {
+ mDeviceList.toggleMethodProfiling();
+ }
+ };
+ mTracingAction.setText("Start Method Profiling");
+ mTracingAction.setToolTipText("Start Method Profiling");
+ mTracingStartImage = DdmsPlugin.getImageLoader().loadDescriptor(
+ DevicePanel.ICON_TRACING_START);
+ mTracingStopImage = DdmsPlugin.getImageLoader().loadDescriptor(
+ DevicePanel.ICON_TRACING_STOP);
+ mTracingAction.setImageDescriptor(mTracingStartImage);
+
// check if there's already a debug launcher set up in the plugin class
mDebugLauncher = DdmsPlugin.getRunningAppDebugLauncher();
@@ -363,14 +352,14 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
// make sure the client can be debugged
switch (clientData.getDebuggerConnectionStatus()) {
- case ClientData.DEBUGGER_ERROR: {
+ case ERROR: {
Display display = DdmsPlugin.getDisplay();
Shell shell = display.getActiveShell();
MessageDialog.openError(shell, "Process Debug",
"The process debug port is already in use!");
return;
}
- case ClientData.DEBUGGER_ATTACHED: {
+ case ATTACHED: {
Display display = DdmsPlugin.getDisplay();
Shell shell = display.getActiveShell();
MessageDialog.openError(shell, "Process Debug",
@@ -442,9 +431,34 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
mUpdateThreadAction.setEnabled(true);
mUpdateThreadAction.setChecked(selectedClient.isThreadUpdateEnabled());
- mHprofAction.setEnabled(
- selectedClient.getClientData().hasFeature(ClientData.FEATURE_HPROF) &&
- selectedClient.getClientData().hasPendingHprofDump() == false);
+
+ ClientData data = selectedClient.getClientData();
+
+ if (data.hasFeature(ClientData.FEATURE_HPROF)) {
+ mHprofAction.setEnabled(data.hasPendingHprofDump() == false);
+ mHprofAction.setToolTipText("Dump HPROF file");
+ } else {
+ mHprofAction.setEnabled(false);
+ mHprofAction.setToolTipText("Dump HPROF file (not supported by this VM)");
+ }
+
+ if (data.hasFeature(ClientData.FEATURE_PROFILING)) {
+ mTracingAction.setEnabled(true);
+ if (data.getMethodProfilingStatus() == MethodProfilingStatus.ON) {
+ mTracingAction.setToolTipText("Stop Method Profiling");
+ mTracingAction.setText("Stop Method Profiling");
+ mTracingAction.setImageDescriptor(mTracingStopImage);
+ } else {
+ mTracingAction.setToolTipText("Start Method Profiling");
+ mTracingAction.setImageDescriptor(mTracingStartImage);
+ mTracingAction.setText("Start Method Profiling");
+ }
+ } else {
+ mTracingAction.setEnabled(false);
+ mTracingAction.setImageDescriptor(mTracingStartImage);
+ mTracingAction.setToolTipText("Start Method Profiling (not supported by this VM)");
+ mTracingAction.setText("Start Method Profiling");
+ }
} else {
if (USE_SELECTED_DEBUG_PORT) {
// set the client as the debug client
@@ -462,6 +476,14 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
mUpdateThreadAction.setEnabled(false);
mUpdateThreadAction.setChecked(false);
mHprofAction.setEnabled(false);
+
+ mHprofAction.setEnabled(false);
+ mHprofAction.setToolTipText("Dump HPROF file");
+
+ mTracingAction.setEnabled(false);
+ mTracingAction.setImageDescriptor(mTracingStartImage);
+ mTracingAction.setToolTipText("Start Method Profiling");
+ mTracingAction.setText("Start Method Profiling");
}
}
@@ -477,13 +499,15 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
// first in the menu
IMenuManager menuManager = actionBars.getMenuManager();
+ menuManager.removeAll();
menuManager.add(mDebugAction);
menuManager.add(new Separator());
- menuManager.add(mUpdateThreadAction);
menuManager.add(mUpdateHeapAction);
- menuManager.add(new Separator());
- menuManager.add(mGcAction);
menuManager.add(mHprofAction);
+ menuManager.add(mGcAction);
+ menuManager.add(new Separator());
+ menuManager.add(mUpdateThreadAction);
+ menuManager.add(mTracingAction);
menuManager.add(new Separator());
menuManager.add(mKillAppAction);
menuManager.add(new Separator());
@@ -493,17 +517,32 @@ public class DeviceView extends ViewPart implements IUiSelectionListener {
// and then in the toolbar
IToolBarManager toolBarManager = actionBars.getToolBarManager();
+ toolBarManager.removeAll();
toolBarManager.add(mDebugAction);
toolBarManager.add(new Separator());
- toolBarManager.add(mUpdateThreadAction);
toolBarManager.add(mUpdateHeapAction);
- toolBarManager.add(new Separator());
- toolBarManager.add(mGcAction);
toolBarManager.add(mHprofAction);
+ toolBarManager.add(mGcAction);
+ toolBarManager.add(new Separator());
+ toolBarManager.add(mUpdateThreadAction);
+ toolBarManager.add(mTracingAction);
toolBarManager.add(new Separator());
toolBarManager.add(mKillAppAction);
toolBarManager.add(new Separator());
toolBarManager.add(mCaptureAction);
}
+ public void clientChanged(final Client client, int changeMask) {
+ if ((changeMask & Client.CHANGE_METHOD_PROFILING_STATUS) ==
+ Client.CHANGE_METHOD_PROFILING_STATUS) {
+ if (mDeviceList.getSelectedClient() == client) {
+ mParentShell.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ // force refresh of the button enabled state.
+ doSelectionChanged(client);
+ }
+ });
+ }
+ }
+ }
}
diff --git a/tools/eclipse/scripts/create_ddms_symlinks.sh b/tools/eclipse/scripts/create_ddms_symlinks.sh
index a5b20a879..87cdf68f2 100755
--- a/tools/eclipse/scripts/create_ddms_symlinks.sh
+++ b/tools/eclipse/scripts/create_ddms_symlinks.sh
@@ -70,7 +70,7 @@ for i in \
load.png \
pause.png play.png pull.png push.png \
save.png \
- thread.png \
+ thread.png tracing_start.png tracing_stop.png \
up.png \
v.png \
w.png warning.png ; do