From harmony-dev-return-11224-apmail-incubator-harmony-dev-archive=incubator.apache.org@incubator.apache.org Tue Aug 01 07:46:33 2006 Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 25532 invoked from network); 1 Aug 2006 07:46:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 07:46:33 -0000 Received: (qmail 34883 invoked by uid 500); 1 Aug 2006 07:46:30 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 34501 invoked by uid 500); 1 Aug 2006 07:46:29 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 34490 invoked by uid 99); 1 Aug 2006 07:46:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 00:46:28 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 202.81.18.152 is neither permitted nor denied by domain of firepure@gmail.com) Received: from [202.81.18.152] (HELO ausmtp04.au.ibm.com) (202.81.18.152) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 00:46:26 -0700 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp04.au.ibm.com (8.13.6/8.13.5) with ESMTP id k717q6pU272194 for ; Tue, 1 Aug 2006 17:52:06 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0208e0.au.ibm.com (8.13.6/8.13.6/NCO v8.1) with ESMTP id k717nNxA093342 for ; Tue, 1 Aug 2006 17:49:23 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k717jxH8015820 for ; Tue, 1 Aug 2006 17:45:59 +1000 Received: from d23m0011.cn.ibm.com ([9.181.32.74]) by d23av03.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k717jTH4012853 for ; Tue, 1 Aug 2006 17:45:58 +1000 Received: from [9.181.107.166] ([9.181.107.166]) by d23m0011.cn.ibm.com (Lotus Domino Release 6.5.5HF262) with ESMTP id 2006080115345186-12554 ; Tue, 1 Aug 2006 15:34:51 +0800 Message-ID: <44CF041C.4040805@gmail.com> Date: Tue, 01 Aug 2006 15:34:52 +0800 From: "Jimmy, Jing Lv" User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib] Intention to work on java.lang.instrument References: <44CDBF4E.4030600@gmail.com> <44CDCB7B.7080806@gmail.com> <208da7a50607310704i737014bawd0252ae42cce46ea@mail.gmail.com> In-Reply-To: X-MIMETrack: Itemize by SMTP Server on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 01/08/2006 15:34:51, Serialize by Router on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 01/08/2006 15:45:58, Serialize complete at 01/08/2006 15:45:58 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Leo Li wrote: > On 7/31/06, Gregory Shimansky wrote: >> >> 2006/7/31, Jimmy, Jing Lv : >> > >> > > Besides, Harmony VM now has actually support the feature of >> JVMTI >> > > on which we can implement instrument. >> > > >> > >> > Ah, can it work now? It'll be great convenient if so. >> >> >> Hello. The drlvm does support a subset of JVMTI. Class loading events are >> supported, ClassFileLoadHook which may be used for load time class >> instrumentation is supported too. But there is no support for >> RedefineClasses yet if you need to change classes bytecode after the >> class >> was loaded already. >> >> > >> > > After some study on this, I find Java interface classes/interfaces >> > >> are quite easy, but there should be real implement, both in java and >> > >> native. And the native code requires JVMTI[2], which is a part of VM >> 5. >> > >> Though, luckily we can still study and code according to JVMTI and >> test >> > >> on RI. So my goal is : 1.define those simple Java classes/interfaces >> in >> > >> Harmony; 2. work out implementation of java/native code according to >> > >> JVMTI and make it run on RI; 3. wait for Harmony VM5 and then make >> some >> > >> integration modification/test. >> > > >> > > >> > > As the main function of instruments is to add and remove >> > transformers >> > > to some classes, I suggest implement it as an agent of JVMTI. That is >> to >> > > register callback functions, which actually transform the byte stream >> of >> > > some specified classes, to the events that is relevent to instrument >> in >> > > JVMTI including >> > > the class loading. >> > > >> > >> > Yes, that's the way. >> >> >> I agree with this approach. Do you know which API functions and events >> you >> will need for such agent? > Thanks you Gregory :) Refer to JVMTI Functions doc[1], I think functions of Memory Management/Class/Capability is necessary. [1]http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#FunctionIndex > > Hi, we will need VM Initialization Event to run premain functions and Class > File Load Hook Event for agents to instruct the existing class file. As to > the jvmti API, we need RedefineClasses,GetObjectSize and Allocate. Besides, > AddCapabilities is also required to turn on the capability of the VM, such > as can_generate_all_class_hook_events and can_redefine_classes. > That's detail, thanks :) > Since we have just planned to implement this module, please excuse me if I > leave some requirements about it. :) > And for VM guys ,the launcher with parameter "-javaagent":) > > >> -- >> Gregory Shimansky, Intel Middleware Products Division >> >> > > -- Best Regards! Jimmy, Jing Lv China Software Development Lab, IBM --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org