Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » profiling remote java application
profiling remote java application [message #99694] Thu, 31 May 2007 09:53 Go to next message
Eclipse UserFriend
Originally posted by: hichamm.orcsoftware.com

Hello,

I have a remote process (written in C) that attaches the JVM java6 as a
so file.
I write locally a couple of Java classes which I compile locally and
upload to the remote server and put in that process's CLASSPATH.
The code runs correctly on that remote JVM, I can also debug it, because i
have configured the remote JVM with

-Xrunjdwp:transport=dt_socket,address=<PORT>,server=y,suspend=n

Can I profile that remote JVM to get execution times for my methods?

rds,
Re: profiling remote java application [message #99905 is a reply to message #99694] Sun, 03 June 2007 13:04 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Hicham wrote:
> Hello,
>
> I have a remote process (written in C) that attaches the JVM java6 as a
> so file.
> I write locally a couple of Java classes which I compile locally and
> upload to the remote server and put in that process's CLASSPATH.
> The code runs correctly on that remote JVM, I can also debug it, because
> i have configured the remote JVM with
> -Xrunjdwp:transport=dt_socket,address=<PORT>,server=y,suspend=n
>
> Can I profile that remote JVM to get execution times for my methods?
>
> rds,
>

Hicham,

You need to install the Agent Controller on the "remote" machine, and
then launch the JVM with the JVMTI Agent. To do that:

1. Add the Agent Controller 'bin' directory to the PATH and LD_LIBRARY_PATH
2. Set environment variable "JAVA_PROFILER_HOME" to "<Agent Controller
Home>\plugins\org.eclipse.tptp.javaprofiler"
3. Add "JAVA_PROFILER_HOME" to the PATH and LD_LIBRARY_PATH
4. Launch the Java 6 JVM with the following command line argument:
'-agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf'

Notes:
1. You can use either "controlled" or "enabled" mode. Refer to the JVMTI
Agent documentation to learn more about these modes.
2. By default, CGProf collects only execution statistics. To get
call-tree information, use the following command line:
'-agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf:exec details=true'

HTH,
Asaf

--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Re: profiling remote java application [message #99938 is a reply to message #99905] Sun, 03 June 2007 13:07 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
I forgot to mention that after launching the profiler on the remote
machine, you can attach to it from the workbench and start collecting data.

Another option is to launch the profiler in "standalone" mode and
collect information into a file. Then you can import the file into the
workbench for further analysis. To do that, use "server=standalone"
instead of "server=enabled" in the "-agentlib" option. More information
is available in the on line documentation.

Thanks,
Asaf
Re: profiling remote java application [message #99953 is a reply to message #99938] Mon, 04 June 2007 09:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hichamm.orcsoftware.com

Installing and running the Agent controller works, as well as launching
the JVM with the agent on the remote machine
I see then that the controller is listening on 10002 and 10006.

Now I try to attach to it with my Eclipse workbench, at this stage, the
JVM and the application is already running.
Run/Profile:
Attach - Java Process => HOSTS
I added 2 entries for 10002 and 10006 and the remote host.
Test connection is successful.

I go to the Agents tab, and it says Retrieving List...
but nothing appears in the list.

looks like the agent controller cannot find the agent.
Re: profiling remote java application [message #100014 is a reply to message #99953] Mon, 04 June 2007 12:10 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
hicham wrote:
> Installing and running the Agent controller works, as well as launching
> the JVM with the agent on the remote machine
> I see then that the controller is listening on 10002 and 10006.
>
> Now I try to attach to it with my Eclipse workbench, at this stage, the
> JVM and the application is already running.
> Run/Profile:
> Attach - Java Process => HOSTS
> I added 2 entries for 10002 and 10006 and the remote host.
> Test connection is successful.
>
> I go to the Agents tab, and it says Retrieving List...
> but nothing appears in the list.
>
> looks like the agent controller cannot find the agent.
>
We're currently addressing these issues, with the intent of enabling all
dynamic attach use cases for Wednesday build (TPTP 4.4 RC2).

You may want to try my other suggestion of using "standalone" mode,
profiling into a file, and then importing the file into the workbench.

HTH,
Asaf

--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Re: profiling remote java application [message #100755 is a reply to message #100014] Mon, 11 June 2007 12:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hichamm.orcsoftware.com

I import the profiler output file and it works.
However that file, even after filtering to the relevant classes,
becomes very large (1Gbyte).

Are there any options to fine-tune the output?
Is any format (other than XML) accepted by Eclipse?

rds,
Hicham
Re: profiling remote java application [message #100814 is a reply to message #100755] Tue, 12 June 2007 06:12 Go to previous message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Hicham wrote:
> I import the profiler output file and it works.
> However that file, even after filtering to the relevant classes,
> becomes very large (1Gbyte).
>
> Are there any options to fine-tune the output?
> Is any format (other than XML) accepted by Eclipse?
>
> rds,
> Hicham
>
You can apply filters at the "runtime" level, to instruct the profiler
to collect data only for certain classes. This usually produces smaller
output files and cause the entire profiling session to run faster.
Filters can be used for the CPU/Call Graph Profiler (CGProf) and Heap
Profiler (HeapProf).

To define filters:
1. Create a simple text file with your filter definition. Each line in
the file specifies a package/class name, method and "mode", which is
either INCLUDE or EXCLUDE. These lines are processed in order, so make
sure to order the filters in a sensible manner.

For example, to include all classes in my.package and exclude everything
else, define a text file with the following entries:

my.package* * INCLUDE
* * EXCLUDE

2. Use the "filters" parameter of JPIAgent to specify the filters file
defined in step 1. For example:

java
-agentlib:JPIBootLoader=JPIAgent:server=standalone;filters=m yfilterfile.txt;CGProf
<Java Class to Profiler>

HTH,
Asaf

--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Previous Topic:managed to run tptp, but not with my application.. please help.
Next Topic:failure running AGR
Goto Forum:
  


Current Time: Thu Apr 25 00:52:26 GMT 2024

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

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

Back to the top