Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » probe targets and filters
probe targets and filters [message #123803] Fri, 22 February 2008 23:52 Go to next message
Del Myers is currently offline Del MyersFriend
Messages: 82
Registered: July 2009
Member
Hi,

I'm trying to do a combination of beforeCall/afterCall/entry/exit probes for
watching when methods are called. I'm having a little bit of a problem with
filters and targets, though.

Here is my problem. I don't want the probe to instrument any classes in
java.lang*, sun*, etc. classes because that can screw up the runtime and prevent
the program from even launching. However, I _do_ want to be notified when
methods like Printstream.println() are being called from within my code. So, I
set the targets of the probes to include nearly everything, and the filters of
the profiling to exclude things like java*, sun*, com.ibm*, etc...

But, when I do this, I'm not getting notified of messages such as
System.out.println(). For example, the simple HelloWorld program:

package mypackage;

public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello World");
}

}


will notify me when main enters and exits, but it won't tell me about the
before/after calls on the PrintStream.println() method. I need, however, to
know when such calls are made. Any clues on how to fix my problem? Thanks.

Del
Re: probe targets and filters [message #125031 is a reply to message #123803] Sun, 02 March 2008 09:17 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Are you using the "static" Probekit instrumentor (i.e., the "Instrument"
menu option) of the dynamic Probekit agent?

Thanks,
Asaf

--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Re: probe targets and filters [message #125669 is a reply to message #125031] Thu, 06 March 2008 19:12 Go to previous messageGo to next message
Del Myers is currently offline Del MyersFriend
Messages: 82
Registered: July 2009
Member
No, I am using dynamic instrumentation. There are no "filtering" options for
static instrumentation since you manually choose which classes to instrument.
Any ideas?

Asaf Yaffe wrote:
> Are you using the "static" Probekit instrumentor (i.e., the "Instrument"
> menu option) of the dynamic Probekit agent?
>
> Thanks,
> Asaf
>
Re: probe targets and filters [message #126213 is a reply to message #125669] Thu, 13 March 2008 07:22 Go to previous message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Del Myers wrote:
> No, I am using dynamic instrumentation. There are no "filtering" options
> for static instrumentation since you manually choose which classes to
> instrument. Any ideas?

This is not entirely correct. Both static and dynamic Probekit use a
"2-layer" filtering scheme. The first layer is used to determine the set
of classes that will be instrumented (regardless of probe types and
targets). The second layer determines which parts of a class (which
passed the first layer) to actually instrument.

In static Probekit, the first layer corresponds to the list of classes
you manually select for instrumentation. In your case, this can work
because you want to instrument only your application's classes and I
assume that these classes are known upfront (before you actually run
your application). In dynamic Probekit, the first layer corresponds to
the filter set you define in the Monitor tab of the Profiling Launch
Configuration dialog (by double-clicking the "Java Profiling - JRE
1.5..." node). Again, you can easily define a filter-set which includes
your application's classes and excludes everything else.

The second filtering layer is derived from a Probe's "target" definition.

To summarize all of this: it seems that the solution for your problem is
to define Probe targets to include the "java.lang.*" classes and methods
you need, and then use the first layer filter (in either static of
dynamic Probekit) to instruct Probekit to instrument only your
application's classes.

HTH,
Asaf

--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Previous Topic:getting started -- Agent Controller is unavailable under port 10002
Next Topic:Porting issue
Goto Forum:
  


Current Time: Tue Mar 19 04:46:02 GMT 2024

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

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

Back to the top