论坛首页 综合技术论坛

profile your Eclipse plugins using TPTP

浏览 5216 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-08-13  
At end of project development, profile your application will become important, at least it's better to know the hot spots of your application, and think about improving it.

There exist many different commercial and open source  profile tools for java, but in Eclipse area, TPTP seems the best choice because TPTP itself is a suite of Eclipse plugins too.

TPTP(http://www.eclipse.org/tptp/) is a giant/complex project of Eclipse, it try to supply a one stop solution based on Eclipse, which include testing, monitoring, tracing and profiling functionalities.

Most of documents and tutorials of TPTP are focus on how to profiling a java Application(even Eclipse workbench itself is a java Application too, but at least, it's has special feautres), but ignore how to profiling Eclipse plugins, or the runtime workbench of Eclipse when you debugging your Eclipse plugins, which most of Eclipse plugin developers are interesting on

TPTP profiling using Agent mechanism to collect data, the latest release of TPTP also include a IAC(Integrated Agent Controller) to make profiling simple, but unfortunately it's hard to profile Eclipse plugin using IAC, it seems can't  profile Eclipse plugin at all even it's very convenient to profile a standalone java Application, so here I will profile Eclipse plugin using stand alone Agent Controller, also all examples here are running on Linux.

1. prepare environment

a. First, you need install Eclipse and TPTP
[url] http://www.eclipse.org/tptp/home/downloads/ [/url]
[url]http://www.eclipse.org/tptp/home/downloads/installguide/InstallGuide44.html [/url]

b. Install Agent Controller, you could test it follow tutorial below
[url] http://www.eclipse.org/tptp/home/downloads/ [/url]
http://www.eclipse.org/tptp/home/downloads/installguide/agentcontroller_44/linux/getting_started.html


2. profile steps

a. start Agent Controller
$ACStart


b. start your runtime workbench which containts all of your plugins using JVM arguments below
-XrunpiAgent:server=enabled


or you can start a Eclipse workbench which include all of your plugins using command like

eclipse -vmargs -XrunpiAgent:server=enabled


the -XrunpiAgent will notice Agent Controller of your instance of Eclipse workbench, if you work on Linux you need set LD_LIBRARY_PATH before you start piAgent like

$export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/local/<agent controller dir>/lib


if you work on Windows, add directory above to your PATH environment

c. do profile
* start a Eclipse workbench
* switch to "profiling and logging" perspective
* open profile configuration dialog, create a new "Attach - Java process" entry
* select the running Agent from Host tab, you can't use "Local Direct Connection" because we use a stand alone Agent Controller now, you could verify the agent from the PID you get, which must equtal to PID of your Eclipse workbench which contains all of your plugins
* then set the profile filter set for your plugins
* click profile button, do profile, that's it.
   发表时间:2007-10-28  
hah, 我也写了一篇,需要指出的是AC, 在最新的tptp里不是必须的,tptp会自动启动ac, 此外jdk6
里,应用启动的参数有所不同, 具体请拜读http://maomaode.bokeland.com/blog/3/96/2007/10/28/290059
hehmao
0 请登录后投票
   发表时间:2007-10-29  
maomaode 写道
hah, 我也写了一篇,需要指出的是AC, 在最新的tptp里不是必须的,tptp会自动启动ac, 此外jdk6
里,应用启动的参数有所不同, 具体请拜读http://maomaode.bokeland.com/blog/3/96/2007/10/28/290059
hehmao
sure, but the AC which stared by TPTP automatically doesn't suit for Eclipse plugin profiling, it's a java implementation and the performance is very bad. Actually even native AC is a little bit slow because profiling need tons of data collection.
0 请登录后投票
论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics