przemolicc at poczta.fm
2007-Mar-06 07:49 UTC
[dtrace-discuss] How to get java thread name ?
Hello,
we have application written in java which runs several threads inside.
Each thread is for one network connection and there are sometimes over
hundred connections. The java programmer names the threads in a
meaningful way and to analyze the problem it would be good to get threads names
while dtracing it (I have been already using java probes from
https://solaris10-dtrace-vm-agents.dev.java.net/).
I use the following script:
#!/usr/sbin/dtrace -s
dvm$1:::method-entry
{
self->interested = 1;
self->ts[copyinstr(arg0),copyinstr(arg1),tid] = vtimestamp;
}
dvm$1:::method-return
/ self->interested /
{
@[copyinstr(arg0),copyinstr(arg1),tid] = sum (vtimestamp -
self->ts[copyinstr(arg0),copyinstr(arg1),tid]);
self->ts[copyinstr(arg0),copyinstr(arg1),tid] = 0;
}
END
{
trunc (@,20);
}
And the result is:
bash-3.00# ./j.d 27164
dtrace: script ''./j.d'' matched 3 probes
dtrace: 42 dynamic variable drops with non-empty dirty list
^C
CPU ID FUNCTION:NAME
1 2 :END
java/lang/String lastIndexOf
19 1078463492773
sun/util/calendar/ZoneInfo getOffsets
19 1130972191852
java/lang/Character digit
19 1239610842238
oracle/net/ns/NetInputStream read
8860 1263472696419
oracle/net/ns/NetOutputStream write
8676 1280145980285
oracle/net/ns/NetInputStream read
8862 1332278387655
oracle/net/ns/NetOutputStream write
8838 1393211840081
java/lang/String indexOf
8676 1432855841749
java/lang/String toLowerCase
19 1454642793917
java/util/ResourceBundle getObject
19 1615516712375
java/lang/String indexOf
8857 1759133160592
oracle/net/ns/NetInputStream read
8643 1804391493956
java/lang/String startsWith
19 2049919104064
oracle/net/ns/NetOutputStream write
8643 2146745239147
java/lang/String indexOf
8643 2329573014804
java/lang/Character toUpperCase
19 2597127049629
java/lang/Character toLowerCase
19 3186325206507
oracle/net/ns/NetOutputStream write
19 28720443556415
java/lang/String indexOf
19 48575396710120
oracle/net/ns/NetInputStream read
19 118222538032233
How can I have thread name having tid ? The app and all the threads are already
running so I can''t use thread-start probe.
Regards
przemol
----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
przemolicc at poczta.fm
2007-Mar-08 07:08 UTC
[dtrace-discuss] How to get java thread name ?
Hello again,
is it possible to get thread name having tid ?
Can anybody confirm or deny it ?
Regards
przemol
----- Forwarded message from przemolicc at poczta.fm -----
From: przemolicc at poczta.fm
To: dtrace-discuss at opensolaris.org
Subject: [dtrace-discuss] How to get java thread name ?
Date: Tue, 6 Mar 2007 08:49:47 +0100
Hello,
we have application written in java which runs several threads inside.
Each thread is for one network connection and there are sometimes over
hundred connections. The java programmer names the threads in a
meaningful way and to analyze the problem it would be good to get threads names
while dtracing it (I have been already using java probes from
https://solaris10-dtrace-vm-agents.dev.java.net/).
I use the following script:
#!/usr/sbin/dtrace -s
dvm$1:::method-entry
{
self->interested = 1;
self->ts[copyinstr(arg0),copyinstr(arg1),tid] = vtimestamp;
}
dvm$1:::method-return
/ self->interested /
{
@[copyinstr(arg0),copyinstr(arg1),tid] = sum (vtimestamp -
self->ts[copyinstr(arg0),copyinstr(arg1),tid]);
self->ts[copyinstr(arg0),copyinstr(arg1),tid] = 0;
}
END
{
trunc (@,20);
}
And the result is:
bash-3.00# ./j.d 27164
dtrace: script ''./j.d'' matched 3 probes
dtrace: 42 dynamic variable drops with non-empty dirty list
^C
CPU ID FUNCTION:NAME
1 2 :END
java/lang/String lastIndexOf
19 1078463492773
sun/util/calendar/ZoneInfo getOffsets
19 1130972191852
java/lang/Character digit
19 1239610842238
oracle/net/ns/NetInputStream read
8860 1263472696419
oracle/net/ns/NetOutputStream write
8676 1280145980285
oracle/net/ns/NetInputStream read
8862 1332278387655
oracle/net/ns/NetOutputStream write
8838 1393211840081
java/lang/String indexOf
8676 1432855841749
java/lang/String toLowerCase
19 1454642793917
java/util/ResourceBundle getObject
19 1615516712375
java/lang/String indexOf
8857 1759133160592
oracle/net/ns/NetInputStream read
8643 1804391493956
java/lang/String startsWith
19 2049919104064
oracle/net/ns/NetOutputStream write
8643 2146745239147
java/lang/String indexOf
8643 2329573014804
java/lang/Character toUpperCase
19 2597127049629
java/lang/Character toLowerCase
19 3186325206507
oracle/net/ns/NetOutputStream write
19 28720443556415
java/lang/String indexOf
19 48575396710120
oracle/net/ns/NetInputStream read
19 118222538032233
How can I have thread name having tid ? The app and all the threads are already
running so I can''t use thread-start probe.
Regards
przemol
----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss at opensolaris.org
----- End forwarded message -----
----------------------------------------------------------------------
Oficjalne konto pocztowe europejskich internautow! >>> http://link.interia.pl/f19e8
Try to use dvm:::thread-start probe to associate tid with Java thread name,
something like:
dvm$1:::thread-start
{
threads[tid] = copyinstr(arg0);
}
thread-start probe is fired inside the callback for JVMTI[PI]_EVENT_THREAD_START
event which is
''generated by a new thread before its initial method
executes''.
So, association with tid should work.
-katya
przemolicc at poczta.fm wrote:> Hello again,
>
> is it possible to get thread name having tid ?
> Can anybody confirm or deny it ?
>
> Regards
> przemol
>
> ----- Forwarded message from przemolicc at poczta.fm -----
>
> From: przemolicc at poczta.fm
> To: dtrace-discuss at opensolaris.org
> Subject: [dtrace-discuss] How to get java thread name ?
> Date: Tue, 6 Mar 2007 08:49:47 +0100
>
> Hello,
>
> we have application written in java which runs several threads inside.
> Each thread is for one network connection and there are sometimes over
> hundred connections. The java programmer names the threads in a
> meaningful way and to analyze the problem it would be good to get threads
names
> while dtracing it (I have been already using java probes from
> https://solaris10-dtrace-vm-agents.dev.java.net/).
> I use the following script:
>
> #!/usr/sbin/dtrace -s
>
> dvm$1:::method-entry
> {
> self->interested = 1;
> self->ts[copyinstr(arg0),copyinstr(arg1),tid] = vtimestamp;
> }
>
>
> dvm$1:::method-return
> / self->interested /
> {
> @[copyinstr(arg0),copyinstr(arg1),tid] = sum (vtimestamp -
self->ts[copyinstr(arg0),copyinstr(arg1),tid]);
> self->ts[copyinstr(arg0),copyinstr(arg1),tid] = 0;
> }
>
> END
> {
> trunc (@,20);
> }
>
> And the result is:
>
> bash-3.00# ./j.d 27164
> dtrace: script ''./j.d'' matched 3 probes
> dtrace: 42 dynamic variable drops with non-empty dirty list
> ^C
> CPU ID FUNCTION:NAME
> 1 2 :END
>
> java/lang/String lastIndexOf
19 1078463492773
> sun/util/calendar/ZoneInfo getOffsets
19 1130972191852
> java/lang/Character digit
19 1239610842238
> oracle/net/ns/NetInputStream read
8860 1263472696419
> oracle/net/ns/NetOutputStream write
8676 1280145980285
> oracle/net/ns/NetInputStream read
8862 1332278387655
> oracle/net/ns/NetOutputStream write
8838 1393211840081
> java/lang/String indexOf
8676 1432855841749
> java/lang/String toLowerCase
19 1454642793917
> java/util/ResourceBundle getObject
19 1615516712375
> java/lang/String indexOf
8857 1759133160592
> oracle/net/ns/NetInputStream read
8643 1804391493956
> java/lang/String startsWith
19 2049919104064
> oracle/net/ns/NetOutputStream write
8643 2146745239147
> java/lang/String indexOf
8643 2329573014804
> java/lang/Character toUpperCase
19 2597127049629
> java/lang/Character toLowerCase
19 3186325206507
> oracle/net/ns/NetOutputStream write
19 28720443556415
> java/lang/String indexOf
19 48575396710120
> oracle/net/ns/NetInputStream read
19 118222538032233
>
> How can I have thread name having tid ? The app and all the threads are
already running so I can''t use thread-start probe.
>
> Regards
> przemol
>
>
> ----------------------------------------------------------------------
> Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
>
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org
>
> ----- End forwarded message -----
>
> ----------------------------------------------------------------------
> Oficjalne konto pocztowe europejskich internautow!
>
>>>>http://link.interia.pl/f19e8
>
>
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org
--
Ekaterina Pavlova,
VMSQE Team, St. Petersburg.
http://blogs.sun.com/vmrobot/
http://blogs.sun.com/theaquarium_ru/
przemolicc at poczta.fm
2007-Mar-08 21:53 UTC
[dtrace-discuss] How to get java thread name ?
Helo Ekaterina, as I had written it is difficult to use dvm:::thread-start because the app is already started with almost all thread already started as well. I can of course restart it (and dtrace/watch thread creation) but, in general, it is rare oportunity (especially in production) to restart application. In general it is somehow possible because when I connect jconsole to the application, it (jconsole) shows all threads names. But how to get them by dtrace ? Regards przemol Ekaterina Pavlova napisa?(a):> Try to use dvm:::thread-start probe to associate tid with Java thread name, > something like: > > dvm$1:::thread-start > { > threads[tid] = copyinstr(arg0); > } > > > thread-start probe is fired inside the callback for > JVMTI[PI]_EVENT_THREAD_START event which is > 'generated by a new thread before its initial method executes'. > So, association with tid should work. > > -katya > > przemolicc at poczta.fm wrote: > > Hello again, > > > > is it possible to get thread name having tid ? > > Can anybody confirm or deny it ? > > > > Regards > > przemol > > > > ----- Forwarded message from przemolicc at poczta.fm ----- > > > > From: przemolicc at poczta.fm > > To: dtrace-discuss at opensolaris.org > > Subject: [dtrace-discuss] How to get java thread name ? > > Date: Tue, 6 Mar 2007 08:49:47 +0100 > > > > Hello, > > > > we have application written in java which runs several threads inside. > > Each thread is for one network connection and there are sometimes over > > hundred connections. The java programmer names the threads in a > > meaningful way and to analyze the problem it would be good to get > threads names > > while dtracing it (I have been already using java probes from > > https://solaris10-dtrace-vm-agents.dev.java.net/). > > I use the following script: > > > > #!/usr/sbin/dtrace -s > > > > dvm$1:::method-entry > > { > > self->interested = 1; > > self->ts[copyinstr(arg0),copyinstr(arg1),tid] = vtimestamp; > > } > > > > > > dvm$1:::method-return > > / self->interested / > > { > > @[copyinstr(arg0),copyinstr(arg1),tid] = sum (vtimestamp - > self->ts[copyinstr(arg0),copyinstr(arg1),tid]); > > self->ts[copyinstr(arg0),copyinstr(arg1),tid] = 0; > > } > > > > END > > { > > trunc (@,20); > > } > > > > And the result is: > > > > bash-3.00# ./j.d 27164 > > dtrace: script './j.d' matched 3 probes > > dtrace: 42 dynamic variable drops with non-empty dirty list > > ^C > > CPU ID FUNCTION:NAME > > 1 2 :END > > > > java/lang/String lastIndexOf > 19 1078463492773 > > sun/util/calendar/ZoneInfo getOffsets > 19 1130972191852 > > java/lang/Character digit > 19 1239610842238 > > oracle/net/ns/NetInputStream read > 8860 1263472696419 > > oracle/net/ns/NetOutputStream write > 8676 1280145980285 > > oracle/net/ns/NetInputStream read > 8862 1332278387655 > > oracle/net/ns/NetOutputStream write > 8838 1393211840081 > > java/lang/String indexOf > 8676 1432855841749 > > java/lang/String toLowerCase > 19 1454642793917 > > java/util/ResourceBundle getObject > 19 1615516712375 > > java/lang/String indexOf > 8857 1759133160592 > > oracle/net/ns/NetInputStream read > 8643 1804391493956 > > java/lang/String startsWith > 19 2049919104064 > > oracle/net/ns/NetOutputStream write > 8643 2146745239147 > > java/lang/String indexOf > 8643 2329573014804 > > java/lang/Character toUpperCase > 19 2597127049629 > > java/lang/Character toLowerCase > 19 3186325206507 > > oracle/net/ns/NetOutputStream write > 19 28720443556415 > > java/lang/String indexOf > 19 48575396710120 > > oracle/net/ns/NetInputStream read > 19 118222538032233 > > > > How can I have thread name having tid ? The app and all the threads are > already running so I can't use thread-start probe. > > > > Regards > > przemol > > > > > > ---------------------------------------------------------------------- > > Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e > > > > _______________________________________________ > > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > > > > ----- End forwarded message ----- > > > > ---------------------------------------------------------------------- > > Oficjalne konto pocztowe europejskich internautow! > > > >>>>http://link.interia.pl/f19e8 > > > > > > _______________________________________________ > > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > > -- > Ekaterina Pavlova, > VMSQE Team, St. Petersburg. > http://blogs.sun.com/vmrobot/ > http://blogs.sun.com/theaquarium_ru/ > >--------------------------------------------------------------------------------------------- Aparat cyfrowy, odtwarzacz mp3 i inne nagrody. Sprawd? nowy konkurs na TeleInteria!>> http://link.interia.pl/f1a2d
I agree that this is somewhat inconvenient. Unfortunately, ''dvm'' provider as well as ''hotspot'' provider (available in JDK6) don''t allow to get this information after threads have been started. Hopefully this will be improved in one of future releases. -katya przemolicc at poczta.fm wrote:> Helo Ekaterina, > > as I had written it is difficult to use dvm:::thread-start because > the app is already started with almost all thread already started as well. > I can of course restart it (and dtrace/watch thread creation) but, in general, > it is rare oportunity (especially in production) to restart application. > > In general it is somehow possible because when I connect jconsole to the application, > it (jconsole) shows all threads names. But how to get them by dtrace ? > > Regards > przemol > > > Ekaterina Pavlova napisa?(a): > >>Try to use dvm:::thread-start probe to associate tid with Java thread name, >>something like: >> >>dvm$1:::thread-start >>{ >> threads[tid] = copyinstr(arg0); >>} >> >> >>thread-start probe is fired inside the callback for >>JVMTI[PI]_EVENT_THREAD_START event which is >>'generated by a new thread before its initial method executes'. >>So, association with tid should work. >> >>-katya >> >>przemolicc at poczta.fm wrote: >> >>>Hello again, >>> >>>is it possible to get thread name having tid ? >>>Can anybody confirm or deny it ? >>> >>>Regards >>>przemol >>> >>>----- Forwarded message from przemolicc at poczta.fm ----- >>> >>>From: przemolicc at poczta.fm >>>To: dtrace-discuss at opensolaris.org >>>Subject: [dtrace-discuss] How to get java thread name ? >>>Date: Tue, 6 Mar 2007 08:49:47 +0100 >>> >>>Hello, >>> >>>we have application written in java which runs several threads inside. >>>Each thread is for one network connection and there are sometimes over >>>hundred connections. The java programmer names the threads in a >>>meaningful way and to analyze the problem it would be good to get >> >>threads names >> >>>while dtracing it (I have been already using java probes from >>>https://solaris10-dtrace-vm-agents.dev.java.net/). >>>I use the following script: >>> >>>#!/usr/sbin/dtrace -s >>> >>>dvm$1:::method-entry >>>{ >>> self->interested = 1; >>> self->ts[copyinstr(arg0),copyinstr(arg1),tid] = vtimestamp; >>>} >>> >>> >>>dvm$1:::method-return >>>/ self->interested / >>>{ >>> @[copyinstr(arg0),copyinstr(arg1),tid] = sum (vtimestamp - >> >>self->ts[copyinstr(arg0),copyinstr(arg1),tid]); >> >>> self->ts[copyinstr(arg0),copyinstr(arg1),tid] = 0; >>>} >>> >>>END >>>{ >>> trunc (@,20); >>>} >>> >>>And the result is: >>> >>>bash-3.00# ./j.d 27164 >>>dtrace: script './j.d' matched 3 probes >>>dtrace: 42 dynamic variable drops with non-empty dirty list >>>^C >>>CPU ID FUNCTION:NAME >>> 1 2 :END >>> >>> java/lang/String lastIndexOf >> >> 19 1078463492773 >> >>> sun/util/calendar/ZoneInfo getOffsets >> >> 19 1130972191852 >> >>> java/lang/Character digit >> >> 19 1239610842238 >> >>> oracle/net/ns/NetInputStream read >> >> 8860 1263472696419 >> >>> oracle/net/ns/NetOutputStream write >> >> 8676 1280145980285 >> >>> oracle/net/ns/NetInputStream read >> >> 8862 1332278387655 >> >>> oracle/net/ns/NetOutputStream write >> >> 8838 1393211840081 >> >>> java/lang/String indexOf >> >> 8676 1432855841749 >> >>> java/lang/String toLowerCase >> >> 19 1454642793917 >> >>> java/util/ResourceBundle getObject >> >> 19 1615516712375 >> >>> java/lang/String indexOf >> >> 8857 1759133160592 >> >>> oracle/net/ns/NetInputStream read >> >> 8643 1804391493956 >> >>> java/lang/String startsWith >> >> 19 2049919104064 >> >>> oracle/net/ns/NetOutputStream write >> >> 8643 2146745239147 >> >>> java/lang/String indexOf >> >> 8643 2329573014804 >> >>> java/lang/Character toUpperCase >> >> 19 2597127049629 >> >>> java/lang/Character toLowerCase >> >> 19 3186325206507 >> >>> oracle/net/ns/NetOutputStream write >> >> 19 28720443556415 >> >>> java/lang/String indexOf >> >> 19 48575396710120 >> >>> oracle/net/ns/NetInputStream read >> >> 19 118222538032233 >> >>>How can I have thread name having tid ? The app and all the threads are >> >>already running so I can't use thread-start probe. >> >>>Regards >>>przemol >>> >>> >>>---------------------------------------------------------------------- >>>Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e >>> >>>_______________________________________________ >>>dtrace-discuss mailing list >>>dtrace-discuss at opensolaris.org >>> >>>----- End forwarded message ----- >>> >>>---------------------------------------------------------------------- >>>Oficjalne konto pocztowe europejskich internautow! >>> >>> >>>>>>http://link.interia.pl/f19e8 >>> >>> >>>_______________________________________________ >>>dtrace-discuss mailing list >>>dtrace-discuss at opensolaris.org >> >>-- >>Ekaterina Pavlova, >>VMSQE Team, St. Petersburg. >>http://blogs.sun.com/vmrobot/ >>http://blogs.sun.com/theaquarium_ru/ >> >> > > > > > --------------------------------------------------------------------------------------------- > Aparat cyfrowy, odtwarzacz mp3 i inne nagrody. Sprawd? nowy konkurs na TeleInteria!>> http://link.interia.pl/f1a2d > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Ekaterina Pavlova, VMSQE Team, St. Petersburg. http://blogs.sun.com/vmrobot/ http://blogs.sun.com/theaquarium_ru/
My apologies for not responding sooner. As mentioned, what you are directly looking to do is not possible, and doing it in any fashion programmatically is not very easy. One question though, since you are using the dvm provider, that means that you have to restart the JVM to get it to work anyway, so I am not sure the restartability constraint comes into play here. That being said, I am just teasing you - it is just plain silly to not have this available. I have neglected the dvm provider for far too long. I just prototyped a version that address this concern and it work in a couple of test cases. It is a long way from prime time (mostly because of my time constraints), but it certainly looks like this isn''t too much effort. Also, I have a couple of RFE requests that I should implement in the next version as well - so thanks for the nudge. Oh, and of course this will all have to get the blessing of Kelly O''Hair before it hits the download page. He is the master of all things JVMTI anyway. Thanks, Jarod Ekaterina Pavlova''s email at 3/8/2007 4:28 PM, said:> I agree that this is somewhat inconvenient. > Unfortunately, ''dvm'' provider as well as ''hotspot'' provider (available > in JDK6) don''t > allow to get this information after threads have been started. > > Hopefully this will be improved in one of future releases. > > -katya > > przemolicc at poczta.fm wrote: > >> Helo Ekaterina, >> >> as I had written it is difficult to use dvm:::thread-start because >> the app is already started with almost all thread already started as >> well. >> I can of course restart it (and dtrace/watch thread creation) but, in >> general, >> it is rare oportunity (especially in production) to restart application. >> >> In general it is somehow possible because when I connect jconsole to >> the application, >> it (jconsole) shows all threads names. But how to get them by dtrace ? >> >> Regards >> przemol >> >> >> Ekaterina Pavlova napisa?(a): >> >>> Try to use dvm:::thread-start probe to associate tid with Java thread >>> name, >>> something like: >>> >>> dvm$1:::thread-start >>> { >>> threads[tid] = copyinstr(arg0); >>> } >>> >>> >>> thread-start probe is fired inside the callback for >>> JVMTI[PI]_EVENT_THREAD_START event which is >>> 'generated by a new thread before its initial method >>> executes'. >>> So, association with tid should work. >>> >>> -katya >>> >>> przemolicc at poczta.fm wrote: >>> >>>> Hello again, >>>> >>>> is it possible to get thread name having tid ? >>>> Can anybody confirm or deny it ? >>>> >>>> Regards >>>> przemol >>>> >>>> ----- Forwarded message from przemolicc at poczta.fm ----- >>>> >>>> From: przemolicc at poczta.fm >>>> To: dtrace-discuss at opensolaris.org >>>> Subject: [dtrace-discuss] How to get java thread name ? >>>> Date: Tue, 6 Mar 2007 08:49:47 +0100 >>>> >>>> Hello, >>>> >>>> we have application written in java which runs several threads inside. >>>> Each thread is for one network connection and there are sometimes over >>>> hundred connections. The java programmer names the threads in a >>>> meaningful way and to analyze the problem it would be good to get >>> >>> threads names >>> >>>> while dtracing it (I have been already using java probes from >>>> https://solaris10-dtrace-vm-agents.dev.java.net/). >>>> I use the following script: >>>> >>>> #!/usr/sbin/dtrace -s >>>> >>>> dvm$1:::method-entry >>>> { >>>> self->interested = 1; >>>> self->ts[copyinstr(arg0),copyinstr(arg1),tid] = vtimestamp; >>>> } >>>> >>>> >>>> dvm$1:::method-return >>>> / self->interested / >>>> { >>>> @[copyinstr(arg0),copyinstr(arg1),tid] = sum (vtimestamp - >>> >>> self->ts[copyinstr(arg0),copyinstr(arg1),tid]); >>> >>>> self->ts[copyinstr(arg0),copyinstr(arg1),tid] = 0; >>>> } >>>> >>>> END >>>> { >>>> trunc (@,20); >>>> } >>>> >>>> And the result is: >>>> >>>> bash-3.00# ./j.d 27164 >>>> dtrace: script './j.d' matched 3 probes >>>> dtrace: 42 dynamic variable drops with non-empty dirty list >>>> ^C >>>> CPU ID FUNCTION:NAME >>>> 1 2 :END >>>> java/lang/String lastIndexOf >>> >>> 19 1078463492773 >>> >>>> sun/util/calendar/ZoneInfo getOffsets >>> >>> 19 1130972191852 >>> >>>> java/lang/Character digit >>> >>> 19 1239610842238 >>> >>>> oracle/net/ns/NetInputStream read >>> >>> 8860 1263472696419 >>> >>>> oracle/net/ns/NetOutputStream write >>> >>> 8676 1280145980285 >>> >>>> oracle/net/ns/NetInputStream read >>> >>> 8862 1332278387655 >>> >>>> oracle/net/ns/NetOutputStream write >>> >>> 8838 1393211840081 >>> >>>> java/lang/String indexOf >>> >>> 8676 1432855841749 >>> >>>> java/lang/String toLowerCase >>> >>> 19 1454642793917 >>> >>>> java/util/ResourceBundle getObject >>> >>> 19 1615516712375 >>> >>>> java/lang/String indexOf >>> >>> 8857 1759133160592 >>> >>>> oracle/net/ns/NetInputStream read >>> >>> 8643 1804391493956 >>> >>>> java/lang/String startsWith >>> >>> 19 2049919104064 >>> >>>> oracle/net/ns/NetOutputStream write >>> >>> 8643 2146745239147 >>> >>>> java/lang/String indexOf >>> >>> 8643 2329573014804 >>> >>>> java/lang/Character toUpperCase >>> >>> 19 2597127049629 >>> >>>> java/lang/Character toLowerCase >>> >>> 19 3186325206507 >>> >>>> oracle/net/ns/NetOutputStream write >>> >>> 19 28720443556415 >>> >>>> java/lang/String indexOf >>> >>> 19 48575396710120 >>> >>>> oracle/net/ns/NetInputStream read >>> >>> 19 118222538032233 >>> >>>> How can I have thread name having tid ? The app and all the threads are >>> >>> already running so I can't use thread-start probe. >>> >>>> Regards >>>> przemol >>>> >>>> >>>> ---------------------------------------------------------------------- >>>> Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e >>>> >>>> _______________________________________________ >>>> dtrace-discuss mailing list >>>> dtrace-discuss at opensolaris.org >>>> >>>> ----- End forwarded message ----- >>>> >>>> ---------------------------------------------------------------------- >>>> Oficjalne konto pocztowe europejskich internautow! >>>> >>>>>>> http://link.interia.pl/f19e8 >>>> >>>> >>>> _______________________________________________ >>>> dtrace-discuss mailing list >>>> dtrace-discuss at opensolaris.org >>> >>> -- >>> Ekaterina Pavlova, >>> VMSQE Team, St. Petersburg. >>> http://blogs.sun.com/vmrobot/ >>> http://blogs.sun.com/theaquarium_ru/ >>> >>> >> >> >> >> >> --------------------------------------------------------------------------------------------- >> >> Aparat cyfrowy, odtwarzacz mp3 i inne nagrody. Sprawd? nowy konkurs na >> TeleInteria!>> http://link.interia.pl/f1a2d >> >> _______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org >
przemolicc at poczta.fm
2007-Mar-12 07:02 UTC
[dtrace-discuss] How to get java thread name ?
On Fri, Mar 09, 2007 at 01:28:01AM +0300, Ekaterina Pavlova wrote:> I agree that this is somewhat inconvenient. > Unfortunately, ''dvm'' provider as well as ''hotspot'' provider (available in > JDK6) don''t > allow to get this information after threads have been started. > > Hopefully this will be improved in one of future releases.It is going to be released in a predictable time ? I can be a beta tester. :-) Regards przemol ---------------------------------------------------------------------- Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
przemolicc at poczta.fm
2007-Mar-12 07:31 UTC
[dtrace-discuss] How to get java thread name ?
On Thu, Mar 08, 2007 at 07:20:05PM -0600, Jarod Jenson wrote:> > My apologies for not responding sooner. > > As mentioned, what you are directly looking to do is not possible, and > doing it in any fashion programmatically is not very easy.Thanks, Jarod, for the answer. It is clear now that I have to approach our problem in other way.> One question though, since you are using the dvm provider, that means > that you have to restart the JVM to get it to work anyway, so I am not > sure the restartability constraint comes into play here.I had to restart it to enable the dvm provider: bash-3.00# dtrace -l -P dvm* ID PROVIDER MODULE FUNCTION NAME 4 dvm27164 libdvmti.so cbVMInit vm-init 110178 dvm27164 libdvmti.so cbClassFileLoadHook class-load 110179 dvm27164 libdvmti.so cbObjectFree class-unload 110180 dvm27164 libdvmti.so cbExceptionCatch exception-catch 110181 dvm27164 libdvmti.so cbException exception-throw 110182 dvm27164 libdvmti.so cbGarbageCollectionFinish gc-finish 110183 dvm27164 libdvmti.so cbGarbageCollectionStart gc-start 110184 dvm27164 libdvmti.so gc_finish_worker gc-stats 110185 dvm27164 libdvmti.so _method_entry method-entry 110186 dvm27164 libdvmti.so _method_exit method-return 110187 dvm27164 libdvmti.so cbMonitorContendedEnter monitor-contended-enter 110188 dvm27164 libdvmti.so cbMonitorContendedEntered monitor-contended-entered 110189 dvm27164 libdvmti.so cbMonitorWait monitor-wait 110190 dvm27164 libdvmti.so cbMonitorWaited monitor-waited 110191 dvm27164 libdvmti.so track_allocation object-alloc 110192 dvm27164 libdvmti.so cbObjectFree object-free 110193 dvm27164 libdvmti.so cbThreadEnd thread-end 110194 dvm27164 libdvmti.so cbThreadStart thread-start 110195 dvm27164 libdvmti.so cbVMDeath vm-death But then the app is working for many, many weeks (months ?) and our problem appears sometimes after such long time period. So to get threads names I would have to run dtrace for so long as well (of course it is possible but inconvenient) let alone it is against dtrace idea - use (and activate it) it only when you need it.> That being said, I am just teasing you - it is just plain silly to not > have this available. I have neglected the dvm provider for far too long.Yes, that''s true. ;-))) (just kidding and teasing you ;-) )> I just prototyped a version that address this concern and it work in a > couple of test cases. It is a long way from prime time (mostly because > of my time constraints), but it certainly looks like this isn''t too much > effort. > > Also, I have a couple of RFE requests that I should implement in the > next version as well - so thanks for the nudge.Could you, please, be more specific about release time ? Weeks ? Months ? Years ? I am not kidding but it helps me decide whether to wait or try another approach.> Oh, and of course this will all have to get the blessing of Kelly O''Hair > before it hits the download page. He is the master of all things JVMTI > anyway.Thank you Jarod for you answer. By the way are you going to continue your blog http://www.sun.com/bigadmin/content/dtrace/blogs/jarod/ ? Please answer: yes. :-) Regards przemol ---------------------------------------------------------------------- Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e
przemolicc at poczta.fm''s email at 3/12/2007 2:31 AM, said:> On Thu, Mar 08, 2007 at 07:20:05PM -0600, Jarod Jenson wrote:[SNIP]>> I just prototyped a version that address this concern and it work in a >> couple of test cases. It is a long way from prime time (mostly because >> of my time constraints), but it certainly looks like this isn''t too much >> effort. >> >> Also, I have a couple of RFE requests that I should implement in the >> next version as well - so thanks for the nudge. > > Could you, please, be more specific about release time ? Weeks ? Months ? Years ? > I am not kidding but it helps me decide whether to wait or try another approach.I have a two hour break in my schedule on Friday. I''ll do the thread naming part for you to play with and the other RFE''s later. That soon enough?> >> Oh, and of course this will all have to get the blessing of Kelly O''Hair >> before it hits the download page. He is the master of all things JVMTI >> anyway. > > Thank you Jarod for you answer. > By the way are you going to continue your blog http://www.sun.com/bigadmin/content/dtrace/blogs/jarod/ ? > Please answer: yes. :-)Yes, but probably at a new location. I''ll post a link. I already have some entries written, I just have to get them out there. Oh, and by the way, glad you are finding the dvm provider useful. Thanks, Jarod