package com.samsung.linuxplatform.oprofile.core.processor.checkevent;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
+
import com.samsung.linuxplatform.oprofile.core.OprofileCommonConstants;
import com.samsung.slp.common.conn.session.ISession;
try {
resultStr = session.run(COMMAND_CHECK_EVENT+" "+event+":"+count+":"+unitmask, null);
+ resultStr = PathParser.pathParsing(resultStr);
} catch (Exception e) {
throw new InterruptedException();
}
package com.samsung.linuxplatform.oprofile.core.processor.checkkernel;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
+
import com.samsung.linuxplatform.oprofile.core.OprofileCommonConstants;
import com.samsung.slp.common.conn.session.ISession;
try {
resultStr = session.run(COMMAND_CHECK_KERNEL, null);
+ resultStr = PathParser.pathParsing(resultStr);
} catch (Exception e) {
throw new InterruptedException();
}
import java.util.ArrayList;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;
import org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask;
try {
resultStr = session.run(COMMAND_EVENT_LIST, null);
+ resultStr = PathParser.pathParsing(resultStr);
} catch (Exception e) {
throw new InterruptedException();
}
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;
import com.samsung.slp.common.conn.session.ISession;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
public class OpInfoProcessor{
try {
resultStr = session.run(COMMAND_COUNTER_NO, null);
- if(resultStr.startsWith("/opt/home/root # ")){
- resultStr = resultStr.substring(17, resultStr.length());
- }
+ resultStr = PathParser.pathParsing(resultStr);
} catch (Exception e) {
throw new InterruptedException();
}
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
import org.eclipse.linuxtools.oprofile.core.model.OpModelRoot;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
String resultStr= null;
try {
resultStr = session.run(COMMAND_SESSION_EVENT, null);
+ resultStr = PathParser.pathParsing(resultStr);
} catch (Exception e) {
throw new InterruptedException();
}
}
try {
- if(resultStr.startsWith("/opt/home/root # ")){
- resultStr = resultStr.substring(19,resultStr.length());
- }
saxParser.parse(new InputSource(new StringReader(resultStr)),handler);
} catch (Exception e) {
e.printStackTrace();
import java.util.ArrayList;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
import org.eclipse.linuxtools.oprofile.core.model.OpModelEvent;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSession;
try {
resultStr = session.run(COMMAND_SESSION_EVENT, null);
+ resultStr = PathParser.pathParsing(resultStr);
} catch (Exception e) {
throw new InterruptedException();
}
--- /dev/null
+package org.eclipse.linuxtools.oprofile.core;
+
+public class PathParser {
+ static public String pathParsing(String str){
+ if(str.startsWith("/opt/home/root # ")){
+ str = str.substring(17,str.length());
+ if(str.startsWith("\r\n")){
+ str = str.substring(2, str.length());
+ }
+ }
+ return str;
+ }
+}
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.core.OpxmlException;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
import org.eclipse.linuxtools.oprofile.core.opxml.OprofileSAXHandler;
import org.eclipse.linuxtools.oprofile.core.opxml.XMLProcessor;
import org.xml.sax.InputSource;
String command = OprofileComm.getCommandString(cmdArray)+" | sed 's/^[^<]*//' | sed 's/&//'";
String str = session.run(command, null);
+ str = PathParser.pathParsing(str);
reader.parse(new InputSource(new StringReader(str)));
//jinu removed at 20090616
import com.samsung.slp.nativeide.launch.SLPLaunchMessages;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
+import org.eclipse.linuxtools.oprofile.core.PathParser;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonEvent;
import org.eclipse.linuxtools.oprofile.core.OpcontrolException;
import org.eclipse.linuxtools.oprofile.launch.OprofileLaunchPlugin;
String remoteExePath = getRemoteExePath(config);
String cmd = "cd " + remoteExePath + CMD_RESULT_CHECK;
String resultRsp = session.run(cmd, null);
+ resultRsp = PathParser.pathParsing(resultRsp);
if(!resultRsp.contains("0"))
newCoreException(SLPLaunchMessages.CANNOT_LAUNCH, new Exception("Cannot change to run-directory : " + ". (Return Code: " + resultRsp + ")"));
remoteExePath += exeFile.toFile().getName();
cmd = "ls " + remoteExePath + CMD_RESULT_CHECK;
resultRsp = session.run(cmd, null);
+ resultRsp = PathParser.pathParsing(resultRsp);
if(!resultRsp.contains("0"))
newCoreException(SLPLaunchMessages.CANNOT_LAUNCH, new Exception("Executable does not exist on a valid path. You must install your application before running it."));
// find oprofile
String oprofileCmd = "/usr/bin/opcontrol";
String cmd = "ls " + oprofileCmd + CMD_RESULT_CHECK ;
- String resultRsp = session.run(cmd, null);
+ String resultRsp = session.run(cmd, null);
+ resultRsp = PathParser.pathParsing(resultRsp);
if(!resultRsp.contains("0"))
{
if(DeviceManager.getSelectedDevice().getMachineType().equals(IMachine.VIRTUAL_DEVICE))
if (!session.isPathExist(destDirectoryPath)) {
String command = MAKE_DIRECTORY_CMD + destDirectoryPath + CMD_RESULT_CHECK;
String result = session.run(command, null);
+ result = PathParser.pathParsing(result);
if(!result.contains("0"))
throw new Exception(Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
new Exception("Destination path (" + destDirectoryPath + ") in not exist."));
String packageDirectory = TEMPORARY_PKG_PATH;
String command = CHANGE_DIRECTORY_CMD + packageDirectory + CMD_RESULT_CHECK;
String result = session.run(command, null);
+ result = PathParser.pathParsing(result);
if(!result.contains("0"))
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 = PathParser.pathParsing(result);
if(!result.contains("0"))
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 = PathParser.pathParsing(result);
if(!result.contains("0"))
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);
+ result = PathParser.pathParsing(result);
} catch (Exception e) {
throw e;
} finally {
--- /dev/null
+package org.eclipse.linuxtools.valgrind.launch;
+
+public class PathParser {
+ static public String pathParsing(String str){
+ if(str.startsWith("/opt/home/root # ")){
+ str = str.substring(17,str.length());
+ if(str.startsWith("\r\n")){
+ str = str.substring(2, str.length());
+ }
+ }
+ return str;
+ }
+}
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.linuxtools.valgrind.launch.PathParser;
import org.eclipse.linuxtools.profiling.launch.Messages;
import org.eclipse.linuxtools.valgrind.ui.ValgrindUIPlugin;
import org.eclipse.linuxtools.valgrind.core.ValgrindCommand;
String valgrindCmd = "/usr/bin/valgrind";
String cmd = "ls " + valgrindCmd + CMD_RESULT_CHECK ;
String resultRsp = session.run(cmd, null);
+ resultRsp = PathParser.pathParsing(resultRsp);
if(!resultRsp.contains("0"))
{
if(DeviceManager.getSelectedDevice().getMachineType().equals(IMachine.VIRTUAL_DEVICE))
String remoteExePath = getRemoteExePath(config);
cmd = "cd " + remoteExePath + CMD_RESULT_CHECK;
resultRsp = session.run(cmd, null);
+ resultRsp = PathParser.pathParsing(resultRsp);
if(!resultRsp.contains("0"))
newCoreException(SLPLaunchMessages.CANNOT_LAUNCH, new Exception("Cannot change to run-directory : " + ". (Return Code: " + resultRsp + ", exepath: " + remoteExePath + ")"));
remoteExePath += exeFile.toFile().getName();
cmd = "ls " + remoteExePath + CMD_RESULT_CHECK;
resultRsp = session.run(cmd, null);
+ resultRsp = PathParser.pathParsing(resultRsp);
if(!resultRsp.contains("0"))
newCoreException(SLPLaunchMessages.CANNOT_LAUNCH, new Exception("Executable does not exist on a valid path. You must install your application before running it."));
if (!session.isPathExist(destDirectoryPath)) {
String command = MAKE_DIRECTORY_CMD + destDirectoryPath + CMD_RESULT_CHECK;
String result = session.run(command, null);
+ result = PathParser.pathParsing(result);
if(!result.contains("0"))
newCoreException(Messages.getString("ProfileLaunch.FAIL_TO_TRANSFER"),
new Exception("Destination path (" + destDirectoryPath + ") in not exist."));
String packageDirectory = TEMPORARY_PKG_PATH;
String command = CHANGE_DIRECTORY_CMD + packageDirectory + CMD_RESULT_CHECK;
String result = session.run(command, null);
+ result = PathParser.pathParsing(result);
if(!result.contains("0"))
newCoreException(Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
new Exception("command is " + command));
// remount file system
command = "mount -o remount,rw /" + CMD_RESULT_CHECK;
result = session.run(command, null);
+ result = PathParser.pathParsing(result);
if(!result.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 + PACKAGE_FILENAME_ARM + CMD_RESULT_CHECK;
result = session.run(command, null);
+ result = PathParser.pathParsing(result);
if(!result.contains("0"))
newCoreException(Messages.getString("ProfileLaunch.FAIL_TO_INSTALL"),
new Exception("command is " + command));
// remount file system
command = "mount -o remount,ro /" + CMD_RESULT_CHECK;
result = session.run(command, null);
+ result = PathParser.pathParsing(result);
} catch (CoreException e) {
throw e;
} catch (Exception e) {