[rfe][patch] Allow 3rd party launch configuration types

Questions about YourKit Java Profiler
Post Reply
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

[rfe][patch] Allow 3rd party launch configuration types

Post by Andrei.L »

Hi,
Great tool, but I'm facing the issue that I cannot profile "custom" launch configurations (which are not known by YourKit Eclipse plugin).
The fix on *my* side would be trivial: I could just add the code below to my plugin and everyone would be happy:

Code: Select all

    <extension
          point="org.eclipse.debug.core.launchDelegates">
             <launchDelegate
                id="com.yourkit.profiler.junitDelegate_EWC_TEST"
                name="Profile EWC JUNit Test"
                delegate="com.yourkit.eclipse34Plugin.YkJUnitPluginLaunchConfigurationDelegate"
                type="com.verigy.itee.env.EWC_TEST_LAUNCH"
                modes="yourkitprofile">
                <modeCombination modes="yourkitprofile"/>
             </launchDelegate>

             <launchDelegate
                id="com.yourkit.profiler.junitDelegate_EWC"
                name="Profile EWC"
                delegate="com.yourkit.eclipse34Plugin.YkWorkbenchLaunchConfigurationDelegate"
                type="com.verigy.itee.env.EWC_LAUNCH"
                modes="yourkitprofile">
                <modeCombination modes="yourkitprofile"/>
             </launchDelegate>
    </extension>
BUT...

The package com.yourkit.eclipse34Plugin is not exported by Yourkit plugin.

Adding one single line

Code: Select all

 
Export-Package: com.yourkit.eclipse34Plugin
to the MANIFEST.MF of the yourkit plugin would greatly help every tool developer providing it's own launch configuration types.

Could you please do this?
Regards,
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Anton Katilin »

Hi Andrey

Thank you for the suggestion. We'll try to add the export line in the next build.

Did you test a local patched copy of YourKit plugin to ensure this single change is enough?

Best regards,
Anton
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Andrei.L »

Yes.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Anton Katilin »

We'll add it in the next build 14114.
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Andrei.L »

Actually there is one more issue with the launch contributed by YourKit:
now after the fix I can see my launch configuration is supported, I see that the YourKit does *not* initializes my original launchConfigurationTabGroup and so I have to implement an ugly workaround by contribution a dummy tab to the group.

This initialization is important because launchConfigurationTabGroup allows you to perform some default launch configuration initialization *before* the tabs are created (ILaunchConfigurationTabGroup.setDefaults(ILaunchConfigurationWorkingCopy configuration)).

My workaround is to contribute an extra dummy tab via org.eclipse.debug.ui.launchConfigurationTabs extension point and run the initialization in ILaunchConfigurationTab.setDefaults(ILaunchConfigurationWorkingCopy configuration), without any guarantee about the initialization order. Additionally users see one extra dummy tab with no content... But at least this works.

It would be nice if you could properly initialize contributed launchConfigurationTabGroup's in your com.yourkit.eclipse34Plugin.YkWorkbenchTabGroup and com.yourkit.eclipse34Plugin.YkJUnitPluginTabGroup.

You can check the good example how jacoco does this: https://github.com/jacoco/eclemma/blob/ ... Group.java

Thanks to the clever jacoco solution I had no issues with integrating coverage launch configurations in my custom launch config.

Regards,
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Anton Katilin »

Hi Andrey

Thank you for the suggestion. We'll look at the suggested code.

Meanwhile, just a thought: what about explicitly adding the YourKit configuration tab to your custom tab set? Your plugin already has dependencies on YourKit stuff, so adding another one should not be a problem. You could use the public constructor com.yourkit.eclipse34Plugin.YkTab.YkTab(), perhaps via reflection to make the dependency "weak". The mentioned YourKit tab groups do the same: take original tab array and create a new one with the "new YkTab()" result inserted.

Best regards,
Anton
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Andrei.L »

I could try to do so later. For now I'm happy with my ugly workaround (yea it works finally!), and I have no compile time dependency to yourkit classes (everything is xml based).
Thanks again.
Regards,
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Anton Katilin »

Hi Andrey

We've published the build 14114. The Eclipse plugin manifest now includes "Export-Package: com.yourkit.eclipse34Plugin" as requested.

Best regards,
Anton
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Andrei.L »

Thanks Anton. Any news on the proposed tabgroup implementation change?
CU
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Anton Katilin »

This change is big and potentially dangerous, and the issue it covers is not critical, so we will not make it in the released version 2014. Instead, we have plans to try this suggested approach in the next version. We'll open early access program (EAP) soon.
Andrei.L
Posts: 35
Joined: Thu Mar 12, 2009 5:23 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Andrei.L »

Thanks, fully agree & understand.
Have a nice day!
Andrey
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: [rfe][patch] Allow 3rd party launch configuration types

Post by Anton Katilin »

Hi Andrey

Tab group implementation has been reworked in build 15022:

http://www.yourkit.com/eap

Best regards,
Anton
Post Reply