From 0953f0f2dc627d762e63bbeb2cebe656b3d99a25 Mon Sep 17 00:00:00 2001 From: "Hyunjong,Pakr" Date: Wed, 17 Apr 2013 14:45:10 +0900 Subject: [PATCH] [Title] source copy [Desc.] 172.21.17.55 /tizen_2.1 -> tizendev.org /tizen_2.1 [Issue] - Change-Id: I833b6f4172bda114f3c401b92df564aba4619c31 --- .../core/linux/LinuxOpcontrolProvider.java | 39 +++-- .../org/tizen/oprofile/core/CommandManager.java | 14 +- .../oprofile/core/OprofileCommonConstants.java | 4 +- .../processor/checkevent/CheckEventsProcessor.java | 3 +- .../processor/eventinfo/EventListProcessor.java | 4 +- .../core/processor/eventinfo/OpInfoProcessor.java | 30 ++-- .../core/processor/sessions/SessionsProcessor.java | 2 +- .../plugin.xml | 54 ++++--- .../launch/TizenOprofileLaunchDelegate.java | 48 ++++--- .../NormalOprofileLaunchConfigurationTabGroup.java | 3 +- .../oprofile/launch/DefaultSettingConstants.java | 4 +- .../META-INF/MANIFEST.MF | 10 +- .../launch/ProfileConfigurationMainTab.java | 160 +++++++++++++++++++++ .../profiling/launch/ProfileLaunchShortcut.java | 81 ++++++++++- .../plugin.xml | 54 ++++--- .../linuxtools/valgrind/launch/CommandManager.java | 31 +++- .../launch/TizenValgrindLaunchDelegate.java | 24 +++- .../ValgrindLaunchConfigurationTabGroup.java | 3 +- .../valgrind/launch/ValgrindOptionsTab.java | 2 +- .../linuxtools/valgrind/launch/messages.properties | 1 + 20 files changed, 459 insertions(+), 112 deletions(-) create mode 100644 org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileConfigurationMainTab.java diff --git a/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java b/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java index a59516b..5e93062 100644 --- a/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java +++ b/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java @@ -34,11 +34,11 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { private final String OPCONTROL_PROGRAM; // Initialize the Oprofile kernel module and oprofilefs - private static final String _OPD_INIT_MODULE = "--init"; //$NON-NLS-1$ + private static final String _OPD_INIT_MODULE = "init"; //$NON-NLS-1$ // Setup daemon collection arguments - private static final String _OPD_SETUP = "--setup"; //$NON-NLS-1$ - private static final String _OPD_SETUP_SEPARATE = "--separate="; //$NON-NLS-1$ + private static final String _OPD_SETUP = "setup"; //$NON-NLS-1$ + private static final String _OPD_SETUP_SEPARATE = "separate="; //$NON-NLS-1$ private static final String _OPD_SETUP_SEPARATE_SEPARATOR = ","; //$NON-NLS-1$ // private static final String _OPD_SETUP_SEPARATE_NONE = "none"; //$NON-NLS-1$ private static final String _OPD_SETUP_SEPARATE_LIBRARY = "library"; //$NON-NLS-1$ @@ -46,19 +46,19 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { private static final String _OPD_SETUP_SEPARATE_THREAD = "thread"; //$NON-NLS-1$ private static final String _OPD_SETUP_SEPARATE_CPU = "cpu"; //$NON-NLS-1$ - private static final String _OPD_SETUP_EVENT = "--event="; //$NON-NLS-1$ + private static final String _OPD_SETUP_EVENT = "event="; //$NON-NLS-1$ private static final String _OPD_SETUP_EVENT_SEPARATOR = ":"; //$NON-NLS-1$ private static final String _OPD_SETUP_EVENT_TRUE = "1"; //$NON-NLS-1$ private static final String _OPD_SETUP_EVENT_FALSE = "0"; //$NON-NLS-1$ private static final String _OPD_SETUP_EVENT_DEFAULT = "default"; //$NON-NLS-1$ - private static final String _OPD_SETUP_IMAGE = "--image="; //$NON-NLS-1$ + private static final String _OPD_SETUP_IMAGE = "image="; //$NON-NLS-1$ - private static final String _OPD_CALLGRAPH_DEPTH = "--callgraph="; //$NON-NLS-1$ + private static final String _OPD_CALLGRAPH_DEPTH = "callgraph="; //$NON-NLS-1$ // Kernel image file options - private static final String _OPD_KERNEL_NONE = "--no-vmlinux"; //$NON-NLS-1$ - private static final String _OPD_KERNEL_FILE = "--vmlinux="; //$NON-NLS-1$ + private static final String _OPD_KERNEL_NONE = "vmlinux=no"; //$NON-NLS-1$ + private static final String _OPD_KERNEL_FILE = "vmlinux="; //$NON-NLS-1$ // Logging verbosity // private static final String _OPD_VERBOSE_LOGGING = "--verbose="; @@ -71,28 +71,28 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { // private static final String _OPD_VERBOSE_MISC = "misc"; //$NON-NLS-1$ // Start the daemon process without starting data collection - private static final String _OPD_START_DAEMON = "--start-daemon"; //$NON-NLS-1$ + private static final String _OPD_START_DAEMON = "startdaemon"; //$NON-NLS-1$ // Start collecting profiling data - private static final String _OPD_START_COLLECTION = "--start"; //$NON-NLS-1$ + private static final String _OPD_START_COLLECTION = "start"; //$NON-NLS-1$ // Flush the collected profiling data to disk - private static final String _OPD_DUMP = "--dump"; //$NON-NLS-1$ + private static final String _OPD_DUMP = "dump"; //$NON-NLS-1$ // Stop data collection - private static final String _OPD_STOP_COLLECTION = "--stop"; //$NON-NLS-1$ + private static final String _OPD_STOP_COLLECTION = "stop"; //$NON-NLS-1$ // Stop data collection and stop daemon - private static final String _OPD_SHUTDOWN = "--shutdown"; //$NON-NLS-1$ + private static final String _OPD_SHUTDOWN = "shutdown"; //$NON-NLS-1$ // Clear out data from current session - private static final String _OPD_RESET = "--reset"; //$NON-NLS-1$ + private static final String _OPD_RESET = "reset"; //$NON-NLS-1$ // Save data from the current session - private static final String _OPD_SAVE_SESSION = "--save="; //$NON-NLS-1$ + private static final String _OPD_SAVE_SESSION = "save "; //$NON-NLS-1$ // Unload the oprofile kernel module and oprofilefs - private static final String _OPD_DEINIT_MODULE = "--deinit"; //$NON-NLS-1$ + private static final String _OPD_DEINIT_MODULE = "deinit"; //$NON-NLS-1$ // Logging verbosity. Specified with setupDaemon. // --verbosity=all generates WAY too much stuff in the log @@ -101,7 +101,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { public LinuxOpcontrolProvider() throws OpcontrolException { // jinu modified at 20090526 // OPCONTROL_PROGRAM = _findOpcontrol(); - OPCONTROL_PROGRAM = OprofileCommonConstants.COMMAND_OPCONTROL; + OPCONTROL_PROGRAM = OprofileCommonConstants.OPROFILE_SCRIPT; } /** @@ -367,7 +367,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { // jinu added at 20090528 public void removeDaemonSetting() throws OpcontrolException { final String[] _OPD_REMOVE_SETTING = { "rm", "-rf", - "/root/.oprofile/daemonrc" }; + "/home/developer/sdk_tools/.oprofile/daemonrc" }; runCommand(_OPD_REMOVE_SETTING); } @@ -379,9 +379,6 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider { // try { // result = session.run(str); // session.run(str, null); - if(str.contains(_OPD_START_COLLECTION)){ - str = str + " && echo start_ok"; - } CommandManager.runShell(str); /* } catch (Exception e) { diff --git a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/CommandManager.java b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/CommandManager.java index 2a3bbf9..b00a77f 100644 --- a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/CommandManager.java +++ b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/CommandManager.java @@ -67,30 +67,30 @@ public class CommandManager { // } // return path; // } - - public static SdbShellProcess runApplication(String command){ + + public static Process runApplication(String command){ IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); - SdbShellProcess sdbShellProc = null; + Process sdbShellProc = null; //command = getRealTargetPath(command); try { - sdbShellProc = device.executeShellCommand(command); + sdbShellProc = device.executeShellCommand(command, false); } catch (IOException e) { e.printStackTrace(); } return sdbShellProc; } - + public static void runShell(String command) { IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); - SdbShellProcess sdbShellProc = null; + Process sdbShellProc = null; BufferedReader br = null; //command = getRealTargetPath(command); try { - sdbShellProc = device.executeShellCommand(command); + sdbShellProc = device.executeShellCommand(command, false); br = new BufferedReader(new InputStreamReader( sdbShellProc.getInputStream())); diff --git a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/OprofileCommonConstants.java b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/OprofileCommonConstants.java index c10818c..bb12d73 100644 --- a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/OprofileCommonConstants.java +++ b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/OprofileCommonConstants.java @@ -25,12 +25,14 @@ import org.tizen.common.TizenPlatformConstants; public abstract class OprofileCommonConstants { private static final String COMMAND_PATH = TizenPlatformConstants.TOOLS_TARGET_PATH + "/oprofile/usr/bin/"; + + public static final String OPROFILE_SCRIPT = "/usr/bin/oprofile_command"; public static final String COMMAND_OPCONTROL = COMMAND_PATH+"opcontrol"; public static final String COMMAND_OPREPORT = "LD_LIBRARY_PATH=" + COMMAND_PATH + " " + COMMAND_PATH + "opreport"; - public static final String COMMAND_OPHELP = COMMAND_PATH+"ophelp"; + public static final String COMMAND_OPHELP = OPROFILE_SCRIPT+" ophelp"; public static final String COMMAND_OPXML = COMMAND_PATH+"opxml"; diff --git a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/checkevent/CheckEventsProcessor.java b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/checkevent/CheckEventsProcessor.java index 32c93ab..a1239ea 100644 --- a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/checkevent/CheckEventsProcessor.java +++ b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/checkevent/CheckEventsProcessor.java @@ -26,8 +26,7 @@ import org.tizen.oprofile.core.OprofileCommonConstants; public class CheckEventsProcessor { - private final String COMMAND_CHECK_EVENT = OprofileCommonConstants.COMMAND_OPHELP - + " -e"; + private final String COMMAND_CHECK_EVENT = OprofileCommonConstants.COMMAND_OPHELP; public void parse(String event, int count, int unitmask, int[] result) throws InterruptedException { diff --git a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/EventListProcessor.java b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/EventListProcessor.java index ab6f163..7472ed7 100644 --- a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/EventListProcessor.java +++ b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/EventListProcessor.java @@ -46,8 +46,8 @@ public class EventListProcessor { } } - private static final String COMMAND_EVENT_LIST = OprofileCommonConstants.COMMAND_OPCONTROL - + " -l 2> /dev/null"; + private static final String COMMAND_EVENT_LIST = OprofileCommonConstants.OPROFILE_SCRIPT + " list"; + //Add by yangang.han(yangangx.han@intel.com) 2013.03.06 to fix the bug TDIS-4049. //In IA device the event pattern like "CPU_CLK_UNHALTED: (counter: all)" and in ARM device it like "ISS_NO_DISP1: (counter: 1, 2, 3, 4, 5, 6)" //So change this RegExp to match this two type. diff --git a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/OpInfoProcessor.java b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/OpInfoProcessor.java index c6d0df5..e4ca5ba 100644 --- a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/OpInfoProcessor.java +++ b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/OpInfoProcessor.java @@ -24,6 +24,10 @@ import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo; import org.tizen.oprofile.core.CommandManager; +import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin; +import org.eclipse.linuxtools.oprofile.core.OpcontrolException; +import org.tizen.oprofile.core.OprofileCommonConstants; + public class OpInfoProcessor { private OpInfo info; @@ -39,25 +43,23 @@ public class OpInfoProcessor { * Solution:Set nmi_watchdog 0 to switch off timer_moder. In this case, IA device can run Oprofile. */ - private static final String COMMAND_PATH = "/home/developer/sdk_tools/oprofile/usr/bin/"; - public static final String COMMAND_OPCONTROL = COMMAND_PATH+"opcontrol"; - private final String COMMAND_INIT = " --init"; - private final String COMMAND_START = " --start"; - private final String COMMAND_DEINIT = " --deinit"; - private final String COMMAND_DUMP = " --dump"; - private final String COMMAND_WATCHDOG = "echo 0 > /proc/sys/kernel/nmi_watchdog"; + private final String COMMAND_WATCHDOG = OprofileCommonConstants.OPROFILE_SCRIPT + " watchdogoff"; public void parse() throws InterruptedException { String[] resultStr = null; resultStr = CommandManager.runCommandReturningResultArray(COMMAND_COUNTER_NO); - if (null == resultStr || resultStr.length <= 1) { - CommandManager.runCommand(COMMAND_OPCONTROL+COMMAND_INIT); - CommandManager.runCommand(COMMAND_OPCONTROL+COMMAND_DEINIT); - CommandManager.runCommand(COMMAND_WATCHDOG); - CommandManager.runCommand(COMMAND_OPCONTROL+COMMAND_INIT); - resultStr = CommandManager.runCommandReturningResultArray(COMMAND_COUNTER_NO); - CommandManager.runCommand(COMMAND_OPCONTROL+COMMAND_DEINIT); + try { + if (null == resultStr || resultStr.length <= 1) { + OprofileCorePlugin.getDefault().getOpcontrolProvider().initModule(); + OprofileCorePlugin.getDefault().getOpcontrolProvider().deinitModule(); + CommandManager.runShell(COMMAND_WATCHDOG); + OprofileCorePlugin.getDefault().getOpcontrolProvider().initModule(); + resultStr = CommandManager.runCommandReturningResultArray(COMMAND_COUNTER_NO); + OprofileCorePlugin.getDefault().getOpcontrolProvider().deinitModule(); + } + } catch (OpcontrolException oe) { + OprofileCorePlugin.showErrorDialog("opcontrolProvider", oe); } /*End Yangang.han*/ diff --git a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/sessions/SessionsProcessor.java b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/sessions/SessionsProcessor.java index 1839831..1d52ee5 100644 --- a/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/sessions/SessionsProcessor.java +++ b/org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/sessions/SessionsProcessor.java @@ -37,7 +37,7 @@ public class SessionsProcessor{ private final String DEFAULT_SESSION_NAME = "current"; private final String TIMER_EVENT = "TIMER"; - private final String COMMAND_SESSION_EVENT =OprofileCommonConstants.COMMAND_OPCONTROL+" --status 2> /dev/null | grep ^Event"; + private final String COMMAND_SESSION_EVENT =OprofileCommonConstants.OPROFILE_SCRIPT+" status"; public void parse(ArrayList eventList) throws InterruptedException{ if(Oprofile.getTimerMode()){ diff --git a/org.eclipse.linuxtools.oprofile.launch.exe/plugin.xml b/org.eclipse.linuxtools.oprofile.launch.exe/plugin.xml index 86eb610..501d492 100644 --- a/org.eclipse.linuxtools.oprofile.launch.exe/plugin.xml +++ b/org.eclipse.linuxtools.oprofile.launch.exe/plugin.xml @@ -40,22 +40,44 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/TizenOprofileLaunchDelegate.java b/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/TizenOprofileLaunchDelegate.java index 0034e06..7d379b5 100644 --- a/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/TizenOprofileLaunchDelegate.java +++ b/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/TizenOprofileLaunchDelegate.java @@ -59,6 +59,7 @@ import org.tizen.nativecommon.launch.TizenLaunchMessages; import org.tizen.oprofile.core.CommandManager; import org.tizen.sdblib.SdbShellProcess; import org.tizen.nativecommon.Activator; +import org.tizen.nativecommon.IXMLStore; import org.tizen.nativecommon.ProjectUtil; public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { @@ -86,6 +87,12 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { if (monitor == null) monitor = new NullProgressMonitor(); try { + // check for IME app + IXMLStore store = ProjectUtil.getAppXmlStore(ProjectUtil.getProject(config)); + if(store.isImeCategory()) + { + newCoreException("Profiling of IME application is not supported.", null); + } monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION, 30); @@ -126,8 +133,14 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { try { // check oprofile tool checkProfilingTool(monitor); + + String remoteExePath = getDebugLaunchCommand(config); - String remoteExePath = ProjectUtil.getAppDirectory(ProjectUtil.getProject(config), currentDevice) + "/bin/"; +// String remoteExePath = ProjectUtil.getAppDirectory(ProjectUtil.getProject(config), currentDevice) + "/bin/"; +// remoteExePath = remoteExePath.replace("/opt/usr/apps/", "/opt/apps/"); +// IPath exeFile = CDebugUtils.verifyProgramPath(config); +// remoteExePath += exeFile.toFile().getName(); + // String cmd = "cd " + remoteExePath + CMD_RESULT_CHECK; // // String resultRsp = session.run(cmd, null); // String[] resultRsp = CommandManager @@ -140,24 +153,21 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { if (monitor.isCanceled()) throw new OperationCanceledException(); - IPath exeFile = CDebugUtils.verifyProgramPath(config); - remoteExePath += exeFile.toFile().getName(); - // for bada application // execute non-exe file instead of .exe file if(remoteExePath.endsWith(BADA_EXT)) { remoteExePath = remoteExePath.substring(0, remoteExePath.length() - BADA_EXT.length()); } - - String cmd = "ls " + remoteExePath + TizenPlatformConstants.CMD_SUFFIX; + String cmd; +// String cmd = "ls " + remoteExePath + TizenPlatformConstants.CMD_SUFFIX; // resultRsp = session.run(cmd, null); - String[] resultRsp = CommandManager.runCommandReturningResultArray(cmd); - if (!CommandManager.isRunSeccessfuly(resultRsp)) - newCoreException( - TizenLaunchMessages.CANNOT_LAUNCH, - new Exception( - "Executable does not exist on a valid path. You must install your application before running it.")); +// String[] resultRsp = CommandManager.runCommandReturningResultArray(cmd); +// if (!CommandManager.isRunSeccessfuly(resultRsp)) +// newCoreException( +// TizenLaunchMessages.CANNOT_LAUNCH, +// new Exception( +// "Executable does not exist on a valid path. You must install your application before running it.")); if (monitor.isCanceled()) throw new OperationCanceledException(); @@ -185,7 +195,7 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { if (monitor.isCanceled()) throw new OperationCanceledException(); - postProcedure(config, launch, monitor); + postProcedure(config, launch, monitor, remoteExePath); if (monitor.isCanceled()) throw new OperationCanceledException(); @@ -202,7 +212,8 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { private void runApplication(ILaunchConfiguration config, ILaunch launch, String command) { - SdbShellProcess oprofileProc = CommandManager.runApplication(command); + + Process oprofileProc = CommandManager.runApplication(command); IPath exeFile = null; try { exeFile = CDebugUtils.verifyProgramPath(config); @@ -309,9 +320,14 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { } private void postProcedure(ILaunchConfiguration config, ILaunch launch, - IProgressMonitor monitor) throws CoreException { + IProgressMonitor monitor, String remoteExePath) throws CoreException { // ILaunchManager lmgr = DebugPlugin.getDefault().getLaunchManager(); // lmgr.addLaunchListener(new LaunchTerminationWatcher(launch)); + + // terminate application when stop button clicked + String cmd = "/usr/bin/oprofile_command killapp " + remoteExePath; + CommandManager.runShell(cmd); + OprofileCorePlugin.getDefault().getOpcontrolProvider().dumpSamples(); OprofileCorePlugin.getDefault().getOpcontrolProvider().shutdownDaemon(); @@ -341,7 +357,7 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate { public static void checkProfilingTool(IProgressMonitor monitor) throws CoreException { // find oprofile - String oprofileCmd = TizenPlatformConstants.TOOLS_TARGET_PATH + "/oprofile/usr/bin/opcontrol"; + String oprofileCmd = "/usr/bin/opcontrol"; String cmd = "ls " + oprofileCmd + TizenPlatformConstants.CMD_SUFFIX; // String resultRsp = session.run(cmd, null); String[] resultRsp = CommandManager.runCommandReturningResultArray(cmd); diff --git a/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/configuration/NormalOprofileLaunchConfigurationTabGroup.java b/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/configuration/NormalOprofileLaunchConfigurationTabGroup.java index 68a1e4b..10fd2bf 100644 --- a/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/configuration/NormalOprofileLaunchConfigurationTabGroup.java +++ b/org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/configuration/NormalOprofileLaunchConfigurationTabGroup.java @@ -29,6 +29,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab; +import org.eclipse.linuxtools.profiling.launch.ProfileConfigurationMainTab; import org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup; import org.tizen.nativecommon.launch.ui.TizenMainTab; import org.tizen.oprofile.launch.TizenOprofileLaunchDelegate; @@ -37,7 +38,7 @@ public class NormalOprofileLaunchConfigurationTabGroup extends ProfileLaunchConf public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ArrayList tabs = new ArrayList(); - tabs.add(new TizenMainTab()); + tabs.add(new ProfileConfigurationMainTab()); // tabs.add(new TizenArgumentsTab()); tabs.addAll(Arrays.asList(getProfileTabs())); // tabs.add(new TizenEnvironmentTab()); diff --git a/org.eclipse.linuxtools.oprofile.launch/src/org/tizen/oprofile/launch/DefaultSettingConstants.java b/org.eclipse.linuxtools.oprofile.launch/src/org/tizen/oprofile/launch/DefaultSettingConstants.java index 0af40ad..2a07b13 100644 --- a/org.eclipse.linuxtools.oprofile.launch/src/org/tizen/oprofile/launch/DefaultSettingConstants.java +++ b/org.eclipse.linuxtools.oprofile.launch/src/org/tizen/oprofile/launch/DefaultSettingConstants.java @@ -35,12 +35,12 @@ public abstract class DefaultSettingConstants { } private static final String[] basicSetting = { - "Bottleneck Analysis", "--event=default" + "Bottleneck Analysis", "event=default" }; private static final String[][] settingForARMv7 = { basicSetting, - {"Instruction Cache Efficiency Analysis", "--event=IFETCH_MISS:10000:0:1:1 --event=INSTR_EXECUTED:10000:0:1:1"} + {"Instruction Cache Efficiency Analysis", "event=IFETCH_MISS:10000:0:1:1 event=INSTR_EXECUTED:10000:0:1:1"} }; private static final String[][] settingForCore2 = { diff --git a/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF index 00521f3..dd33548 100644 --- a/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF +++ b/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF @@ -9,9 +9,13 @@ Require-Bundle: org.eclipse.ui, org.tizen.common, org.tizen.common.connection Bundle-ActivationPolicy: lazy -Import-Package: org.eclipse.cdt.core.model, +Import-Package: org.eclipse.cdt.core, + org.eclipse.cdt.core.model, + org.eclipse.cdt.core.settings.model, org.eclipse.cdt.debug.core, + org.eclipse.cdt.debug.internal.ui.launch, org.eclipse.cdt.launch, + org.eclipse.cdt.launch.internal.ui, org.eclipse.cdt.launch.ui, org.eclipse.cdt.managedbuilder.core, org.eclipse.cdt.ui, @@ -19,6 +23,10 @@ Import-Package: org.eclipse.cdt.core.model, org.eclipse.debug.core, org.eclipse.debug.ui, org.eclipse.debug.ui.sourcelookup, + org.tizen.nativecommon, + org.tizen.nativecommon.build, + org.tizen.nativecommon.launch, + org.tizen.nativecommon.launch.ui, org.tizen.sdblib Export-Package: org.eclipse.linuxtools.profiling.launch Bundle-Localization: plugin diff --git a/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileConfigurationMainTab.java b/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileConfigurationMainTab.java new file mode 100644 index 0000000..14abce1 --- /dev/null +++ b/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileConfigurationMainTab.java @@ -0,0 +1,160 @@ +/* + * Profile Configuration Main Tab + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jaewon Lim + * Wonhyoung Park + * Juyoung Kim + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.eclipse.linuxtools.profiling.launch; + +import java.util.ArrayList; + +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.launch.internal.ui.LaunchMessages; +import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; +import org.eclipse.cdt.ui.CElementLabelProvider; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.ui.dialogs.ElementListSelectionDialog; +import org.tizen.nativecommon.build.CommonBuildConstants; +import org.tizen.nativecommon.launch.ui.TizenMainTab; + +public class ProfileConfigurationMainTab extends TizenMainTab { + + @Override + @SuppressWarnings("restriction") + protected void updateProgramFromConfig(ILaunchConfiguration config) { + if (fProgText != null) { + String programName = EMPTY_STRING; + + try { + if (!isUnitTestProject(config)) { + programName = config.getAttribute( + ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, + EMPTY_STRING); + } + } catch (CoreException e) { + e.printStackTrace(); + } + + fProgText.setText(programName); + } + } + + @Override + @SuppressWarnings("restriction") + protected void updateProjectFromConfig(ILaunchConfiguration config) { + String projectName = EMPTY_STRING; + String configName = EMPTY_STRING; + try { + if (!isUnitTestProject(config)) { + projectName = config.getAttribute( + ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, + EMPTY_STRING); + configName = config + .getAttribute( + ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, + EMPTY_STRING); + } + } catch (CoreException ce) { + LaunchUIPlugin.log(ce); + } + + if (!fProjText.getText().equals(projectName)) + fProjText.setText(projectName); + updateBuildConfigCombo(configName); + } + + @Override + @SuppressWarnings("restriction") + protected ICProject chooseCProject() { + try { + ICProject[] projects = getCProjects(); + ArrayList filteredProjects = new ArrayList(); + + for (ICProject project : projects) { + String[] natures = project.getProject().getDescription() + .getNatureIds(); + boolean isUnittestProject = false; + + for (String nature : natures) { + if (nature.equals(CommonBuildConstants.UNIT_TEST_NATURE_ID)) { + isUnittestProject = true; + break; + } + } + if (!isUnittestProject) { + filteredProjects.add(project); + } + } + + ILabelProvider labelProvider = new CElementLabelProvider(); + ElementListSelectionDialog dialog = new ElementListSelectionDialog( + getShell(), labelProvider); + dialog.setTitle(LaunchMessages.CMainTab_Project_Selection); + dialog.setMessage(LaunchMessages.CMainTab_Choose_project_to_constrain_search_for_program); + dialog.setElements(filteredProjects.toArray()); + + ICProject cProject = getCProject(); + if (cProject != null) { + dialog.setInitialSelections(new Object[] { cProject }); + } + if (dialog.open() == Window.OK) { + return (ICProject) dialog.getFirstResult(); + } + } catch (CModelException e) { + LaunchUIPlugin.errorDialog("Launch UI internal error", e); //$NON-NLS-1$ + } catch (CoreException e) { + e.printStackTrace(); + } + return null; + } + + @SuppressWarnings("restriction") + public static boolean isUnitTestProject(ILaunchConfiguration config) { + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + IWorkspaceRoot root = workspace.getRoot(); + + try { + String pName = config.getAttribute( + ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, + EMPTY_STRING); + + if (!pName.equals(EMPTY_STRING)) { + String[] natures = root.getProject(pName).getDescription() + .getNatureIds(); + + for (String nature : natures) { + if (nature.equals(CommonBuildConstants.UNIT_TEST_NATURE_ID)) { + return true; + } + } + } + } catch (CoreException e) { + return false; + } + + return false; + } + +} diff --git a/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut.java b/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut.java index 7bdef3a..3683be4 100644 --- a/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut.java +++ b/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut.java @@ -12,20 +12,24 @@ *******************************************************************************/ package org.eclipse.linuxtools.profiling.launch; +import java.io.File; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.IBinary; import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.launch.AbstractCLaunchDelegate; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.ui.CElementLabelProvider; +import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; @@ -53,8 +57,14 @@ import org.eclipse.jface.window.Window; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.dialogs.ElementListSelectionDialog; import org.eclipse.ui.dialogs.TwoPaneElementSelector; +import org.tizen.common.util.ViewUtil; +import org.tizen.nativecommon.ProjectUtil; +import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants; +import org.tizen.nativecommon.launch.LaunchUtils; +import org.tizen.sdblib.IDevice; public abstract class ProfileLaunchShortcut implements ILaunchShortcut { @@ -95,7 +105,7 @@ public abstract class ProfileLaunchShortcut implements ILaunchShortcut { public static void showErrorDialog(final String errorMessage, final String reasonMessage, final Exception ex) { - final String dialogTitle = "Valgrind Error"; + final String dialogTitle = "Profile Error"; final String toolname = Messages.getString("ProfileLaunchShortcut.targetcheck"); final IStatus status = new Status(IStatus.ERROR, toolname, IStatus.OK, reasonMessage, ex); @@ -113,19 +123,41 @@ public static void showErrorDialog(final String errorMessage, final String reaso * @return a re-useable config or null if none */ protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) { + if(bin == null) + { + IWorkbenchWindow workbenchWindow = ViewUtil.getWorkbenchWindow(); + if(workbenchWindow != null && workbenchWindow.getSelectionService() != null) + { + ISelection selection = workbenchWindow.getSelectionService().getSelection(); + if (selection instanceof IStructuredSelection) { + Object[] obj = ((IStructuredSelection)selection).toArray(); + if (obj.length == 1) { + IProject project = (IProject)obj[0]; + return createConfiguration(project, mode); + } + } + } + showErrorDialog("Cannot find a project name.", "Cannot find a project name.", null); + } + ILaunchConfiguration configuration = null; ILaunchConfigurationType configType = getLaunchConfigType(); + IDevice device = LaunchUtils.getCurrentDeployDevice(); List candidateConfigs = Collections.emptyList(); try { ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(configType); candidateConfigs = new ArrayList(configs.length); for (int i = 0; i < configs.length; i++) { ILaunchConfiguration config = configs[i]; + String device_serial = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_CONFIG_DEVICE_SERIALNO, + TizenLaunchConfigurationConstants.ATTR_CONFIG_NO_DEVICE); IPath programPath = AbstractCLaunchDelegate.getProgramPath(config); String projectName = AbstractCLaunchDelegate.getProjectName(config); IPath binPath = bin.getResource().getProjectRelativePath(); if (programPath != null && programPath.equals(binPath)) { - if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) { + if (projectName != null && projectName.equals(bin.getCProject().getProject().getName()) + && device_serial.equals(device.getSerialNumber())) + { candidateConfigs.add(config); } } @@ -161,6 +193,7 @@ public static void showErrorDialog(final String errorMessage, final String reaso try { String projectName = bin.getResource().getProjectRelativePath().toString(); ILaunchConfigurationType configType = getLaunchConfigType(); + IDevice device = LaunchUtils.getCurrentDeployDevice(); ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(bin.getElementName())); wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, projectName); @@ -169,6 +202,15 @@ public static void showErrorDialog(final String errorMessage, final String reaso wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); setDefaultProfileAttributes(wc); + + ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(bin.getCProject().getProject()); + if (projDes != null) { + String buildConfigID = projDes.getActiveConfiguration().getId(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID); + String buildConfigName = projDes.getActiveConfiguration().getName(); + wc.setAttribute(TizenLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_NAME, buildConfigName); + wc.setAttribute(TizenLaunchConfigurationConstants.ATTR_CONFIG_DEVICE_SERIALNO, device.getSerialNumber()); + } config = wc.doSave(); } catch (CoreException e) { @@ -177,6 +219,41 @@ public static void showErrorDialog(final String errorMessage, final String reaso return config; } + private ILaunchConfiguration createConfiguration(IProject prj, String mode) { + ILaunchConfiguration config = null; + try { + String projectName = prj.getName(); + ILaunchConfigurationType configType = getLaunchConfigType(); + IDevice device = LaunchUtils.getCurrentDeployDevice(); + + IProject project = prj; + String configName = ProjectUtil.getLaunchConfigurationName(project); + ILaunchConfigurationWorkingCopy wc = + configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(configName)); + + String programName = ProjectUtil.getDefaultConfiguration(prj).getName() + File.separatorChar + ProjectUtil.getBinaryName(prj); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, programName); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName); + wc.setMappedResources(new IResource[] {prj}); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); + + setDefaultProfileAttributes(wc); + + ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(prj); + if (projDes != null) { + String buildConfigID = projDes.getActiveConfiguration().getId(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID); + String buildConfigName = projDes.getActiveConfiguration().getName(); + wc.setAttribute(TizenLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_NAME, buildConfigName); + wc.setAttribute(TizenLaunchConfigurationConstants.ATTR_CONFIG_DEVICE_SERIALNO, device.getSerialNumber()); + } + config = wc.doSave(); + } catch (CoreException e) { + e.printStackTrace(); + } + return config; + } + protected ILaunchManager getLaunchManager() { return DebugPlugin.getDefault().getLaunchManager(); } diff --git a/org.eclipse.linuxtools.valgrind.launch.exe/plugin.xml b/org.eclipse.linuxtools.valgrind.launch.exe/plugin.xml index 1ab4199..549beed 100644 --- a/org.eclipse.linuxtools.valgrind.launch.exe/plugin.xml +++ b/org.eclipse.linuxtools.valgrind.launch.exe/plugin.xml @@ -42,22 +42,44 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/CommandManager.java b/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/CommandManager.java index d772c12..08b08dc 100644 --- a/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/CommandManager.java +++ b/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/CommandManager.java @@ -30,12 +30,12 @@ class CommonReceiver extends MultiLineReceiver { public class CommandManager { - public static SdbShellProcess runApplication(String command){ + public static Process runApplication(String command){ IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); - SdbShellProcess sdbShellProc = null; + Process sdbShellProc = null; try { - sdbShellProc = device.executeShellCommand(command); + sdbShellProc = device.executeShellCommand(command, false); } catch (IOException e) { e.printStackTrace(); } @@ -67,6 +67,31 @@ public class CommandManager { return lastOut; } + public static String runShellRoot(String command) { + IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); + Process sdbShellProc = null; + BufferedReader br = null; + + try { + sdbShellProc = device.executeShellCommand(command, false); + br = new BufferedReader(new InputStreamReader( + sdbShellProc.getInputStream())); + + } catch (IOException e1) { + e1.printStackTrace(); + } + String out = null; + String lastOut = null; + try { + while (null != (out = br.readLine())) { + lastOut = out; + } + } catch (IOException e) { + e.printStackTrace(); + } + return lastOut; + } + public static String[] runCommandReturningResult(String command) { IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); CommonReceiver commonReceiver = new CommonReceiver(); diff --git a/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java b/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java index e5e71a1..b2332dc 100644 --- a/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java +++ b/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java @@ -52,6 +52,7 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.tizen.common.TizenPlatformConstants; import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.nativecommon.IXMLStore; import org.tizen.nativecommon.ProjectUtil; import org.tizen.nativecommon.launch.IProjectLaunchCommand; import org.tizen.nativecommon.launch.TizenLaunchCommand; @@ -89,12 +90,20 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate { monitor = new NullProgressMonitor(); try { + // check for real device IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); if(!device.isEmulator()) { newCoreException("Valgrind profiling is available in emulator only.", null); } + // check for IME app + IXMLStore store = ProjectUtil.getAppXmlStore(ProjectUtil.getProject(config)); + if(store.isImeCategory()) + { + newCoreException("Profiling of IME application is not supported.", null); + } + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION, 30); activateProgressView(); @@ -143,9 +152,10 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate { throw new OperationCanceledException(); // verify target app path - String remoteExePath = ProjectUtil.getAppDirectory(ProjectUtil.getProject(config), currentDevice) + "/bin/"; - IPath exeFile = CDebugUtils.verifyProgramPath(config); - remoteExePath += exeFile.toFile().getName(); + String remoteExePath = getDebugLaunchCommand(config); +// String remoteExePath = ProjectUtil.getAppDirectory(ProjectUtil.getProject(config), currentDevice) + "/bin/"; +// IPath exeFile = CDebugUtils.verifyProgramPath(config); +// remoteExePath += exeFile.toFile().getName(); // for bada application // execute non-exe file instead of .exe file @@ -184,6 +194,8 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate { String[] opts = getValgrindArgumentsArray(config); String[] arguments = getProgramArgumentsArray(config); + // for sciprt usage + valgrindCmd = "/usr/bin/oprofile_command valgrind"; ArrayList cmdLine = new ArrayList(1 + arguments.length); cmdLine.add(valgrindCmd); cmdLine.addAll(Arrays.asList(opts)); @@ -202,11 +214,13 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate { if (monitor.isCanceled()) throw new OperationCanceledException(); - + // run application with valgrind runApplication(config, launch, fullcommand, monitor); monitor.worked(2); + + CommandManager.runShellRoot(valgrindCmd + "_chmod"); // process = DebugPlugin.newProcess(launch, remoteShellProcess, "valgrind"); @@ -257,7 +271,7 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate { private void runApplication(ILaunchConfiguration config, ILaunch launch, String command, IProgressMonitor monitor) throws ValgrindCanceledException { - SdbShellProcess valgrindProc = CommandManager.runApplication(command); + Process valgrindProc = CommandManager.runApplication(command); IPath exeFile = null; try { exeFile = CDebugUtils.verifyProgramPath(config); diff --git a/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/ValgrindLaunchConfigurationTabGroup.java b/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/ValgrindLaunchConfigurationTabGroup.java index 28e7606..0e19eac 100644 --- a/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/ValgrindLaunchConfigurationTabGroup.java +++ b/org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/ValgrindLaunchConfigurationTabGroup.java @@ -25,6 +25,7 @@ import java.util.Arrays; import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.linuxtools.profiling.launch.ProfileConfigurationMainTab; import org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup; import org.tizen.nativecommon.launch.ui.TizenMainTab; @@ -43,7 +44,7 @@ public class ValgrindLaunchConfigurationTabGroup extends ProfileLaunchConfigurat // // } ArrayList tabs = new ArrayList(); - tabs.add(new TizenMainTab()); + tabs.add(new ProfileConfigurationMainTab()); // tabs.add(new TizenArgumentsTab()); tabs.addAll(Arrays.asList(getProfileTabs())); // tabs.add(new TizenEnvironmentTab()); diff --git a/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/ValgrindOptionsTab.java b/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/ValgrindOptionsTab.java index f337f9b..dc29d36 100644 --- a/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/ValgrindOptionsTab.java +++ b/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/ValgrindOptionsTab.java @@ -612,7 +612,7 @@ public class ValgrindOptionsTab extends AbstractLaunchConfigurationTab { public boolean isValid(ILaunchConfiguration launchConfig) { // added by Jaewon Lim at 20120904 if(!canInitialize || ProfileLaunchPlugin.checkTarget() == 0){ - setErrorMessage(Messages.getString("ValgrindOptionsTab.noemul")); + setErrorMessage(Messages.getString("ValgrindOptionsTab.noemul_option")); return false; } diff --git a/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/messages.properties b/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/messages.properties index 02ca739..68432f2 100644 --- a/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/messages.properties +++ b/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/messages.properties @@ -34,5 +34,6 @@ ValgrindOptionsTab.collect_data2=Heap Memory Profiling ValgrindOptionsTab.memps=Memory Usage data ValgrindOptionsTab.inemul=Please note that valgrind profiling is available in emulator only. ValgrindOptionsTab.noemul=Emulator isn't connected or activated. +ValgrindOptionsTab.noemul_option=Emulator isn't activated.(valgrind is supported in emulator only) ValgrindOptionsTab.cannotrun=Cannot run valgrind profiling. -- 2.7.4