=?gb2312?B?tPC4tDogW1BBVENIXSBBIHNtYWxsIGZpeCBvbiAic2Nhbm9vcHMiIGNvbW1h?= =?gb2312?Q?nd_in_CLHSDB?=

=?gb2312?B?1Ma07w==?= yunda.mly at taobao.com
Thu Feb 21 19:32:27 PST 2013


Staffan & Kris,

Thank both of you for reviewing this. Hope you two could be official Reviewer soon :)

Regards,
Yunda

·¢¼þÈË: Staffan Larsen [mailto:staffan.larsen at oracle.com]
·¢ËÍʱ¼ä: 2013Äê2ÔÂ21ÈÕ 18:21
ÊÕ¼þÈË: Krystal Mo
³­ËÍ: ÔÆ´ï; serviceability-dev at openjdk.java.net
Ö÷Ìâ: Re: [PATCH] A small fix on "scanoops" command in CLHSDB

I think this looks good, too. I'm not an official Reviewer, either.

Thanks,
/Staffan

On 21 feb 2013, at 04:32, Krystal Mo <krystal.mo at oracle.com<mailto:krystal.mo at oracle.com>> wrote:


Hi Yunda,

This patch looks reasonable to me. But you'll need an official Reviewer to review this.

- Kris
On 2013/2/19 1:24, ÔÆ´ï wrote:
Hi all,

When I use ¡°scanoops¡± command in CLHSDB, I find that if the type doesn¡¯t exist, the output will be all the oops in the scope [start, end]. (see below) I think that¡¯s irrational because all the oops between 0x00000000ee2000a0 and 0x00000000ee200550 are of type ¡°java/lang/Class¡± and there¡¯s no type ¡°java/lang/Class2¡± or ¡°com/taobao/Test¡± at all!

hsdb> scanoops 0x00000000ee2000a0 0x00000000ee200550
0x00000000ee2000a0 java/lang/Class
0x00000000ee200118 java/lang/Class
0x00000000ee200190 java/lang/Class
0x00000000ee200208 java/lang/Class
0x00000000ee200280 java/lang/Class
0x00000000ee2002f8 java/lang/Class
0x00000000ee200370 java/lang/Class
0x00000000ee2003e8 java/lang/Class
0x00000000ee200460 java/lang/Class
0x00000000ee2004d8 java/lang/Class
hsdb> scanoops 0x00000000ee2000a0 0x00000000ee200550 java/lang/Class2
0x00000000ee2000a0 java/lang/Class
0x00000000ee200118 java/lang/Class
0x00000000ee200190 java/lang/Class
0x00000000ee200208 java/lang/Class
0x00000000ee200280 java/lang/Class
0x00000000ee2002f8 java/lang/Class
0x00000000ee200370 java/lang/Class
0x00000000ee2003e8 java/lang/Class
0x00000000ee200460 java/lang/Class
0x00000000ee2004d8 java/lang/Class
hsdb> scanoops 0x00000000ee2000a0 0x00000000ee200550 com/taobao/Test
0x00000000ee2000a0 java/lang/Class
0x00000000ee200118 java/lang/Class
0x00000000ee200190 java/lang/Class
0x00000000ee200208 java/lang/Class
0x00000000ee200280 java/lang/Class
0x00000000ee2002f8 java/lang/Class
0x00000000ee200370 java/lang/Class
0x00000000ee2003e8 java/lang/Class
0x00000000ee200460 java/lang/Class
0x00000000ee2004d8 java/lang/Class

I know the reason is that the usage of scanoops is ¡°scanoops start end [ type ]¡± and ¡°type¡± is optional. When you don¡¯t input the ¡°type¡±, the output will be all the oops in the scope [start, end]. But I think the two situations are different and CLHSDB should give right prompt. So I made a small fix:

diff -r b5e3ec9c69fa agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
--- a/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java   Mon Feb 18 12:49:53 2013 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java Tue Feb 19 16:43:45 2013 +0800
@@ -1132,6 +1132,10 @@
                     Klass klass = null;
                     if (t.countTokens() == 1) {
                         klass = SystemDictionaryHelper.findInstanceKlass(t.nextToken());
+                        if(klass == null) {
+                            out.println("No such type.");
+                            return;
+                        }
                     }
                     while (base != null && base.lessThan(end)) {
                         long step = stride;

And the effect will be:
hsdb> scanoops 0x0000000758600000 0x000000075860ffff com/taobao/Test
No such type.

Regards,
Yunda


________________________________

This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.

±¾µçÓÊ(°üÀ¨Èκθ½¼þ)¿ÉÄܺ¬ÓлúÃÜ×ÊÁϲ¢ÊÜ·¨Âɱ£»¤¡£ÈçÄú²»ÊÇÕýÈ·µÄÊÕ¼þÈË£¬ÇëÄúÁ¢¼´É¾³ý±¾Óʼþ¡£Çë²»Òª½«±¾µçÓʽøÐи´ÖƲ¢ÓÃ×÷ÈÎºÎÆä ËûÓÃ;¡¢»ò͸¶±¾ÓʼþÖ®ÄÚÈÝ¡£Ð»Ð»¡£



________________________________

This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.

±¾µçÓÊ(°üÀ¨Èκθ½¼þ)¿ÉÄܺ¬ÓлúÃÜ×ÊÁϲ¢ÊÜ·¨Âɱ£»¤¡£ÈçÄú²»ÊÇÕýÈ·µÄÊÕ¼þÈË£¬ÇëÄúÁ¢¼´É¾³ý±¾Óʼþ¡£Çë²»Òª½«±¾µçÓʽøÐи´ÖƲ¢ÓÃ×÷ÈÎºÎÆäËûÓÃ;¡¢»ò͸¶±¾ÓʼþÖ®ÄÚÈÝ¡£Ð»Ð»¡£
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20130222/a2fe4414/attachment-0001.html 


More information about the serviceability-dev mailing list