Home » Archived » Test and Performance Tools Platform (TPTP) » Problems when profiling a standalone tomcat
Problems when profiling a standalone tomcat [message #117150] |
Mon, 05 November 2007 12:35  |
Eclipse User |
|
|
|
Originally posted by: wjfang.gmail.com
Hello,
I partially succeed to profile a standalone tomcat by setting up the
following java option:
-agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf
But two annoying problems exist:
1. I set up a filter including only my classes and excluding all others. But
many org.apache.*, java.* classes are still being profiled. And they are not
directly called from my classes.
2. Profiling data can only be captured when tomcat is attached from the very
beginning. If I start tomcat, run some client test code to warm it up, then
let eclipse tptp profiler to attach to the tomcat to capture profiling data,
no data is captured!
Is it because TPTP agent only instrument bytecodes when they are first
loaded? So when all classes are loaded, attaching profiler to tomcat has no
chance to instrument bytecode.
Any insight or suggestions? Many thanks in advance!
Jerry
|
|
|
Re: Problems when profiling a standalone tomcat [message #117539 is a reply to message #117150] |
Thu, 08 November 2007 04:47   |
Eclipse User |
|
|
|
Hi,
Please specify the exact versions of OS, Tomcat, Java and TPTP you are
using.
> Hello,
>
> I partially succeed to profile a standalone tomcat by setting up the
> following java option:
> -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf
>
> But two annoying problems exist:
>
> 1. I set up a filter including only my classes and excluding all others. But
> many org.apache.*, java.* classes are still being profiled. And they are not
> directly called from my classes.
Please specify whether you are using a filters file or applying filters
when you attach from the workbench.
Notethat filters file is supported only when running the profiler in
"standalone" mode. When running in "enabled" mode, the filters are
specified from the workbench when you attach. No profiling data is ever
collected until you attach.
>
> 2. Profiling data can only be captured when tomcat is attached from the very
> beginning. If I start tomcat, run some client test code to warm it up, then
> let eclipse tptp profiler to attach to the tomcat to capture profiling data,
> no data is captured!
I am not sure I fully understand what you are doing. To attach to Tomcat
from the "very beginning", you should use "controlled" mode and not
"enabled" mode.
Can you please describe this use-case in more details so we can better
understand the problem?
>
> Is it because TPTP agent only instrument bytecodes when they are first
> loaded? So when all classes are loaded, attaching profiler to tomcat has no
> chance to instrument bytecode.
This depends on the version of TPTP you're using. Assuming you are using
the latest Java profiler for Java 5+ (that is, version 4.4.0.3 or
later), instrumentation takes place depending on the mode the profiler
is running in. In "standalone" and "controlled" mode, instrumentation
happens during class load (JVMTI ClassFileLoadHook event) since the
profiler has full control of the application from the beginning. In
"enabled" mode, byte-code instrumentation happens dynamically, using the
JVMTI RedefineClasses feature, only when you attach. While detached,
your application is running in full speed without any bytecode
modifications.
Earlier versions of the Java 5+ Profiler do not use dynamic
instrumentation and do not fully support dynamic attach scenarios.
HTH,
Asaf
--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
|
|
|
Re: Problems when profiling a standalone tomcat [message #117552 is a reply to message #117539] |
Thu, 08 November 2007 05:07   |
Eclipse User |
|
|
|
Originally posted by: wjfang.gmail.com
OS: windows xp professional
tomcat: 5.0.28, running on java 1.5.0_10
eclipse: 3.3
TPTP: 4.4.1, running on java 1.6.0_03
Thanks.
"Asaf Yaffe" <asaf.yaffe@intel.com> wrote in message
news:fgum0b$s9h$1@build.eclipse.org...
> Hi,
>
> Please specify the exact versions of OS, Tomcat, Java and TPTP you are
> using.
>
>> Hello,
>>
>> I partially succeed to profile a standalone tomcat by setting up the
>> following java option:
>> -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf
>>
>> But two annoying problems exist:
>>
>> 1. I set up a filter including only my classes and excluding all others.
>> But many org.apache.*, java.* classes are still being profiled. And they
>> are not directly called from my classes.
>
> Please specify whether you are using a filters file or applying filters
> when you attach from the workbench.
>
> Notethat filters file is supported only when running the profiler in
> "standalone" mode. When running in "enabled" mode, the filters are
> specified from the workbench when you attach. No profiling data is ever
> collected until you attach.
>
>>
>> 2. Profiling data can only be captured when tomcat is attached from the
>> very beginning. If I start tomcat, run some client test code to warm it
>> up, then let eclipse tptp profiler to attach to the tomcat to capture
>> profiling data, no data is captured!
>
> I am not sure I fully understand what you are doing. To attach to Tomcat
> from the "very beginning", you should use "controlled" mode and not
> "enabled" mode.
>
> Can you please describe this use-case in more details so we can better
> understand the problem?
>
>>
>> Is it because TPTP agent only instrument bytecodes when they are first
>> loaded? So when all classes are loaded, attaching profiler to tomcat has
>> no chance to instrument bytecode.
>
> This depends on the version of TPTP you're using. Assuming you are using
> the latest Java profiler for Java 5+ (that is, version 4.4.0.3 or later),
> instrumentation takes place depending on the mode the profiler is running
> in. In "standalone" and "controlled" mode, instrumentation happens during
> class load (JVMTI ClassFileLoadHook event) since the profiler has full
> control of the application from the beginning. In "enabled" mode,
> byte-code instrumentation happens dynamically, using the JVMTI
> RedefineClasses feature, only when you attach. While detached, your
> application is running in full speed without any bytecode modifications.
>
> Earlier versions of the Java 5+ Profiler do not use dynamic
> instrumentation and do not fully support dynamic attach scenarios.
>
> HTH,
>
> Asaf
>
> --
> Asaf Yaffe
> Eclipse TPTP Committer, JVMTI Profiler
|
|
| |
Re: Problems when profiling a standalone tomcat [message #118086 is a reply to message #117539] |
Tue, 13 November 2007 05:30  |
Eclipse User |
|
|
|
Originally posted by: wjfang.gmail.com
Sorry about that! Please see below my answers. And many thanks.
"Asaf Yaffe" <asaf.yaffe@intel.com> wrote in message
news:fgum0b$s9h$1@build.eclipse.org...
> Hi,
>
> Please specify the exact versions of OS, Tomcat, Java and TPTP you are
> using.
>
OS: windows xp professional
tomcat: 5.0.28, running on jdk 1.6.0
eclipse: 3.3
TPTP: 4.4.1, running on jre 1.6.0_03
>> Hello,
>>
>> I partially succeed to profile a standalone tomcat by setting up the
>> following java option:
>> -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf
>>
>> But two annoying problems exist:
>>
>> 1. I set up a filter including only my classes and excluding all others.
>> But many org.apache.*, java.* classes are still being profiled. And they
>> are not directly called from my classes.
>
> Please specify whether you are using a filters file or applying filters
> when you attach from the workbench.
>
I am applying filters when attaching from the workbench.
> Notethat filters file is supported only when running the profiler in
> "standalone" mode. When running in "enabled" mode, the filters are
> specified from the workbench when you attach. No profiling data is ever
> collected until you attach.
>
>>
>> 2. Profiling data can only be captured when tomcat is attached from the
>> very beginning. If I start tomcat, run some client test code to warm it
>> up, then let eclipse tptp profiler to attach to the tomcat to capture
>> profiling data, no data is captured!
>
> I am not sure I fully understand what you are doing. To attach to Tomcat
> from the "very beginning", you should use "controlled" mode and not
> "enabled" mode.
>
> Can you please describe this use-case in more details so we can better
> understand the problem?
>
I do the following steps:
1. Run Tomcat in "enabled" mode.
2. Attach TPTP profiler to Tomcat from the workbench.
3. Parse the monitoring by pressing the "parse monitoring" button in the
"profiling monitor" view of the "profiling and logging" perspective.
4. Invoke some warm-up tests to warm up Tomcat.
5. Resuming the monitoring by press the "start monitoring" button in the
"profiling monitor" view of the "profiling and logging" perspective.
6. Invoke the tests to be profiled. At this stage, no profiling data can be
seen in the "execution statistics" view (refreshing applied).
I also re-order the above steps in the following sequence:
1, 4, 2, 6.
Some org.apache.axis.* methods are captured. But no my methods are captured.
Cheers,
Weijian
>>
>> Is it because TPTP agent only instrument bytecodes when they are first
>> loaded? So when all classes are loaded, attaching profiler to tomcat has
>> no chance to instrument bytecode.
>
> This depends on the version of TPTP you're using. Assuming you are using
> the latest Java profiler for Java 5+ (that is, version 4.4.0.3 or later),
> instrumentation takes place depending on the mode the profiler is running
> in. In "standalone" and "controlled" mode, instrumentation happens during
> class load (JVMTI ClassFileLoadHook event) since the profiler has full
> control of the application from the beginning. In "enabled" mode,
> byte-code instrumentation happens dynamically, using the JVMTI
> RedefineClasses feature, only when you attach. While detached, your
> application is running in full speed without any bytecode modifications.
>
> Earlier versions of the Java 5+ Profiler do not use dynamic
> instrumentation and do not fully support dynamic attach scenarios.
>
> HTH,
>
> Asaf
>
> --
> Asaf Yaffe
> Eclipse TPTP Committer, JVMTI Profiler
|
|
|
Goto Forum:
Current Time: Thu May 08 17:02:38 EDT 2025
Powered by FUDForum. Page generated in 0.06549 seconds
|