Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 141540

Summary: Use JVMTI instead of JVMPI to get event notification
Product: z_Archived Reporter: Navid Mehregani <nmehrega>
Component: TPTPAssignee: Liz Dancy <lizdancy>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P1 CC: asaf.yaffe, guru.nagarajan, jkubasta, paulslau, te, viacheslav.g.rybalov, vss
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
URL: http://eclipse.org/tptp/groups/Architecture/documents/features/hf_141540.html
Whiteboard: closed460
Bug Depends on: 182750    
Bug Blocks:    
Attachments:
Description Flags
Patch for preliminary UI changes
none
Patch for HEAD April 17, 2007
none
Patch for HEAD April 17, 2007
none
Delta TVT test cases
none
Patch for execution of JVMTI probekit (client side)
none
Client side Launch Configuration AutomatedTest Suite
none
Client Side Launch Configuration Verification Hook Class
none
Patch for size limit restriction
none
Dynamic Probekit support patch for JVMTI Runtime component
none
Enable the JVMTI Probe Insertion in new driver none

Description Navid Mehregani CLA 2006-05-12 10:24:15 EDT
Dynamic probekit currently uses the JVMPI agent to get its event notifications.  Since JVMPI will eventually be replaced by JVMTI, a new agent extension has to be provided to make use of JVMTI instead.
Comment 1 Navid Mehregani CLA 2007-01-12 20:07:58 EST
This enhancment must be implemented to make Probekit Java-1.6-ready.
Comment 2 Liz Dancy CLA 2007-03-28 15:27:51 EDT
Adding Vsevolod to the CC list so we can communicate our progress using this enhancement. 

Vsevolod, could you clarify what your status is, specifically what you mean by working on having the agent ready in standalone mode (what does standalone mode refer to in this implementation)? Do you have code that automatically registers itself when the RAC starts similar to the piAgent?
Comment 3 Vsevolod Sandomirskiy CLA 2007-03-28 16:13:11 EDT
This link explains what standalone mode is:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.hyades.probekit.doc.user/topics/t_pk_deploy_sa_linux.htm

(or just search for Using Probekit in stand-alone mode)

The standalone mode in new implementation should start working this week. Communication with Agent Controller is planned for the next week.

Comment 4 Liz Dancy CLA 2007-04-17 11:51:19 EDT
Created attachment 64054 [details]
Patch for preliminary UI changes

I have some UI code ready for committal. I have disabled the new JVMTI profiling type for now but the code involved a refactoring of the JVMPI Probe analysis UI code as well so I would like to get it in so it can be tested sooner. 

Navid, can you review the new structure when you have time and particularly let me know if all of the new Strings are satisfactory (new description etc.) so that I can create the TVT test cases?
Comment 5 Navid Mehregani CLA 2007-04-18 11:07:12 EDT
I get compile errors in org.eclipse.tptp.platform.probekit.launch.internal.config.ProbekitProfilingType when I apply the patch to the plug-ins right out of HEAD.  I apply the patch to the following plug-ins:

org.eclipse.tptp.platform.probekit.launch
org.eclipse.tptp.platform.jvmti.client
org.eclipse.hyades.trace.ui
Comment 6 Liz Dancy CLA 2007-04-18 11:29:09 EDT
Created attachment 64200 [details]
Patch for HEAD April 17, 2007

Please use this current patch. I just tested it on the plugins from HEAD. Be advised that the icon will not show up unless you copy and paste the correct .gif file into the icons folder in the jvmti plugin.
Comment 7 Liz Dancy CLA 2007-04-18 11:32:01 EDT
Created attachment 64202 [details]
Patch for HEAD April 17, 2007
Comment 8 Liz Dancy CLA 2007-04-18 11:36:18 EDT
I left the Edit Options Dialog in this patch for you to review but when I commit the code I will also disable this until the remainder of the enhancement is checked in.
Comment 9 Liz Dancy CLA 2007-04-18 12:10:10 EDT
I left the Edit Options Dialog in this patch for you to review but when I commit the code I will also disable this until the remainder of the enhancement is checked in.
Comment 10 Liz Dancy CLA 2007-04-18 12:13:20 EDT
Created attachment 64210 [details]
Delta TVT test cases

I have attched the Delta TVT test cases. As far as I know, the statistics results view will not require any UI changes, Navid, please comment if otherwise.
Comment 11 Navid Mehregani CLA 2007-04-19 13:47:12 EDT
Liz, I finished reviewing the changes.  Everything looks great, I just have a couple of minor suggestions:

- Please include comments for all the new classes created.  Also if you think there is inadequate commenting for any of the existing code, please feel free to add in your comments.

- Please remove all *commented code* from the classes at the end of your work.
Comment 12 Liz Dancy CLA 2007-04-23 08:35:49 EDT
UI code was checked in to HEAD on 04/20/2007. The remainder of the code will be checked in once it is tested and integrated.
Comment 13 Liz Dancy CLA 2007-04-25 17:16:35 EDT
Created attachment 64938 [details]
Patch for execution of JVMTI probekit (client side)

I have attached the second part of my client code. This handles the flow of control during execution for JVMTI. Navid, could you please review when you have the time?
Comment 14 Liz Dancy CLA 2007-04-26 12:38:55 EDT
Created attachment 65067 [details]
Client side Launch Configuration AutomatedTest Suite
Comment 15 Liz Dancy CLA 2007-04-26 12:39:42 EDT
Created attachment 65068 [details]
Client Side Launch Configuration Verification Hook Class
Comment 16 Liz Dancy CLA 2007-04-26 12:41:13 EDT
I have attached an AGR test suite and verification hook class for the Launch Configuration UI. Navid, please review and commit to org.eclipse.hyades.probekit.tests. A second AGR test suite which tests the full execution is to come.
Comment 17 Navid Mehregani CLA 2007-04-26 14:36:32 EDT
Liz, I don't think it's necessary to review the AGR test cases given your AGR skills.  I feel comfortable with you checking in the test cases.  You should have committer access to the test-results folder.  Let me know if you don't.
Comment 18 Liz Dancy CLA 2007-04-26 14:54:57 EDT
Test Suite and Verification Hook Class have been checked in to HEAD.
Comment 19 Liz Dancy CLA 2007-05-01 12:37:54 EDT
Client side code checked in to HEAD. (Note that because the agent extension is missing the Probe Insertion Analysis Type remains disabled in the Launch Configuration UI).
Comment 20 Liz Dancy CLA 2007-05-01 13:56:27 EDT
Vesevolod, please attach your code as a patch to the defect when ready so we can review and check in.
Comment 21 Liz Dancy CLA 2007-05-01 19:27:26 EDT
Testing has revealed that 182750 is causing a timeOutException in multiple Probe Insertion Profiling attempts. Adding dependency on this defect.
Comment 22 Asaf Yaffe CLA 2007-05-02 06:56:15 EDT
(In reply to comment #21)

As far as I know, the new JVMTI Probekit agent can be launched only in "controlled" mode (e.g., through the Eclipse workbench UI, with the command line: "JPIAgent:server=controlled"). This is not considered to be a "dynamic attach" scenario so I am not sure whether the dependency on Bugzilla 182750 is correct. 

Please clarify how the timeout issues you experience are related to 182750.
Comment 23 Liz Dancy CLA 2007-05-02 09:07:50 EDT
You are correct that it is only started in controlled mode. I was referred to this defect by Guru after explaining a TimeOutException I am getting where the process does not seem to launch after multiple profiles. (Process launch times out before it even gets to the probekit launch pad). Perhaps this is not the right dependency? 
Comment 24 Guru Nagarajan CLA 2007-05-02 11:41:14 EDT
From emails yesterday my understanding was that the VM was not initialized and hence you had an issue in attaching to the Agent. The 182750 is enabling the retries on the connect as to when the agent will be ready for attach. There should be a patch attached shortly that will have the fix for it. 
It is applicable for both the controlled and the attach scenarios
Comment 25 Liz Dancy CLA 2007-05-03 16:28:12 EDT
Created attachment 65838 [details]
Patch for size limit restriction

I am attaching a patch which was necessary after we ran into a size restriction for messages on the agent side. The patch coordinates our solution on the client side by sending each probe's supporting files in its own command. Navid, please review and commit if suitable.
Comment 26 Asaf Yaffe CLA 2007-05-04 08:09:58 EDT
Created attachment 65909 [details]
Dynamic Probekit support patch for JVMTI Runtime component

JVMTI runtime support for Dynamic Probekit. Written by Vsevolod Sandomirskiy (vss@ocsystems.com)
Comment 27 Asaf Yaffe CLA 2007-05-04 08:26:07 EDT
Comment on attachment 65909 [details]
Dynamic Probekit support patch for JVMTI Runtime component

Patch checked in to HEAD
Comment 28 Liz Dancy CLA 2007-05-04 11:36:08 EDT
Created attachment 65934 [details]
Enable the JVMTI Probe Insertion in new driver

This patch removes the temporarily Disabled message and allows the probe insertion profile with JVMTI. It should be checked in so that the test driver for next week will allow testing of this function.
Comment 29 Liz Dancy CLA 2007-05-04 18:34:46 EDT
AGR test suite for client code checked into HEAD.
Comment 30 Liz Dancy CLA 2007-05-07 14:22:53 EDT
Code for both client and agent has been checked in as of Friday. Closing defect.
Comment 31 Paul Slauenwhite CLA 2009-06-30 13:20:57 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.