Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2012-06-19 16:05:18 -0400
committerRoland Grunberg2012-06-19 17:05:31 -0400
commit7e335719147d2e05793048bdb281ef27a6c5412e (patch)
treec89977459c124eb6e7e1aa5b6d9554f5eba45d18 /profiling/org.eclipse.linuxtools.profiling.snapshot
parent2d56f9b07a4e79da8b3e9a1d464c0a523259c7d6 (diff)
downloadorg.eclipse.linuxtools-7e335719147d2e05793048bdb281ef27a6c5412e.tar.gz
org.eclipse.linuxtools-7e335719147d2e05793048bdb281ef27a6c5412e.tar.xz
org.eclipse.linuxtools-7e335719147d2e05793048bdb281ef27a6c5412e.zip
Initial contribution of Profiling Unification work.
org.eclipse.linuxtools.profiling.launch.launchProvider is an extension point created to provide launch shortcuts for various profiling types, all of which must extend ProfileLaunchShortcut, and specify a profiling type that they provide. org.eclipse.linuxtools.profiling.snapshot is a plugin (it will be one among a few others) that provides a basic launch shortcut. When launched, it will find a launch shortcut provided by the launchProvider extension point which has a type it supports, and launch it.
Diffstat (limited to 'profiling/org.eclipse.linuxtools.profiling.snapshot')
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/.classpath7
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/.project28
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/META-INF/MANIFEST.MF14
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/build.properties5
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/plugin.xml55
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/Activator.java61
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/launch/SnapshotLaunchShortcut.java27
8 files changed, 205 insertions, 0 deletions
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/.classpath b/profiling/org.eclipse.linuxtools.profiling.snapshot/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/.project b/profiling/org.eclipse.linuxtools.profiling.snapshot/.project
new file mode 100644
index 0000000000..d8547804f9
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.profiling.snapshot</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/.settings/org.eclipse.jdt.core.prefs b/profiling/org.eclipse.linuxtools.profiling.snapshot/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..2ce0206edd
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Jun 19 13:00:08 EDT 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.profiling.snapshot/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..23e8ca25e0
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Snapshot Profiling Plugin
+Bundle-SymbolicName: org.eclipse.linuxtools.profiling.snapshot; singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.profiling.snapshot.Activator
+Bundle-Vendor: Eclipse
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.ui
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.cdt.core.model,
+ org.eclipse.linuxtools.profiling.launch
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/build.properties b/profiling/org.eclipse.linuxtools.profiling.snapshot/build.properties
new file mode 100644
index 0000000000..2b0d95b6b0
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/plugin.xml b/profiling/org.eclipse.linuxtools.profiling.snapshot/plugin.xml
new file mode 100644
index 0000000000..87dfb5a997
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/plugin.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="org.eclipse.linuxtools.profiling.snapshot.launch"
+ name="Profile As Snapshot"
+ point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut
+ class="org.eclipse.linuxtools.profiling.snapshot.launch.SnapshotLaunchShortcut"
+ id="org.eclipse.linuxtools.profiling.snapshot"
+ label="Profile As Snapshot"
+ modes="profile">
+
+ <contextualLaunch>
+ <enablement>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <or>
+ <instanceof
+ value="org.eclipse.cdt.core.model.IBinary">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.cdt.core.model.ICProject">
+ </instanceof>
+ <test
+ property="org.eclipse.cdt.launch.isExecutable">
+ </test>
+ <test
+ property="org.eclipse.cdt.launch.isCProject">
+ </test>
+ <and>
+ <instanceof
+ value="org.eclipse.ui.IFileEditorInput">
+ </instanceof>
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <adapt
+ type="org.eclipse.cdt.core.model.ICElement">
+ </adapt>
+ </adapt>
+ </and>
+ </or>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ </extension>
+
+
+</plugin>
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/Activator.java b/profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/Activator.java
new file mode 100644
index 0000000000..25f67992fd
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/Activator.java
@@ -0,0 +1,61 @@
+package org.eclipse.linuxtools.profiling.snapshot;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.profiling.snapshot"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/launch/SnapshotLaunchShortcut.java b/profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/launch/SnapshotLaunchShortcut.java
new file mode 100644
index 0000000000..108efa5f5f
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.snapshot/src/org/eclipse/linuxtools/profiling/snapshot/launch/SnapshotLaunchShortcut.java
@@ -0,0 +1,27 @@
+package org.eclipse.linuxtools.profiling.snapshot.launch;
+
+import org.eclipse.cdt.core.model.IBinary;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut;
+
+public class SnapshotLaunchShortcut extends ProfileLaunchShortcut {
+
+ @Override
+ public void launch(IBinary bin, String mode) {
+ ProfileLaunchShortcut provider = getProfilingProvider("snapshot");
+ provider.launch(bin, mode);
+ }
+
+ @Override
+ protected ILaunchConfigurationType getLaunchConfigType() {
+ return null;
+ }
+
+ @Override
+ protected void setDefaultProfileAttributes(
+ ILaunchConfigurationWorkingCopy wc) throws CoreException {
+ }
+
+}

Back to the top