-package org.eclipse.linuxtools.oprofile.core;
+package com.samsung.tizen.oprofile.core;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import org.eclipse.linuxtools.oprofile.core.CommonReceiver;
import com.samsung.tizen.common.connection.ConnectionPlugin;
+import com.samsung.tizen.oprofile.core.CommonReceiver;
import com.samsung.tizen.sdblib.IDevice;
import com.samsung.tizen.sdblib.MultiLineReceiver;
import com.samsung.tizen.sdblib.SdbCommandRejectedException;
return path;
}
+ public static SdbShellProcess runApplication(String command){
+ IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
+ SdbShellProcess sdbShellProc = null;
+
+ command = getRealTargetPath(command);
+
+ try {
+ sdbShellProc = device.executeShellCommand(command);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return sdbShellProc;
+ }
+
public static void runShell(String command) {
IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
SdbShellProcess sdbShellProc = null;
package com.samsung.tizen.oprofile.core.processor.checkevent;
+import com.samsung.tizen.oprofile.core.CommandManager;
import com.samsung.tizen.oprofile.core.OprofileCommonConstants;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
public class CheckEventsProcessor {
package com.samsung.tizen.oprofile.core.processor.checkkernel;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
+import com.samsung.tizen.oprofile.core.CommandManager;
import com.samsung.tizen.oprofile.core.OprofileCommonConstants;
public class CheckKernelProcessor {
import java.util.ArrayList;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;
import org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask;
import org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask.MaskInfo;
+import com.samsung.tizen.oprofile.core.CommandManager;
import com.samsung.tizen.oprofile.core.OprofileCommonConstants;
public class EventListProcessor {
package com.samsung.tizen.oprofile.core.processor.eventinfo;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
import org.eclipse.linuxtools.oprofile.core.daemon.OpInfo;
+import com.samsung.tizen.oprofile.core.CommandManager;
+
public class OpInfoProcessor {
private OpInfo info;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
import org.eclipse.linuxtools.oprofile.core.model.OpModelRoot;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import com.samsung.tizen.oprofile.core.CommandManager;
import com.samsung.tizen.oprofile.core.OprofileCommonConstants;
import com.samsung.tizen.oprofile.core.processor.modeldata.handler.OprofileSAXHandler;
import java.util.ArrayList;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
import org.eclipse.linuxtools.oprofile.core.model.OpModelEvent;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSession;
+import com.samsung.tizen.oprofile.core.CommandManager;
import com.samsung.tizen.oprofile.core.OprofileCommonConstants;
import java.util.ArrayList;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
import org.eclipse.linuxtools.oprofile.core.IOpcontrolProvider;
import org.eclipse.linuxtools.oprofile.core.OpcontrolException;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonOptions;
import com.samsung.tizen.common.connection.ConnectionPlugin;
+import com.samsung.tizen.oprofile.core.CommandManager;
import com.samsung.tizen.oprofile.core.OprofileComm;
import com.samsung.tizen.oprofile.core.OprofileCommonConstants;
import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.core.OpxmlException;
import org.eclipse.linuxtools.oprofile.core.opxml.OprofileSAXHandler;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
+import com.samsung.tizen.oprofile.core.CommandManager;
import com.samsung.tizen.oprofile.core.OprofileComm;
/**
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;
import org.eclipse.cdt.debug.core.CDebugUtils;
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;
import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.linuxtools.oprofile.core.CommandManager;
import org.eclipse.linuxtools.oprofile.core.OpcontrolException;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
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 {
-
+
protected static final String MAKE_DIRECTORY_CMD = "mkdir -p ";
protected static final String CHANGE_DIRECTORY_CMD = "cd ";
cmd += " " + arguments;
// remoteShellProcess = session.launch(cmd, null);
+ // CommandManager.runShell(cmd);
+ runApplication(config, launch, cmd);
- CommandManager.runShell(cmd);
postProcedure(config, launch, monitor);
} catch (CoreException e) {
}
}
+ private void runApplication(ILaunchConfiguration config, ILaunch launch,
+ String command) {
+ SdbShellProcess oprofileProc = CommandManager.runApplication(command);
+ IPath exeFile = null;
+ try {
+ exeFile = CDebugUtils.verifyProgramPath(config);
+ DebugPlugin.newProcess(launch, oprofileProc, exeFile.toFile()
+ .getName());
+ BufferedReader br = new BufferedReader(new InputStreamReader(
+ oprofileProc.getInputStream()));
+ while (null != br.readLine()) {
+ }
+ br.close();
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
private void preProcedure(ILaunchConfiguration config, ILaunch launch,
IProgressMonitor monitor, String imagePath) throws CoreException {
// FIXME: this assumes that project names are always the directory names
}
return path;
}
+
+ public static SdbShellProcess runApplication(String command){
+ IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
+ SdbShellProcess sdbShellProc = null;
+
+ command = getRealTargetPath(command);
+
+ try {
+ sdbShellProc = device.executeShellCommand(command);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return sdbShellProc;
+ }
public static String runShell(String command) {
IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
package org.eclipse.linuxtools.valgrind.launch;
+import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
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 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;
public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
-
+
protected static final String MAKE_DIRECTORY_CMD = "mkdir -p ";
protected static final String CHANGE_DIRECTORY_CMD = "cd ";
// is
// this?
// remoteShellProcess = session.launch(fullcommand, null);
- CommandManager.runShell(fullcommand);
+ // CommandManager.runShell(fullcommand);
+ runApplication(config, launch, fullcommand);
monitor.worked(2);
}
}
+ private void runApplication(ILaunchConfiguration config, ILaunch launch,
+ String command) {
+ SdbShellProcess oprofileProc = CommandManager.runApplication(command);
+ IPath exeFile = null;
+ try {
+ exeFile = CDebugUtils.verifyProgramPath(config);
+ DebugPlugin.newProcess(launch, oprofileProc, exeFile.toFile()
+ .getName());
+ BufferedReader br = new BufferedReader(new InputStreamReader(
+ oprofileProc.getInputStream()));
+ while (null != br.readLine()) {
+ }
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
private String[] getValgrindArgumentsArray(ILaunchConfiguration config)
throws IOException, CoreException {
ArrayList<String> opts = new ArrayList<String>();
MassifPlugin.getDefault().setConfig(config);
MassifPlugin.getDefault().setSourceLocator(launch.getSourceLocator());
try {
- // command.getProcess().waitFor();
+ //command.getProcess().waitFor();
// remoteShellProcess.waitFor();
//String ValgrindHostdir = ValgrindUIPlugin.getDefault().getStateLocation().append("Valgrind_XML").toOSString();
String ValgrindHostdir = ValgrindUIPlugin.getDefault().getStateLocation().toOSString();
String targetlog=ValgrindLaunchPlugin.RESULT_DIR +"valgrind.xml";
- String hostlog =ValgrindHostdir + /*File.separator +*/ "valgrind_out.xml";
+ String hostlog =ValgrindHostdir + File.separator + "valgrind_out.xml";
//--bery sftp dowonload
File file = new File(hostlog);
if(file.exists()){