Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Online Monitoring Using TPTP
Online Monitoring Using TPTP [message #80902] Wed, 16 August 2006 23:42 Go to next message
Eclipse UserFriend
Originally posted by: aheydarn.cs.uwaterloo.ca

Hi All,



As part of my research, I want to run a Java application and at the same
time of running the application, I need to monitor what is happening inside
the code. As an example, I want to run a Word processor application. Then, I
need to see which method is called whenever a menu item is selected.



Is it possible to use TPTP for this purpose? If yes, how?



Your help is greatly appreciated,



Best Regards,

Abbas
Re: Online Monitoring Using TPTP [message #80940 is a reply to message #80902] Thu, 17 August 2006 14:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nmehrega.ca.ibm.com

This is a multipart message in MIME format.
--=_alternative 00500B64852571CD_=
Content-Type: text/plain; charset="US-ASCII"

Yes, it's certainly possible to use TPTP to reverse engineer applications.
In fact, we recently wrote an article on this in Eclipse review. Here's
the link for it:
http://www.eclipsereview.com/issues/eclipsereview_200606.pdf See page
41-45.

Also, Probekit is best at doing this sort of thing.
- For a short movie on Probekit, see:
http://www.eclipse.org/tptp/platform/documents/probekit/view let/IntroToProbekit_viewlet_swf.html
- For an introductory document on Probekit, see:
http://www.eclipse.org/tptp/platform/documents/probekit/prob ekit.html

Navid Mehregani
--=_alternative 00500B64852571CD_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Yes, it's certainly possible to use
TPTP to reverse engineer applications. &nbsp;In fact, we recently wrote
an article on this in Eclipse review. &nbsp;Here's the link for it: http://www.eclipsereview.com/issues/eclipsereview_200606.pdf
&nbsp;See page 41-45.</font>
<br>
<br><font size=2 face="sans-serif">Also, Probekit is best at doing this
sort of thing. &nbsp;</font>
<br><font size=2 face="sans-serif">- For a short movie on Probekit, see:
http://www.eclipse.org/tptp/platform/documents/probekit/view let/IntroToProbekit_viewlet_swf.html</font>
<br><font size=2 face="sans-serif">- For an introductory document on Probekit,
see: http://www.eclipse.org/tptp/platform/documents/probekit/prob ekit.html</font>
<br>
<br><font size=2 face="sans-serif">Navid Mehregani</font>
--=_alternative 00500B64852571CD_=--
Re: Online Monitoring Using TPTP [message #81044 is a reply to message #80940] Thu, 17 August 2006 23:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: aheydarn.cs.uwaterloo.ca

Dear Navid,

Thank you so much for your reply. Your answer was very useful. I have also
the following question:

If I want to do the same probing (tracing) at the level of lines of code, is
it possible to use TPTP? More specifically, I intend to use TPTP to find the
lines of code which are executed by a command or menu option.

Thanks a lot again for your help,

Best Regards,
Abbas

-------------------------------------------------

"Navid_Mehregani" <nmehrega@ca.ibm.com> wrote in message
news:ec1un7$735$1@utils.eclipse.org...

Yes, it's certainly possible to use TPTP to reverse engineer applications.
In fact, we recently wrote an article on this in Eclipse review. Here's the
link for it: http://www.eclipsereview.com/issues/eclipsereview_200606.pdf
See page 41-45.

Also, Probekit is best at doing this sort of thing.
- For a short movie on Probekit, see:
http://www.eclipse.org/tptp/platform/documents/probekit/view let/IntroToProbekit_viewlet_swf.html
- For an introductory document on Probekit, see:
http://www.eclipse.org/tptp/platform/documents/probekit/prob ekit.html

Navid Mehregani
Re: Online Monitoring Using TPTP [message #81133 is a reply to message #81044] Fri, 18 August 2006 14:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nmehrega.ca.ibm.com

This is a multipart message in MIME format.
--=_alternative 0050A4DE852571CE_=
Content-Type: text/plain; charset="US-ASCII"

Hi Abbas,

If you want to determine the line level coverage of your application,
consider using TPTP's line level coverage tool. Available as a download
in the technology preview section:
http://www.eclipse.org/tptp/home/downloads/drops/TPTP-4.3.0- 200608150100.html
Look under "Code Coverage".

If you want to probe each executable unit of your application. Consider
creating a probe with an executableUnit fragment type. See Appendix A of
this document:
http://www.eclipse.org/tptp/platform/documents/probekit/prob ekit.html#appendix_a
and look up executableUnit. You can also look at Appendix B, which lists
the data items that would be associated with that fragment type.

Navid Mehregani
--=_alternative 0050A4DE852571CE_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Hi Abbas,</font>
<br>
<br><font size=2 face="sans-serif">If you want to determine the line level
coverage of your application, consider using TPTP's line level coverage
tool. &nbsp;Available as a download in the technology preview section:
http://www.eclipse.org/tptp/home/downloads/drops/TPTP-4.3.0- 200608150100.html
&nbsp;Look under &quot;Code Coverage&quot;.</font>
<br>
<br><font size=2 face="sans-serif">If you want to probe each executable
unit of your application. &nbsp;Consider creating a probe with an executableUnit
fragment type. &nbsp;See Appendix A of this document: http://www.eclipse.org/tptp/platform/documents/probekit/prob ekit.html#appendix_a
and look up executableUnit. &nbsp;You can also look at Appendix B, which
lists the data items that would be associated with that fragment type.</font>
<br>
<br><font size=2 face="sans-serif">Navid Mehregani</font>
--=_alternative 0050A4DE852571CE_=--
Re: Online Monitoring Using TPTP [message #82029 is a reply to message #81133] Tue, 29 August 2006 22:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: aheydarn.cs.uwaterloo.ca

Dear Navid,

I used an executableUnit fragment to print out the line numbers of the code
that are executed during a program run. For this purpose, I used the
following code in this fragment:

System.out.println(spaces + "Line Number: " + myLineNumber);

In the above code, myLineNumber is of type executableUnitNumber. Now, the
program prints out the line numbers of code that were executed. However, for
loops (e.g., for, while, ...) the result is somehow strange. For example, it
prints out 0, 1, 2, 5, 6, 7, and so on. It seems that a loop is being
translated into a number of lines of code. Am I right? Does TPTP uses
three-address method for translating Java programs? If yes, do you know what
method of translation is used (e.g., Jimple)?

Thanks a lot in advance for your help,

All the best,

Abbas


=====================================================

"Navid_Mehregani" <nmehrega@ca.ibm.com> wrote in message
news:ec4jfg$4r5$2@utils.eclipse.org...

Hi Abbas,

If you want to determine the line level coverage of your application,
consider using TPTP's line level coverage tool. Available as a download in
the technology preview section:
http://www.eclipse.org/tptp/home/downloads/drops/TPTP-4.3.0- 200608150100.html
Look under "Code Coverage".

If you want to probe each executable unit of your application. Consider
creating a probe with an executableUnit fragment type. See Appendix A of
this document:
http://www.eclipse.org/tptp/platform/documents/probekit/prob ekit.html#appendix_a
and look up executableUnit. You can also look at Appendix B, which lists
the data items that would be associated with that fragment type.

Navid Mehregani
Re: Online Monitoring Using TPTP [message #83375 is a reply to message #82029] Tue, 12 September 2006 22:20 Go to previous message
Eclipse UserFriend
Originally posted by: nmehrega.ca.ibm.com

This is a multipart message in MIME format.
--=_alternative 007ABD1B852571E7_=
Content-Type: text/plain; charset="US-ASCII"

Hi Abbas,

One thing to keep in mind is that executable unit number is NOT the same
thing as source line number. I think you might have confused the two. To
get source line numbers, you need to use a data item of type
methodLineTables, which is an encoded list of line numbers that correspond
with every executable unit of code in the class Please see the Probekit
help content for information on how it's encoded. In Eclipse, just click
on help -> help contents -> type in 'method line table' in the search text
box -> Click on 'The methodLineTables data string format'.

I get a different output for my loops than you do. I experimented with the
following class:

public class MainClass {

public static void main(String[] args) throws Exception {
int x = 0;
for (int i=0; i < 5; i++)
{
x++;
}
}
}

My probe consisted of an executableUnit fragment, which printed the
following:

System.out.println("[" + myClassName + "." + myMethodName + "]" + "
Executable Unit: " + myExecutableNumber + " Method Line Table: " +
myMethodLineTable);

myExecutableNumber is of type executableUnitNumber and myMethodLineTable
is of type methodLineTables. Here's the output when I instrumented
MainClass with this probe:

[MainClass.main] Executable Unit: 0 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 1 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 4 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 2 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 3 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 4 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 2 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 3 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 4 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 2 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 3 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 4 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 2 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 3 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 4 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 2 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 3 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 4 Method Line Table: +10,312#5+04
[MainClass.main] Executable Unit: 5 Method Line Table: +10,312#5+04

Notice the repeat in the executable unit numbers, thus indicating a loop
in the class (0, 1, 4, 2, 3, 4, 2, 3, ...., 5). These are just the number
of executable units that it executes. Please see the help content to see
how you can map the executable units with the source line number by using
the method line table.

Navid Mehregani
--=_alternative 007ABD1B852571E7_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Hi Abbas,</font>
<br>
<br><font size=2 face="sans-serif">One thing to keep in mind is that executable
unit number is NOT the same thing as source line number. &nbsp;I think
you might have confused the two. &nbsp;To get source line numbers, you
need to use a data item of type methodLineTables, which is an encoded list
of line numbers that correspond with every executable unit of code in the
class &nbsp; &nbsp;Please see the Probekit help content for information
on how it's encoded. &nbsp;In Eclipse, just click on help -&gt; help contents
-&gt; type in 'method line table' in the search text box -&gt; Click on
'The methodLineTables data string format'.</font>
<br>
<br><font size=2 face="sans-serif">I get a different output for my loops
than you do. I experimented with the following class:</font>
<br>
<br><font size=2 color=#820040 face="Courier New"><b>public</b></font><font size=2 face="Courier New">
</font><font size=2 color=#820040 face="Courier New"><b>class</b></font><font size=2 face="Courier New">
MainClass {</font>
<br>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040 face="Courier New"><b>public</b></font><font size=2 face="Courier New">
</font><font size=2 color=#820040 face="Courier New"><b>static</b></font><font size=2 face="Courier New">
</font><font size=2 color=#820040 face="Courier New"><b>void</b></font><font size=2 face="Courier New">
main(String[] args) </font><font size=2 color=#820040 face="Courier New"><b>throws</b></font><font size=2 face="Courier New">
Exception {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040 face="Courier New"><b>int</b></font><font size=2 face="Courier New">
x = 0;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </font><font size=2 color=#820040 face="Courier New"><b>for</b></font><font size=2 face="Courier New">
(</font><font size=2 color=#820040 face="Courier New"><b>int</b></font><font size=2 face="Courier New">
i=0; i &lt; 5; i++)</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; {</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x++;</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; }</font>
<br><font size=2 face="Courier New">&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br><font size=2 face="Courier New">}</font>
<br>
<br><font size=2 face="sans-serif">My probe consisted of an executableUnit
fragment, which printed the following:</font>
<br>
<br><font size=1 face="Tahoma">System.out.println(</font><font size=1 color=#4200ff face="Tahoma">&quot;[&quot;</font><font size=1 face="Tahoma">
+ myClassName + </font><font size=1 color=#4200ff face="Tahoma">&quot;.&quot;</font><font size=1 face="Tahoma">
+ myMethodName + </font><font size=1 color=#4200ff face="Tahoma">&quot;]&quot;</font><font size=1 face="Tahoma">
+ </font><font size=1 color=#4200ff face="Tahoma">&quot; &nbsp;Executable
Unit: &quot;</font><font size=1 face="Tahoma"> + myExecutableNumber + </font><font size=1 color=#4200ff face="Tahoma">&quot;
Method Line Table: &quot;</font><font size=1 face="Tahoma"> + myMethodLineTable);</font>
<br>
<br><font size=2 face="sans-serif">myExecutableNumber is of type executableUnitNumber
and myMethodLineTable is of type methodLineTables. &nbsp;Here's the output
when I instrumented MainClass with this probe:</font>
<br>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
0 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
1 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
4 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
2 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
3 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
4 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
2 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
3 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
4 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
2 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
3 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
4 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
2 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
3 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
4 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
2 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
3 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
4 Method Line Table: +10,312#5+04</font>
<br><font size=2 face="Courier New">[MainClass.main] &nbsp;Executable Unit:
5 Method Line Table: +10,312#5+04</font>
<br>
<br><font size=2 face="sans-serif">Notice the repeat in the executable
unit numbers, thus indicating a loop in the class (0, 1, 4, 2, 3, 4, 2,
3, ...., 5). &nbsp;These are just the number of executable units that it
executes. &nbsp;Please see the help content to see how you can map the
executable units with the source line number by using the method line table.</font>
<br>
<br><font size=2 face="sans-serif">Navid Mehregani</font>
--=_alternative 007ABD1B852571E7_=--
Previous Topic:Cannot launch AGR testsuite on Linux using Agent Controller
Next Topic:Identifying Executed Lines of Code Using ProbeKit (2)
Goto Forum:
  


Current Time: Tue Apr 16 08:16:59 GMT 2024

Powered by FUDForum. Page generated in 0.08276 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top