Sunday, March 11, 2007

Eclipse Profiler Plugin

Was looking for eclipse profile plugin and got this link: http://eclipsecolorer.sourceforge.net/index_profiler.html
Download link is here.

I could not get the plugin working with eclipse-3.2 but I could see the Profiler perspective as described when I tried with eclipse-3.1.

When I tried to run the profiler I got some error like this:
Plug-in unable to load class ru.nlmk.eclipse.profiler was unable to load class
ru.nlmk.eclipse.profiler.launch.ProfilerLaunchConfigurationDelegate.


Check out more discussion on this problem here.

I tried to use the bug fixed plugin for eclipse-3.1, use this link.

After getting this patched version of plugin:
1. Unzip it to eclipse/plugin folder.
2. For windows:
Copy ProfilerDLL.dll to ${JAVA_HOME}/jre/bin folder

For Linux Box:
Get libProfilerDLL.so from native/profiler_linux.tgz and copy it to libProfilerDLL.so in native/profiler_linux.tgz to ${JAVA_HOME}/jre/lib/i386/

[NOTE] I had to recompile a new version of libProfilerDLL.so. Its simple to do. Just set the right path for your java installation in the shell script m [you get it after untaring native/profiler_linux.tgz], execute it (you will need right permission to copy the shared library)

Shell script m (used to recompile and copy libProfilerDLL.so)
#!/bin/sh
export JAVA_HOME=/usr/java/j2sdk1.4.2_06

g++ -O0 -DLINUX -shared -Wall -I. -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux ProfilerDLL.cpp -o libProfilerDLL.so
cp libProfilerDLL.so ${JAVA_HOME}/jre/lib/i386/libProfilerDLL.so

Enjoy Profiling!

Comments:
hi there, I also stumbled upon this profiler which looked promising, however I have trouble installing it on my ubuntu box. I have eclipse 3.2, tried with both the patched and the nonpatched versions of the plugin, for both I compiled the .so but I get an error when I want to create an instance of the profiler in the run menu. Yes I see all the new perspectives but I cannot use them, here is the error:

java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/debug/ui/launcher/JavaLaunchConfigurationTab
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:498)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:468)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:427)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:334)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:386)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at ru.nlmk.eclipse.plugins.profiler.launch.ProfilerTabGroup.createTabs(ProfilerTabGroup.java:19)
at org.eclipse.debug.internal.ui.launchConfigurations.CreateLaunchConfigurationAction.performAction(CreateLaunchConfigurationAction.java:70)
at org.eclipse.debug.internal.ui.launchConfigurations.AbstractLaunchConfigurationAction$1.run(AbstractLaunchConfigurationAction.java:103)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.debug.internal.ui.launchConfigurations.AbstractLaunchConfigurationAction.run(AbstractLaunchConfigurationAction.java:106)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog$2.run(LaunchConfigurationsDialog.java:526)
at org.eclipse.debug.ui.AbstractDebugView.doubleClick(AbstractDebugView.java:729)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:796)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:794)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1227)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1158)
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:223)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:220)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:281)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3166)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2842)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1086)
at org.eclipse.debug.ui.DebugUITools$1.run(DebugUITools.java:383)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:387)
at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:329)
at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:80)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3166)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2842)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)


Do you think I would have more luck with elcipse 3.1??
Thanks beforehand
 
nevermind my last post, I got it working under eclipse 3.1 :)
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?