Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Problems profiling linux app from windows...
Problems profiling linux app from windows... [message #76405] Wed, 05 July 2006 19:05 Go to next message
Eclipse UserFriend
Originally posted by: andyrsmith.googlemail.com

Hi All,

I've just downloaded callisto and though I'd try profiling a job on a
remote machine. From what I can gather I need to stick the appropriate
piServer.so in my LD_LIBRARY path and also I need to pass
-XrunpiAgent:server=enabled on the command line and that should be it.

I've been trying to point my LD_LIBRARY_PATH at various downloads (i've
tried the agentcontroller/new technologyagentcontroller) (runtime+sdk
versions). The piServer error message has gone awat so the .so is
obviously being read - however now I'm getting an error message ...

Could not find agent library on the library path or in the local
directory: appjvmtiprofiler

Any ideas? Apologies that I'm not too up on this technology. I just want
it to be as easy as remote debugging... :-)

Machine confuguration is ...

java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_01-b08, mixed mode)

uname -a
Linux gsabc6b1 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 x86_64
x86_64 x86_64 GNU/Linux


Cheers,

A.
Re: Problems profiling linux app from windows... [message #76421 is a reply to message #76405] Wed, 05 July 2006 20:09 Go to previous messageGo to next message
Randy D. Smith is currently offline Randy D. SmithFriend
Messages: 394
Registered: July 2009
Senior Member
Andy Smith wrote:
> Hi All,
>
> I've just downloaded callisto and though I'd try profiling a job on a
> remote machine. From what I can gather I need to stick the appropriate
> piServer.so in my LD_LIBRARY path and also I need to pass
> -XrunpiAgent:server=enabled on the command line and that should be it.

That -Xrun argument is pointing at a piAgent parameter that you'll need
to resolve as well. You should see piAgent.so in your
<ac_install_dir>/lib directory, so add that to your LD_LIBRARY_PATH as well.

> I've been trying to point my LD_LIBRARY_PATH at various downloads (i've
> tried the agentcontroller/new technologyagentcontroller) (runtime+sdk
> versions). The piServer error message has gone awat so the .so is
> obviously being read - however now I'm getting an error message ...
>
> Could not find agent library on the library path or in the local
> directory: appjvmtiprofiler

jvmTi? interesting. I'm hoping/assuming that since Java 1.5 does PI and
TI, it's just reporting it couldn't find ANY profiling agent. The JVMPI
agent is the one in piAgent.so. To get the JVMTI agent, you need the
JVMTI tech preview component.

> Any ideas? Apologies that I'm not too up on this technology. I just want
> it to be as easy as remote debugging... :-)

I've done profiling of simple Java programs, but not much more... so I
may have some details awry here... but if so, I'm sure someone will
correct me! :-)

> Machine confuguration is ...
>
> java -version
> java version "1.5.0_01"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
> Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_01-b08, mixed mode)

Any particular reason not to update the JVM? I'm not saying there are
problems with _01, but with _06/_07 available for a while... why take
chances?

> uname -a
> Linux gsabc6b1 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 x86_64
> x86_64 x86_64 GNU/Linux

So are you just using the Linux-IA32 release? I have to assume so since
you said you'd tried both the RAC and the new tech AC... I don't think
there is an EM64T version of the RAC... and the new tech AC for EM64T
doesn't have "backward compatibility" (BC) in it yet and much of the
agent work has not yet been ported! For that matter, the Linux-IA32 new
tech AC does not "officially" support BC.

For what you're trying to do, in the 4.2 timeframe, I'd definitely stick
to the tried-and-true RAC ("standard" agent controller) for Linux-IA32.

Arghhh... the JVM is 64-bit... you're going to have to be careful here
with mixing and matching! (As in, *you can't*!) I don't think the 64-bit
JVM will "see" the 32-bit .sos for the profiling agent... you'll either
have to use 32-bit throughout or 64-bit throughout... and your only hope
for 64-bit profiling is the tech preview JVMTI one... I think.

>
> Cheers,
>
> A.
>
>

HTH...
--
RDS

Randy D. Smith randy (dot) d (dot) smith (at) intel (dot) com
Eclipse TPTP Committer, Platform Proj (data collection/agent controller)
Re: Problems profiling linux app from windows... [message #76453 is a reply to message #76421] Thu, 06 July 2006 06:01 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Hi Andy,

Randy D. Smith wrote:

> Arghhh... the JVM is 64-bit... you're going to have to be careful here
> with mixing and matching! (As in, *you can't*!) I don't think the 64-bit
> JVM will "see" the 32-bit .sos for the profiling agent... you'll either
> have to use 32-bit throughout or 64-bit throughout... and your only hope
> for 64-bit profiling is the tech preview JVMTI one... I think.

As Randy pointed out, a 64-bit JVM (such as the one you're using) cannot
load and use 32-bit agents, so you can't use piAgent on Linux EM64T.
However, the Tech Preview JVMTI Profiler fully supports 64-bit VMs on all
Linux platforms. The problem is that the "agent discovery" features (the
ability of the Eclipse workbench to discover profiling agents running on
remote machines) are not yet implemented for the Tech Preview JVMTI
Profiler, so you can't do "remote profiling" with the JVMTI Profiler.

As an alternative, you can launch the JVMTI profiler is "standalone" mode
and then import the resulting trace file to an Eclipse workbench (such as
the one you have installed on Windows).
The JVMTI profiler can be downloaded from the TPTP 4.2 download page.
Refer to the User Guide for the exact installation procedure and
instructions on using the "standalone" mode. The User Guide does not cover
some command-line options you can use to configure profiling options and
filters, but in general most options that are supported by the JVMPI
profiler are also supported by the JVMTI profiler (with the obvious
changes in the Java command-line syntax, as described in the JVMTI
Profiler User Guide). These options are described in the "Profiling
applications in standalone mode" topic of the TPTP 4.2 online help.

Hope this helps!

Best Regards,
Asaf
Re: Problems profiling linux app from windows... [message #76469 is a reply to message #76421] Thu, 06 July 2006 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andyrsmith.googlemail.com

Hi Randy,

Thx for the quick response... still having problems tho :-(

Randy D. Smith wrote:

> Andy Smith wrote:
>> Hi All,
>>
>> I've just downloaded callisto and though I'd try profiling a job on a
>> remote machine. From what I can gather I need to stick the appropriate
>> piServer.so in my LD_LIBRARY path and also I need to pass
>> -XrunpiAgent:server=enabled on the command line and that should be it.

> That -Xrun argument is pointing at a piAgent parameter that you'll need
> to resolve as well. You should see piAgent.so in your
> <ac_install_dir>/lib directory, so add that to your LD_LIBRARY_PATH as well.

Ok I think I'd gotten this far...

>> I've been trying to point my LD_LIBRARY_PATH at various downloads (i've
>> tried the agentcontroller/new technologyagentcontroller) (runtime+sdk
>> versions). The piServer error message has gone awat so the .so is
>> obviously being read - however now I'm getting an error message ...
>>
>> Could not find agent library on the library path or in the local
>> directory: appjvmtiprofiler

> jvmTi? interesting. I'm hoping/assuming that since Java 1.5 does PI and
> TI, it's just reporting it couldn't find ANY profiling agent. The JVMPI
> agent is the one in piAgent.so. To get the JVMTI agent, you need the
> JVMTI tech preview component.

Is this the one under 'new technology' on the downloads? Is the JVMTI
agent also called piAgent or is there another variant on the run argument
I need? Does the TPTP component I downloaded with callisto chat happily to
either type of agent?

> Any particular reason not to update the JVM? I'm not saying there are
> problems with _01, but with _06/_07 available for a while... why take
> chances?

As lazy as it sounds it's very much an 'if it ain't broke' situation. I've
got other jvms on that box and also have access to 32 bit h/w so if
there's a combination you think should work correctly let me know. I've
tried the EM64T download of the new tech AC now and I'm still getting
essentially the same error message.

> For what you're trying to do, in the 4.2 timeframe, I'd definitely stick
> to the tried-and-true RAC ("standard" agent controller) for Linux-IA32.

Okay I'll have an other attempt later today. If you could let me know
exactly what I should be running on the linux box from the downloads page
it'd be helpful. I like the idea of having callisto as a 'baseline' for
the client type I'm using - so I guess the question now becomes 'given
that I've got callisto installed on a windows machine, what steps do I
need to take on the server side to profile apps remotely with minimum
mess+fuss'. (By 'steps' I can run against any JVM that's known to work and
can run on 32/64 bit hw, and am happy to run against whataver agent code
you suggest, and am running a cmdline app so can specify whateve args are
necessry - so given those parameters I think we should have a fair chance
of succeeding right ? :-) ).


> HTH...

it did :)

Cheers,

A.
Re: Problems profiling linux app from windows... [message #76485 is a reply to message #76453] Thu, 06 July 2006 09:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andyrsmith.googlemail.com

Thx for reply..


> As Randy pointed out, a 64-bit JVM (such as the one you're using) cannot
> load and use 32-bit agents, so you can't use piAgent on Linux EM64T.
> However, the Tech Preview JVMTI Profiler fully supports 64-bit VMs on all
> Linux platforms. The problem is that the "agent discovery" features (the
> ability of the Eclipse workbench to discover profiling agents running on
> remote machines) are not yet implemented for the Tech Preview JVMTI
> Profiler, so you can't do "remote profiling" with the JVMTI Profiler.

Does this mean that there's no way of profiling remotely with callisto?
I'm quite happy to drop down to JVMPI if I can run? Also I'm a little
confused about ther terminology. Does providing the -Xrunxxx args on the
commandline actually spawn an embedded agent which is colocated in the JVM
so that it looks to clients as if it were a remote standalone agent?

Also is 'discovery' a showstopper? It looks like from the eclipse profiler
that if I know the host where my 'profile enabled' app is running I should
be able to connect straight to the agent and profile, no discovery
required. Or am I missing something? In my head I'm treating it
analogously to how remote debugging can be done by supplying a few JVM
args - is this analogy flawed?

To me it seems equivalent that instead of having a remote agent which
launches apps on your behalf you could just as easily launch your apps
with appropriate cmdline args such that their agents listen on different
ports. If these are indeed equivalent then what's the point of the remote
agent? ... is it that it provides 'remote launch' functionality? I must
admit I'd be more comfortable working by simply adding cmdline args (again
I'm comfortable with using cmdline args), to me it's simpler than having
to run yet another daemon process that needs to be fed + watered ;-)

Again apologies that I don't know these things as well as I'd like given
time constraints, am keen to get it up and running though.

Cheers,

A>
Re: Problems profiling linux app from windows... [message #76616 is a reply to message #76485] Thu, 06 July 2006 21:23 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Hi Andy,

I'll try to clarify:

There are three ways to do remote profiling in Eclipse:

1. Launch a remote application from the workbench. This is done by creating
an "External Java Application" launch configuration and specifying the host
on which to run and profiler and application. For this to work, the Agent
Controller must run on the target host. In this scenario, the Agent
Controller is responsible for launching the application in "profiling mode"
(more on this later) and transmitting profiling data back to the workbench.
This feature is supported for both the JVMPI profiler (piAgent) and the new
JVMTI Profiler.

2. Manually launch your application in "profiling mode", and then attach to
it from a workbench (installed either locally or on another machine) and
collect profiling information. This is done by modifying the "Java" command
line and add the necessary switches to launch the profiler with your Java
application:
- In Java 1.4, you use the -Xrun<profilerAgent> switch (e.g., -XrunpiAgent).
This loads a profiler that can communicate with the VM through the
experimental JVMPI interface. This technique is also supported (for backward
compatibility) in Java 5.0 (aka 1.5) but will be removed in Java 6.
- In Java 5.0 and above, you use the -agentlib:<profilerAgent> switch. This
loads a profiler that can communicate with the VM through the JVMTI
interface.
Using this mode, you have two options, namely launching your application in
"controlled" or "enabled" mode. Please refer to the online documentation for
the details. Regardless of which option you use, you still need to attach a
workbench to this application in order to collect profiling data. To be able
to attach, the Agent Controller must be active on the machine on which your
profiled application is running, and the workbench must be able to discover
the running profiler and attach to it (what I referred to as "discovery" in
my previous post). This feature is currently implemented only for the JVMPI
(piAgent) profiler, and since the JVMPI profiler is not supported on Linux
EM64T, it will not work on this platform either.
Bottom line: manually launching your application in "controlled" or
"enabled" mode and then attaching to it from a remote workbench is currently
supported for the JVMPI profiler only, but not on Linux EM64T.

3. Manually launch your application in "standalone" profiling mode (see
online documentation for details). To do this, you need neither a workbench
nor a running Agent Controller. If you want to use the JVMPI profiler, you
must install the Agent Controller just because the JVMPI profiler is
distributed with AC and does not have its own distribution. If you want to
use the JVMTI profiler, you need to install only the JVMTI Profiler on the
machine on which you want to profiler.
The "standalone" profiling session produces an XML file which can be
imported to a workbench for offline analysis.

Regarding the terminology we use:
1. The JVMPI profiler is the default profiler you get after installing TPTP
and the Agent Controller (whether the "regular" one or the "new technology"
one). It works with both ACs.
2. The JVMTI profiler is a technology preview feature in TPTP 4.2, which
implements a CPU (aka Call Graph) profiler based on the Java 5.0/6.0 JVMTI
standard interface. We expect to grow this into a full-fledged profiler in
TPTP 4.3. This profiler can be used either in standalone mode or with the
new technology Agent Controller. It cannot be used with the "regular" Agent
Controller. It is available on the TPTP 4.2 download page as a separate
download (at the bottom of the page).
3. Launching an application in profiling mode: when you use the -Xrun (Java
1.4) or -agentlib (Java 5.0) switches in the Java command line, the Java
runtime loads the profiling agent you specify into the VM together with your
Java application. The profiler agent becomes a part of your application and
uses some well-defined VM interfaces (JVMPI or JVMTI, JNI and possibly some
Byte Code Instrumentation) to monitor you application and collect profiling
information.

HTH!

Best regards,
Asaf
Re: Problems profiling linux app from windows... [message #76694 is a reply to message #76469] Fri, 07 July 2006 18:22 Go to previous message
Randy D. Smith is currently offline Randy D. SmithFriend
Messages: 394
Registered: July 2009
Senior Member
Andy Smith wrote:
....

> Okay I'll have an other attempt later today. If you could let me know
> exactly what I should be running on the linux box from the downloads
> page it'd be helpful. I like the idea of having callisto as a 'baseline'
> for the client type I'm using - so I guess the question now becomes
> 'given that I've got callisto installed on a windows machine, what steps
> do I need to take on the server side to profile apps remotely with
> minimum mess+fuss'. (By 'steps' I can run against any JVM that's known
> to work and can run on 32/64 bit hw, and am happy to run against
> whataver agent code you suggest, and am running a cmdline app so can
> specify whateve args are necessry - so given those parameters I think we
> should have a fair chance of succeeding right ? :-) ).

If you go to the TPTP downloads page (<
http://www.eclipse.org/tptp/home/downloads/downloads.php >) you should
see the first tab (Latest Release - 4.2.0) highlighted, and the header
say "Release Build: TPTP-4.2.0". Scrolling down to Agent Controller
(careful, not further down at New technology Agent Controller) you'll
find a LINUX-IA32 Runtime Download link to (<
http://www.eclipse.org/downloads/download.php?file=/tptp/4.2 .0/TPTP-4.2.0-200606190100A/tptpdc.linux_ia32-TPTP-4.2.0.zip
>). The "Getting started with Agent Controller" link at the bottom (<
http://www.eclipse.org/tptp/home/downloads/installguide/Agen tController42.html
>) should tell you all you need to know about installation... except
that it is not explicit about JVM. I know there's been testing with
IBM's 1.4.2 version, and I think Sun's 1.4.2_10 and 1.5.0_06 versions...
Personally, I've shifted to mostly using JRockit's 1.5.0_06, but then I
mostly run the AC (agntctrl package) rather than the RAC (tptpdc package
whose link is given above).

>> HTH...
>
>
> it did :)

I'm assuming all the prior stuff was answered by Asaf's response on the
other sub-thread... he explained the JVM{P|T}I situation much better
than I could (which makes sense since he is more intimately associated
with the JVMTI project!).

> Cheers,
>
> A.

--
RDS

Randy D. Smith randy (dot) d (dot) smith (at) intel (dot) com
Eclipse TPTP Committer, Platform Proj (data collection/agent controller)
Previous Topic:Attaching to weblogic 8.1 using IAC
Next Topic:Agents
Goto Forum:
  


Current Time: Thu Apr 18 22:49:56 GMT 2024

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

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

Back to the top