Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2011-02-28 14:49:54 -0500
committerAndrew Overholt2011-02-28 14:50:11 -0500
commitbc592c2f83c27ad642b401965ad6bbdfa3595cb5 (patch)
tree7e5c04dd87c0c8be2d259674a6d5d3858a66a014
parent01c109ec0a9d75f49d91496fc98ad82cfe06b8e4 (diff)
parent8104cac2f792c510744e6db3e6e5b36a4dcae9a9 (diff)
downloadorg.eclipse.linuxtools-bc592c2f83c27ad642b401965ad6bbdfa3595cb5.tar.gz
org.eclipse.linuxtools-bc592c2f83c27ad642b401965ad6bbdfa3595cb5.tar.xz
org.eclipse.linuxtools-bc592c2f83c27ad642b401965ad6bbdfa3595cb5.zip
Merge oprofile 0.5.1
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/BUILD_INFO.txt11
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/build.properties6
-rwxr-xr-xoprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/os/linux/ppc/opxmlbin2746066 -> 0 bytes
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/BUILD_INFO.txt11
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/build.properties4
-rwxr-xr-xoprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/os/linux/x86/opxmlbin2575998 -> 0 bytes
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/BUILD_INFO.txt11
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/build.properties4
-rwxr-xr-xoprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/os/linux/x86_64/opxmlbin2803111 -> 0 bytes
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core/ChangeLog10
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/IOpcontrolProvider.java2
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java31
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/oprofile.properties4
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java31
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileLaunchConfigurationDelegate.java8
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileManualLaunchConfigurationDelegate.java5
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/META-INF/MANIFEST.MF3
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelSymbol.java4
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/view/OprofileViewDoubleClickListener.java124
19 files changed, 163 insertions, 106 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/BUILD_INFO.txt b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/BUILD_INFO.txt
deleted file mode 100644
index 40e34aab30..0000000000
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/BUILD_INFO.txt
+++ /dev/null
@@ -1,11 +0,0 @@
- Native Build Info:
-------------------
-
-platform: ppc64 linux
-built by: ksebasti@redhat.com
-build date: 04-Jun-2009
-OS Name: Fedora 10 PPC
-OS Version: Linux 2.6.27.5-117.fc10.ppc64 (glibc-2.9-2)
-Compiler version: g++ v4.3.2
-
-Makefile used to build is in the org.eclipse.linuxtools.oprofile.core/natives/linux/opxml directory.
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/build.properties b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/build.properties
index adfb8055a5..5920d6e869 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/build.properties
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/build.properties
@@ -5,10 +5,8 @@ bin.includes = META-INF/,\
fragment.xml,\
os/,\
fragment.properties,\
- about.html,\
- BUILD_INFO.txt
-src.includes = BUILD_INFO.txt,\
- META-INF/,\
+ about.html
+src.includes = META-INF/,\
about.html,\
fragment.properties,\
fragment.xml,\
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/os/linux/ppc/opxml b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/os/linux/ppc/opxml
deleted file mode 100755
index d29659c627..0000000000
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.ppc/os/linux/ppc/opxml
+++ /dev/null
Binary files differ
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/BUILD_INFO.txt b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/BUILD_INFO.txt
deleted file mode 100644
index eae017cec4..0000000000
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/BUILD_INFO.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Native Build Info:
-------------------
-
-platform: x86 linux
-built by: ksebasti@redhat.com
-build date: 04-Jun-2009
-OS Name: Fedora 10 x86
-OS Version: Linux 2.6.27.5-117.fc10.i686 (glibc-2.9-2)
-Compiler version: g++ v4.3.2
-
-Makefile used to build is in the org.eclipse.linuxtools.oprofile.core/natives/linux/opxml directory.
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/build.properties b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/build.properties
index b6070b9315..863422d3d0 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/build.properties
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/build.properties
@@ -4,11 +4,9 @@ bin.includes = META-INF/,\
.,\
fragment.xml,\
about.html,\
- BUILD_INFO.txt,\
fragment.properties,\
os/
-src.includes = BUILD_INFO.txt,\
- about.html,\
+src.includes = about.html,\
META-INF/,\
fragment.xml,\
fragment.properties,\
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/os/linux/x86/opxml b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/os/linux/x86/opxml
deleted file mode 100755
index 7194fdc237..0000000000
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86/os/linux/x86/opxml
+++ /dev/null
Binary files differ
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/BUILD_INFO.txt b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/BUILD_INFO.txt
deleted file mode 100644
index 99d8e7d352..0000000000
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/BUILD_INFO.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Native Build Info:
-------------------
-
-platform: x86_64 linux
-built by: ksebasti@redhat.com
-build date: 04-Jun-2009
-OS Name: Fedora 10 x86_64
-OS Version: Linux 2.6.27.15-170.2.24.fc10.x86_64 (glibc-2.9-3)
-Compiler version: g++ v4.3.2
-
-Makefile used to build is in the org.eclipse.linuxtools.oprofile.core/natives/linux/opxml directory.
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/build.properties b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/build.properties
index 3dd8c38e8f..e392e8adb7 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/build.properties
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/build.properties
@@ -3,12 +3,10 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
fragment.xml,\
- BUILD_INFO.txt,\
about.html,\
fragment.properties,\
os/
-src.includes = BUILD_INFO.txt,\
- META-INF/,\
+src.includes = META-INF/,\
about.html,\
fragment.properties,\
fragment.xml,\
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/os/linux/x86_64/opxml b/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/os/linux/x86_64/opxml
deleted file mode 100755
index 82fd44cfc1..0000000000
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.linux.x86_64/os/linux/x86_64/opxml
+++ /dev/null
Binary files differ
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core/ChangeLog b/oprofile/org.eclipse.linuxtools.oprofile.core/ChangeLog
index 13f1e3b673..96f1804a1e 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core/ChangeLog
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core/ChangeLog
@@ -1,3 +1,13 @@
+2010-05-07 Andrew Overholt <overholt@redhat.com>
+
+ * src/org/eclipse/linuxtools/oprofile/core/oprofile.properties: Fix typo
+ with \find instead of \nfind.
+
+2010-05-05 Andrew Overholt <overholt@redhat.com>
+
+ * src/org/eclipse/linuxtools/oprofile/core/oprofile.properties: Clean up
+ build/install instructions.
+
2009-12-07 Andrew Overholt <overholt@redhat.com>
Bug #297007
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/IOpcontrolProvider.java b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/IOpcontrolProvider.java
index 63d8dbefb9..d381b39ec7 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/IOpcontrolProvider.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/IOpcontrolProvider.java
@@ -80,4 +80,6 @@ public interface IOpcontrolProvider {
* @throws OpcontrolException
*/
public void saveSession(String name) throws OpcontrolException;
+
+ public boolean status() throws OpcontrolException;
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java
index d488a07ef0..72cc489dab 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/linux/LinuxOpcontrolProvider.java
@@ -40,6 +40,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider {
// Setup daemon collection arguments
private static final String _OPD_SETUP = "--setup"; //$NON-NLS-1$
+ private static final String _OPD_HELP = "--help"; //$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$
@@ -200,17 +201,30 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider {
public void stopCollection() throws OpcontrolException {
_runOpcontrol(_OPD_STOP_COLLECTION);
}
+
+ /**
+ * Check status. returns true if any status was returned
+ * @throws OpcontrolException
+ */
+ public boolean status() throws OpcontrolException {
+ return _runOpcontrol(_OPD_HELP);
+ }
// Convenience function
- private void _runOpcontrol(String cmd) throws OpcontrolException {
+ private boolean _runOpcontrol(String cmd) throws OpcontrolException {
ArrayList<String> list = new ArrayList<String>();
list.add(cmd);
- _runOpcontrol(list);
+ return _runOpcontrol(list);
}
// Will add opcontrol program to beginning of args
// args: list of opcontrol arguments (not including opcontrol program itself)
- private void _runOpcontrol(ArrayList<String> args) throws OpcontrolException {
+ /**
+ * @return true if any output was produced on the error stream. Unfortunately
+ * this appears to currently be the only way we can tell if user correctly
+ * entered the password
+ */
+ private boolean _runOpcontrol(ArrayList<String> args) throws OpcontrolException {
args.add(0, OPCONTROL_PROGRAM);
// Verbosity hack. If --start or --start-daemon, add verbosity, if set
String cmd = (String) args.get(1);
@@ -234,10 +248,10 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider {
}
if (p != null) {
- BufferedReader stdout = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+ BufferedReader errout = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String output = "", s; //$NON-NLS-1$
try {
- while ((s = stdout.readLine()) != null) {
+ while ((s = errout.readLine()) != null) {
output += s;
}
@@ -246,12 +260,18 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider {
System.out.println(output);
throw new OpcontrolException(OprofileCorePlugin.createErrorStatus("opcontrolNonZeroExitCode", null)); //$NON-NLS-1$
}
+
+ if (output.length() != 0) {
+ return true;
+ }
+
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
+ return false;
}
private static String _findOpcontrol() throws OpcontrolException {
@@ -319,4 +339,5 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider {
//callgraph depth
args.add(_OPD_CALLGRAPH_DEPTH + options.getCallgraphDepth());
}
+
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/oprofile.properties b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/oprofile.properties
index 6b5ac16264..a9ef98b6f7 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/oprofile.properties
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/oprofile/core/oprofile.properties
@@ -20,7 +20,7 @@ oprofileInit.error.dialog.message=FATAL: The OProfile kernel module could not be
opcontrolRun.error.statusMessage=Error during run of opcontrol
opcontrolNonZeroExitCode.error.statusMessage=Exit code of opcontrol indicates failure
-opcontrolProvider.error.statusMessage=Could not find an OpcontrolProvider, or no opcontrol binary exists.\n\nPlease ensure you have run the install script as the root user. The install script will be in the org.eclipse.linuxtools.oprofile.core plugin, which may be located in one of a few places. You can locate it with the following command (type in a terminal):\n\nfind ~/.eclipse -name 'org.eclipse.linuxtools.oprofile.core_*'\n\nIf that doesn't return results, try looking for it in your Eclipse installation:\n\nfind <location from which you're running eclipse> -name 'org.eclipse.linuxtools.oprofile.core_*'\n\nWhen you have found the location of the plugin, change to the following directory and run, as root, the install script contained therein:\n\ncd <path to org.eclipse.linuxtools.oprofile.core>/natives/linux/scripts\nsh install.sh\n\nYou may need to set the script as executable before running this command; do this with:\n\nchmod u+x install.sh
+opcontrolProvider.error.statusMessage=Could not find an OpcontrolProvider, or no opcontrol binary exists.\n\nPlease ensure you have run the install script as the root user. The install script will be in the org.eclipse.linuxtools.oprofile.core plugin, which may be located in one of a few places. You can locate it with the following command (type in a terminal):\n\nfind <~/.eclipse OR the location from which you're running eclipse> \\n-name 'org.eclipse.linuxtools.oprofile.core_*'\n\nWhen you have found the location of the plugin, change to the following directory and build the native component:\n\ncd <path to org.eclipse.linuxtools.oprofile.core>/natives/linux/opxml\nmake\nmake install\n\nFinally, as root, run the install script contained therein:\n\ncd <path to org.eclipse.linuxtools.oprofile.core>/natives/linux/scripts\nsh install.sh\n\nYou may need to set the script as executable before running this command; do this with:\n\nchmod u+x install.sh
opcontrolProvider.error.dialog.title=Error running opcontrol
opcontrolProvider.error.dialog.message=FATAL: An error occurred running opcontrol.
@@ -29,7 +29,7 @@ opxmlParse.error.statusMessage=An unexpected error occurred with parsing opxml's
opxmlParse.error.dialog.title=Error with opxml
opxmlParse.error.dialog.message=An error occurred with opxml.
-opxmlIOException.error.statusMessage=The opxml binary can not be read or executed. Either your user does not have sufficient permissions, or the install script was not run.\n\nPlease ensure you have run the install script as the root user. The install script will be in the org.eclipse.linuxtools.oprofile.core plugin, which may be located in one of a few places. You can locate it with the following command (type in a terminal):\n\nfind ~/.eclipse -name 'org.eclipse.linuxtools.oprofile.core_*'\n\nIf that doesn't return results, try looking for it in your Eclipse installation:\n\nfind <location from which you're running eclipse> -name 'org.eclipse.linuxtools.oprofile.core_*'\n\nWhen you have found the location of the plugin, change to the following directory and run, as root, the install script contained therein:\n\ncd <path to org.eclipse.linuxtools.oprofile.core>/natives/linux/scripts\nsh install.sh\n\nYou may need to set the script as executable before running this command; do this with:\n\nchmod u+x install.sh
+opxmlIOException.error.statusMessage=The opxml binary can not be read or executed. Either your user does not have sufficient permissions, or the install script was not run.\n\nPlease ensure you have run the install script as the root user. The install script will be in the org.eclipse.linuxtools.oprofile.core plugin, which may be located in one of a few places. You can locate it with the following command (type in a terminal):\n\nfind <~/.eclipse OR the location from which you're running eclipse> -name 'org.eclipse.linuxtools.oprofile.core_*'\n\nWhen you have found the location of the plugin, change to the following directory and build the native component:\n\ncd <path to org.eclipse.linuxtools.oprofile.core>/natives/linux/opxml\nmake\nmake install\n\nFinally, as root, run the install script contained therein:\n\ncd <path to org.eclipse.linuxtools.oprofile.core>/natives/linux/scripts\nsh install.sh\n\nYou may need to set the script as executable before running this command; do this with:\n\nchmod u+x install.sh
opxmlIOException.error.dialog.title=Error with opxml
opxmlIOException.error.dialog.message=FATAL: An error occurred with opxml.
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
index a1236bd278..319551a75a 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
@@ -23,11 +23,9 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
import org.eclipse.cdt.utils.pty.PTY;
import org.eclipse.cdt.utils.spawner.ProcessFactory;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -45,18 +43,11 @@ import org.eclipse.ui.PlatformUI;
public abstract class AbstractOprofileLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- //FIXME: this assumes that project names are always the directory names in the workspace.
- //this assumption may be wrong, but a shallow lookup seems ok
- String workspacePath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
- String imagePath = workspacePath
- + Path.SEPARATOR
- + config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "") //$NON-NLS-1$
- + Path.SEPARATOR
- + config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$
-
+
LaunchOptions options = new LaunchOptions(); //default options created in the constructor
options.loadConfiguration(config);
- options.setBinaryImage(imagePath);
+ IPath exePath = verifyProgramPath( config );
+ options.setBinaryImage(exePath.toOSString());
//if daemonEvents null or zero size, the default event will be used
OprofileDaemonEvent[] daemonEvents = null;
@@ -74,7 +65,7 @@ public abstract class AbstractOprofileLaunchConfigurationDelegate extends Abstra
events.toArray(daemonEvents);
}
- preExec(options, daemonEvents);
+ if (!preExec(options, daemonEvents)) return;
/*
* this code written by QNX Software Systems and others and was
@@ -82,7 +73,6 @@ public abstract class AbstractOprofileLaunchConfigurationDelegate extends Abstra
*/
//set up and launch the local c/c++ program
try {
- IPath exePath = verifyProgramPath( config );
File wd = getWorkingDirectory( config );
if ( wd == null ) {
wd = new File( System.getProperty( "user.home", "." ) ); //$NON-NLS-1$ //$NON-NLS-2$
@@ -103,7 +93,7 @@ public abstract class AbstractOprofileLaunchConfigurationDelegate extends Abstra
}
}
- protected abstract void preExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents);
+ protected abstract boolean preExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents);
protected abstract void postExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents, ILaunch launch, Process process);
@@ -185,4 +175,15 @@ public abstract class AbstractOprofileLaunchConfigurationDelegate extends Abstra
protected void oprofileDumpSamples() throws OpcontrolException {
OprofileCorePlugin.getDefault().getOpcontrolProvider().dumpSamples();
}
+
+ /**
+ * Runs opcontrol --help. Returns true if there was any output, false
+ * otherwise. Return value can be used to tell if the user successfully
+ * entered a password.
+ * @return true if opcontrol --help was run correctly. False otherwise
+ * @throws OpcontrolException
+ */
+ protected boolean oprofileStatus() throws OpcontrolException {
+ return OprofileCorePlugin.getDefault().getOpcontrolProvider().status();
+ }
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileLaunchConfigurationDelegate.java b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileLaunchConfigurationDelegate.java
index 0894a5afab..dc0994b970 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileLaunchConfigurationDelegate.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileLaunchConfigurationDelegate.java
@@ -23,9 +23,12 @@ import org.eclipse.swt.widgets.Display;
public class OprofileLaunchConfigurationDelegate extends AbstractOprofileLaunchConfigurationDelegate {
@Override
- protected void preExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents) {
+ protected boolean preExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents) {
//set up and launch the oprofile daemon
try {
+ if (!oprofileStatus())
+ return false;
+
//kill the daemon (it shouldn't be running already, but to be safe)
oprofileShutdown();
@@ -43,8 +46,9 @@ public class OprofileLaunchConfigurationDelegate extends AbstractOprofileLaunchC
oprofileStartCollection();
} catch (OpcontrolException oe) {
OprofileCorePlugin.showErrorDialog("opcontrolProvider", oe); //$NON-NLS-1$
- return;
+ return false;
}
+ return true;
}
@Override
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileManualLaunchConfigurationDelegate.java b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileManualLaunchConfigurationDelegate.java
index b493f0c6d4..8f4cea4790 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileManualLaunchConfigurationDelegate.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/oprofile/launch/launching/OprofileManualLaunchConfigurationDelegate.java
@@ -43,7 +43,7 @@ import org.eclipse.ui.PlatformUI;
public class OprofileManualLaunchConfigurationDelegate extends AbstractOprofileLaunchConfigurationDelegate {
@Override
- protected void preExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents) {
+ protected boolean preExec(LaunchOptions options, OprofileDaemonEvent[] daemonEvents) {
// //set up the oprofile daemon
// try {
// //kill the daemon (it shouldn't be running already, but to be safe)
@@ -60,6 +60,7 @@ public class OprofileManualLaunchConfigurationDelegate extends AbstractOprofileL
// OprofileCorePlugin.showErrorDialog("opcontrolProvider", oe); //$NON-NLS-1$
// return;
// }
+ return true;
}
@Override
@@ -72,6 +73,8 @@ public class OprofileManualLaunchConfigurationDelegate extends AbstractOprofileL
//TODO: have a initialization dialog to do reset and setupDaemon?
// using a progress dialog, can't abort the launch if there's an exception..
try {
+ if (!oprofileStatus())
+ return;
oprofileReset();
oprofileSetupDaemon(fOptions.getOprofileDaemonOptions(), fDaemonEvents);
} catch (OpcontrolException oe) {
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/META-INF/MANIFEST.MF b/oprofile/org.eclipse.linuxtools.oprofile.ui/META-INF/MANIFEST.MF
index 8cb26ef1a7..cbb5164bef 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/META-INF/MANIFEST.MF
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/META-INF/MANIFEST.MF
@@ -24,7 +24,8 @@ Export-Package: org.eclipse.linuxtools.oprofile.ui;
org.eclipse.swt.widgets",
org.eclipse.linuxtools.oprofile.ui.model,
org.eclipse.linuxtools.oprofile.ui.view
-Import-Package: org.eclipse.core.resources,
+Import-Package: org.eclipse.cdt.core.model,
+ org.eclipse.core.resources,
org.eclipse.jface.text,
org.eclipse.jface.text.source,
org.eclipse.linuxtools.oprofile.core,
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelSymbol.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelSymbol.java
index eadbc03d53..a4dae3bfbe 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelSymbol.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelSymbol.java
@@ -68,6 +68,10 @@ public class UiModelSymbol implements IUiModelElement {
public String getFileName() {
return _symbol.getFile();
}
+
+ public String getFunctionName(){
+ return _symbol.getName();
+ }
/** IUiModelElement functions **/
public String getLabelText() {
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/view/OprofileViewDoubleClickListener.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/view/OprofileViewDoubleClickListener.java
index ec6a1dbbc5..27eb76a843 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/view/OprofileViewDoubleClickListener.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/view/OprofileViewDoubleClickListener.java
@@ -10,6 +10,10 @@
*******************************************************************************/
package org.eclipse.linuxtools.oprofile.ui.view;
+import java.util.HashMap;
+
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -37,48 +41,94 @@ import org.eclipse.ui.PartInitException;
*/
public class OprofileViewDoubleClickListener implements IDoubleClickListener {
public void doubleClick(DoubleClickEvent event) {
- IUiModelElement element = (IUiModelElement)((TreeSelection)((TreeViewer)event.getSource()).getSelection()).getFirstElement();;
+ TreeViewer tv = (TreeViewer) event.getSource();
+ TreeSelection tsl = (TreeSelection) tv.getSelection();
+ IUiModelElement element = (IUiModelElement) tsl.getFirstElement();
+ ICProject project;
- if (element instanceof UiModelEvent) {
-// UiModelEvent event = (UiModelEvent)element;
+ try {
+ if (element instanceof UiModelEvent) {
+ // UiModelEvent event = (UiModelEvent)element;
- } else if (element instanceof UiModelSession) {
- /* moved into an action menu */
- } else if (element instanceof UiModelImage) {
-// UiModelImage image = (UiModelImage)element;
-
- } else if (element instanceof UiModelSymbol) {
- /* disable this.. for binary section such as .plt,
- * this will open the binary in an editor = bad */
+ } else if (element instanceof UiModelSession) {
+ /* moved into an action menu */
+ } else if (element instanceof UiModelImage) {
+ // UiModelImage image = (UiModelImage)element;
+
+ } else if (element instanceof UiModelSymbol) {
+ final UiModelSymbol symbol = (UiModelSymbol) element;
+ final String imageLabel = symbol.getParent().getLabelText();
+ final String fileName = symbol.getFileName();
+ String functionName = symbol.getFunctionName();
+ int numOfArgs = -1;
+ HashMap<String, int[]> map;
+
+ // hard coded to match "XY.PQ% in /some/arbitrary/path/to/binary"
+ String absPath = imageLabel.substring(imageLabel.indexOf(" in ") + 4);
+ project = ProfileUIUtils.findCProjectWithAbsolutePath(absPath);
+ if (project == null) {
+ return;
+ }
+
+ // detect function with arguments and narrow search accordingly
+ if (functionName.matches(".*\\(.*\\)")) {
+ int start = functionName.indexOf('(');
+ if (functionName.contains(",")) {
+ int end = functionName.indexOf(')');
+ numOfArgs = functionName.substring(start, end).split(",").length;
+ } else {
+ numOfArgs = 1;
+ }
+ functionName = functionName.substring(0, start);
+ }else{
+ numOfArgs = 0;
+ }
- //jump to 1st line in the file
-// UiModelSymbol symbol = (UiModelSymbol)element;
-// String fileName = symbol.getFileName();
-//
-// if (fileName.length() > 0) {
-// try {
-// ProfileUIUtils.openEditorAndSelect(fileName, 1);
-// } catch (PartInitException e) {
-// e.printStackTrace();
-// } catch (BadLocationException e) {
-// e.printStackTrace();
-// }
-// }
- } else if (element instanceof UiModelSample) {
- //jump to line number in the appropriate file
- UiModelSample sample = (UiModelSample)element;
- int line = sample.getLine();
-
- //get file name from the parent sample
- String fileName = ((UiModelSymbol)sample.getParent()).getFileName();
-
- try {
+ if (fileName.length() > 0 && functionName.length() > 0) {
+ // this should almost ALWAYS be the case
+ // try and go to the function in the file
+ map = ProfileUIUtils.findFunctionsInProject(project,functionName, numOfArgs, fileName, true);
+
+ // if function still can't be found, go to first line in the file
+ if (map.isEmpty()) {
+ ProfileUIUtils.openEditorAndSelect(fileName, 1);
+ } else {
+ for (String loc : map.keySet()) {
+ ProfileUIUtils.openEditorAndSelect(loc, map.get(loc)[0], map.get(loc)[1]);
+ }
+ }
+
+ } else if (functionName.length() > 0) {
+ // can this ever happen ?
+ // try to find the file name that has this function
+ map = ProfileUIUtils.findFunctionsInProject(project, functionName, numOfArgs, null, true);
+
+ for (String loc : map.keySet()) {
+ ProfileUIUtils.openEditorAndSelect(loc, map.get(loc)[0], map.get(loc)[1]);
+ }
+ } else if (fileName.length() > 0) {
+ // can this ever happen ?
+ // jump to 1st line in the file
+ ProfileUIUtils.openEditorAndSelect(fileName, 1);
+ }
+
+ } else if (element instanceof UiModelSample) {
+ // jump to line number in the appropriate file
+ UiModelSample sample = (UiModelSample) element;
+ int line = sample.getLine();
+
+ // get file name from the parent sample
+ final UiModelSymbol symbol = ((UiModelSymbol) sample.getParent());
+ final String fileName = symbol.getFileName();
ProfileUIUtils.openEditorAndSelect(fileName, line);
- } catch (PartInitException e) {
- e.printStackTrace();
- } catch (BadLocationException e) {
- e.printStackTrace();
}
+ } catch (BadLocationException e1) {
+ e1.printStackTrace();
+ } catch (PartInitException e2) {
+ e2.printStackTrace();
+ } catch (CoreException e3) {
+ e3.printStackTrace();
}
}
+
}

Back to the top