[TITLE] unused package remove
authorwonhyoung2.park <wonhyoung2.park@samsung.com>
Tue, 13 Dec 2011 04:52:58 +0000 (13:52 +0900)
committerwonhyoung2.park <wonhyoung2.park@samsung.com>
Tue, 13 Dec 2011 04:52:58 +0000 (13:52 +0900)
[Type]
[Module] Profiler
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

builder/metadata/data/SDK/profiling-tool/oprofile_armel.deb [deleted file]
builder/metadata/data/SDK/profiling-tool/valgrind_armel.deb [deleted file]
org.eclipse.linuxtools.oprofile.launch.exe/src/com/samsung/tizen/oprofile/launch/TizenOprofileLaunchDelegate.java
org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java

diff --git a/builder/metadata/data/SDK/profiling-tool/oprofile_armel.deb b/builder/metadata/data/SDK/profiling-tool/oprofile_armel.deb
deleted file mode 100644 (file)
index b4b155c..0000000
Binary files a/builder/metadata/data/SDK/profiling-tool/oprofile_armel.deb and /dev/null differ
diff --git a/builder/metadata/data/SDK/profiling-tool/valgrind_armel.deb b/builder/metadata/data/SDK/profiling-tool/valgrind_armel.deb
deleted file mode 100644 (file)
index e370dea..0000000
Binary files a/builder/metadata/data/SDK/profiling-tool/valgrind_armel.deb and /dev/null differ
index 7963136..352cedc 100644 (file)
@@ -21,7 +21,6 @@
 package com.samsung.tizen.oprofile.launch;
 
 import java.io.BufferedReader;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.util.ArrayList;
@@ -34,7 +33,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchManager;
@@ -48,16 +46,13 @@ import org.eclipse.linuxtools.oprofile.launch.configuration.LaunchOptions;
 import org.eclipse.linuxtools.oprofile.launch.configuration.OprofileCounter;
 import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
 import org.eclipse.linuxtools.oprofile.ui.view.OprofileView;
-import org.eclipse.linuxtools.profiling.launch.Messages;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 
-import com.samsung.tizen.common.properties.InstallPathConfig;
 import com.samsung.tizen.nativeapp.launch.TizenLaunchDelegate;
 import com.samsung.tizen.nativeapp.launch.TizenLaunchMessages;
 import com.samsung.tizen.oprofile.core.CommandManager;
-import com.samsung.tizen.oprofile.launch.DefaultSettingConstants;
 import com.samsung.tizen.sdblib.SdbShellProcess;
 
 public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate {
@@ -67,7 +62,7 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate {
 
        protected static final String PACKAGE_NAME = "oprofile";
        protected static final String PACKAGE_FILENAME_ARM = "oprofile_armel.deb";
-       
+
        protected static String appName = null;
 
        public static String getAppName() {
@@ -181,8 +176,8 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate {
                IPath exeFile = null;
                try {
                        exeFile = CDebugUtils.verifyProgramPath(config);
-                       OprofileDebugPlugin.newProcess(launch, oprofileProc, exeFile.toFile()
-                                       .getName());
+                       OprofileDebugPlugin.newProcess(launch, oprofileProc, exeFile
+                                       .toFile().getName());
                        BufferedReader br = new BufferedReader(new InputStreamReader(
                                        oprofileProc.getInputStream()));
                        while (null != br.readLine()) {
@@ -320,141 +315,14 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate {
                // String resultRsp = session.run(cmd, null);
                String[] resultRsp = CommandManager.runCommandReturningResultArray(cmd);
                if (!CommandManager.isRunSeccessfuly(resultRsp)) {
-                       if (CommandManager.isEmulator()) {
-                               throw new Exception(
-                                               TizenLaunchMessages.CANNOT_LAUNCH,
-                                               new Exception(
-                                                               "No oprofile in this target (/usr/bin/opcontrol)."));
-                       } else {
-                               transferProfilingToolPackage(monitor);
-                               installProfilingToolPackage(monitor);
-                       }
-               }
-       }
-
-       /**
-        * Transfer oprofile package to the target
-        * 
-        * @param monitor
-        * @param session
-        *            connection session to the target or simulator
-        * @return void
-        * 
-        * @exception CoreException
-        *                if unable to transfer a package
-        */
-       public static void transferProfilingToolPackage(IProgressMonitor monitor)
-                       throws Exception {
-               try {
-                       monitor.beginTask(
-                                       Messages.getString("ProfileLaunch.TRANSFER_PROFILING_TOOL"),
-                                       1);
-
-                       // test whether oprofile package exist or not
-                       String sdkInstallPath = InstallPathConfig.getSDKPath();
-                       String toolPkgPath = sdkInstallPath + "/SDK/profiling-tool/"
-                                       + PACKAGE_FILENAME_ARM;
-                       File toolPkg = new File(toolPkgPath);
-                       if (toolPkg == null || !toolPkg.exists())
-                               throw new Exception(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
-                                               new Exception("Tool package path (" + toolPkgPath
-                                                               + ") is not available."));
-
-                       String destDirectoryPath = TEMPORARY_PKG_PATH;
-
-                       if (!CommandManager.isPathExist(destDirectoryPath)) {
-                               String command = MAKE_DIRECTORY_CMD + destDirectoryPath
-                                               + CMD_RESULT_CHECK;
-                               // String result = session.run(command, null);
-                               String[] result = CommandManager
-                                               .runCommandReturningResultArray(command);
-                               if (!CommandManager.isRunSeccessfuly(result))
-                                       throw new Exception(
-                                                       Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
-                                                       new Exception("Destination path ("
-                                                                       + destDirectoryPath + ") in not exist."));
-                       }
-
-                       String srcFilePath = toolPkg.getAbsoluteFile().getCanonicalPath();
-                       String destFilePath = destDirectoryPath
-                                       + toolPkg.getAbsoluteFile().getName();
-
-                       // boolean isSuccess = session.transferFile(srcFilePath,
-                       // destFilePath);
-                       boolean isSuccess = CommandManager.push(srcFilePath, destFilePath);
-
-                       if (isSuccess == false)
-                               throw new Exception(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
-                                               new Exception("source path (" + srcFilePath
-                                                               + "), dest path (" + destFilePath + ")"));
-               } catch (Exception e) {
-                       throw e;
-               } finally {
-                       monitor.done();
-               }
-       }
-
-       /**
-        * Install oprofile package to the target
-        * 
-        * @param config
-        *            launch configuration
-        * @param pkgmgr
-        *            instance which contains resources and control information
-        * @return void
-        * 
-        * @exception CoreException
-        *                if unable to install a package
-        */
-       public static void installProfilingToolPackage(IProgressMonitor monitor)
-                       throws Exception {
-               try {
-                       monitor.beginTask(
-                                       Messages.getString("ProfileLaunch.INSTALL_PROFILING_TOOL"),
-                                       2);
-
-                       String packageDirectory = TEMPORARY_PKG_PATH;
-                       String command = CHANGE_DIRECTORY_CMD + packageDirectory
-                                       + CMD_RESULT_CHECK;
-                       // String result = session.run(command, null);
-                       String[] result = CommandManager
-                                       .runCommandReturningResultArray(command);
-                       if (!CommandManager.isRunSeccessfuly(result))
-                               throw new Exception(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
-                                               new Exception("command is " + command));
-                       monitor.worked(1);
-
-                       // remount file system
-                       command = "mount -o remount,rw /" + CMD_RESULT_CHECK;
-                       // result = session.run(command, null);
-                       result = CommandManager.runCommandReturningResultArray(command);
-                       if (!CommandManager.isRunSeccessfuly(result))
-                               throw new Exception(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
-                                               new Exception("command is " + command));
-
-                       // install new application
-                       command = PKG_TOOL_CMD + PKG_TOOL_INSTALL_OPTION
-                                       + PACKAGE_FILENAME_ARM + CMD_RESULT_CHECK;
-                       // result = session.run(command, null);
-                       result = CommandManager.runCommandReturningResultArray(command);
-                       if (!CommandManager.isRunSeccessfuly(result))
-                               throw new Exception(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
-                                               new Exception("command is " + command));
-                       monitor.worked(1);
-
-                       // remount file system
-                       command = "mount -o remount,ro /" + CMD_RESULT_CHECK;
-                       // result = session.run(command, null);
-                       CommandManager.runCommand(command);
-               } catch (Exception e) {
-                       throw e;
-               } finally {
-                       monitor.done();
+                       // if (CommandManager.isEmulator()) {
+                       throw new Exception(TizenLaunchMessages.CANNOT_LAUNCH,
+                                       new Exception(
+                                                       "No oprofile in this target (/usr/bin/opcontrol)."));
+                       // } else {
+                       // transferProfilingToolPackage(monitor);
+                       // installProfilingToolPackage(monitor);
+                       // }
                }
        }
 
index 8415f5d..4caf749 100644 (file)
@@ -35,13 +35,10 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.linuxtools.profiling.launch.Messages;
 import org.eclipse.linuxtools.valgrind.core.ValgrindCommand;
 import org.eclipse.linuxtools.valgrind.core.utils.LaunchConfigurationConstants;
 import org.eclipse.linuxtools.valgrind.ui.ValgrindUIPlugin;
@@ -49,7 +46,6 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 
-import com.samsung.tizen.common.properties.InstallPathConfig;
 import com.samsung.tizen.nativeapp.launch.TizenLaunchDelegate;
 import com.samsung.tizen.nativeapp.launch.TizenLaunchMessages;
 import com.samsung.tizen.sdblib.SdbShellProcess;
@@ -70,7 +66,7 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
 
        protected static final String PACKAGE_NAME = "valgrind";
        protected static final String PACKAGE_FILENAME_ARM = "valgrind_armel.deb";
-       
+
        protected String toolID;
 
        @Override
@@ -119,15 +115,15 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                        // String resultRsp = session.run(cmd, null);
                        String[] resultRsp = CommandManager.runCommandReturningResult(cmd);
                        if (!CommandManager.isRunSeccessfuly(resultRsp)) {
-                               if (CommandManager.isEmulator()) {
-                                       newCoreException(
-                                                       TizenLaunchMessages.CANNOT_LAUNCH,
-                                                       new Exception(
-                                                                       "No valgrind in this target (/usr/bin/valgrind). "));
-                               } else {
-                                       transferProfilingToolPackage(monitor);
-                                       installProfilingToolPackage(monitor);
-                               }
+                               // if (CommandManager.isEmulator()) {
+                               newCoreException(
+                                               TizenLaunchMessages.CANNOT_LAUNCH,
+                                               new Exception(
+                                                               "No valgrind in this target (/usr/bin/valgrind). "));
+                               // } else {
+                               // transferProfilingToolPackage(monitor);
+                               // installProfilingToolPackage(monitor);
+                               // }
                        }
 
                        String remoteExePath = getRemoteExePath(config);
@@ -185,13 +181,13 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                                fullcommand += commandArray[i] + " ";
                        }
 
-//                     if (CommandManager.isEmulator()
-//                                     && Platform.getOS().equals(Platform.OS_WIN32)) {
-//                             Exception te;
-//                             te = new Exception(
-//                                             "Can not use valgrind, because the host doesn't support Intel VT");
-//                             throw (te);
-//                     }
+                       // if (CommandManager.isEmulator()
+                       // && Platform.getOS().equals(Platform.OS_WIN32)) {
+                       // Exception te;
+                       // te = new Exception(
+                       // "Can not use valgrind, because the host doesn't support Intel VT");
+                       // throw (te);
+                       // }
 
                        config.getAttribute(
                                        ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL,
@@ -253,8 +249,8 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                IPath exeFile = null;
                try {
                        exeFile = CDebugUtils.verifyProgramPath(config);
-                       ValgrindDebugPlugin.newProcess(launch, oprofileProc, exeFile.toFile()
-                                       .getName());
+                       ValgrindDebugPlugin.newProcess(launch, oprofileProc, exeFile
+                                       .toFile().getName());
                        BufferedReader br = new BufferedReader(new InputStreamReader(
                                        oprofileProc.getInputStream()));
                        while (null != br.readLine()) {
@@ -374,136 +370,4 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                return config.getName() + " ["
                                + ValgrindLaunchPlugin.getDefault().getToolName(toolID) + "] ";
        }
-
-       /**
-        * Transfer valgrind package to the target
-        * 
-        * @param monitor
-        * @param session
-        *            connection session to the target or simulator
-        * @return void
-        * 
-        * @exception CoreException
-        *                if unable to transfer a package
-        */
-       public void transferProfilingToolPackage(IProgressMonitor monitor)
-                       throws CoreException {
-               try {
-                       monitor.beginTask(
-                                       Messages.getString("ProfileLaunch.TRANSFER_PROFILING_TOOL"),
-                                       1);
-
-                       // test whether valgrind package exist or not
-                       String sdkInstallPath = InstallPathConfig.getSDKPath();
-                       String toolPkgPath = sdkInstallPath + "/SDK/profiling-tool/"
-                                       + PACKAGE_FILENAME_ARM;
-                       File toolPkg = new File(toolPkgPath);
-                       if (toolPkg == null || !toolPkg.exists())
-                               newCoreException(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
-                                               new Exception("Tool package path (" + toolPkgPath
-                                                               + ") is not available."));
-
-                       String destDirectoryPath = TEMPORARY_PKG_PATH;
-
-                       if (!CommandManager.isPathExist(destDirectoryPath)) {
-                               String command = MAKE_DIRECTORY_CMD + destDirectoryPath
-                                               + CMD_RESULT_CHECK;
-                               // String result = session.run(command, null);
-                               String[] result = CommandManager
-                                               .runCommandReturningResult(command);
-                               if (!CommandManager.isRunSeccessfuly(result))
-                                       newCoreException(
-                                                       Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
-                                                       new Exception("Destination path ("
-                                                                       + destDirectoryPath + ") in not exist."));
-                       }
-
-                       String srcFilePath = toolPkg.getAbsoluteFile().getCanonicalPath();
-                       String destFilePath = destDirectoryPath
-                                       + toolPkg.getAbsoluteFile().getName();
-
-                       // boolean isSuccess = session.transferFile(srcFilePath,
-                       // destFilePath);
-                       boolean isSuccess = CommandManager.push(srcFilePath, destFilePath);
-
-                       if (isSuccess == false)
-                               newCoreException(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
-                                               new Exception("source path (" + srcFilePath
-                                                               + "), dest path (" + destFilePath + ")"));
-               } catch (CoreException e) {
-                       throw e;
-               } catch (Exception e) {
-                       newCoreException(
-                                       Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"), e);
-               } finally {
-                       monitor.done();
-               }
-       }
-
-       /**
-        * Install valgrind package to the target
-        * 
-        * @param config
-        *            launch configuration
-        * @param pkgmgr
-        *            instance which contains resources and control information
-        * @return void
-        * 
-        * @exception CoreException
-        *                if unable to install a package
-        */
-       public void installProfilingToolPackage(IProgressMonitor monitor)
-                       throws CoreException {
-               try {
-                       monitor.beginTask(
-                                       Messages.getString("ProfileLaunch.INSTALL_PROFILING_TOOL"),
-                                       2);
-
-                       String packageDirectory = TEMPORARY_PKG_PATH;
-                       String command = CHANGE_DIRECTORY_CMD + packageDirectory
-                                       + CMD_RESULT_CHECK;
-                       // String result = session.run(command, null);
-                       String[] result = CommandManager.runCommandReturningResult(command);
-                       if (null != result && result.length > 0 && !result[0].contains("0"))
-                               newCoreException(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
-                                               new Exception("command is " + command));
-                       monitor.worked(1);
-
-                       // remount file system
-                       command = "mount -o remount,rw /" + CMD_RESULT_CHECK;
-                       // result = session.run(command, null);
-                       result = CommandManager.runCommandReturningResult(command);
-                       if (null != result && result.length > 0 && !result[0].contains("0"))
-                               newCoreException(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
-                                               new Exception("command is " + command));
-
-                       // install new application
-                       command = PKG_TOOL_CMD + PKG_TOOL_INSTALL_OPTION + packageDirectory
-                                       + PACKAGE_FILENAME_ARM + CMD_RESULT_CHECK;
-                       // result = session.run(command, null);
-                       String resultStr = CommandManager.runShell(command);
-                       if (null != resultStr && resultStr.length() > 0
-                                       && !resultStr.equals("0"))
-                               newCoreException(
-                                               Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
-                                               new Exception("command is " + command));
-                       monitor.worked(1);
-
-                       // remount file system
-                       command = "mount -o remount,ro /" + CMD_RESULT_CHECK;
-                       // result = session.run(command, null);
-                       result = CommandManager.runCommandReturningResult(command);
-               } catch (CoreException e) {
-                       throw e;
-               } catch (Exception e) {
-                       newCoreException(
-                                       Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"), e);
-               } finally {
-                       monitor.done();
-               }
-       }
 }