Fully featured low overhead profiler for Java EE and Java SE platforms.
Performance monitoring and profiling of Jenkins, TeamCity, Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

EAP 602: scripting problems

Moderators: Vladimir Kondratyev, Anton Katilin

EAP 602: scripting problems

Postby mschulz » Tue May 17, 2005 12:45 am

Hi,

I have a couple of suggestions to improve you Unix scripts:

1) yjp.sh

If YJP_JAVA_HOME is not set, the result is to pick up /bin/java.
That's not good enough (since I have JAVA_HOME set).
So please test "$YJP_JAVA_HOME" != "":
if [ "$YJP_JAVA_HOME" != "" ] ; then
JAVA_EXE=$YJP_JAVA_HOME/bin/java
fi

2) Tomcat, the modified startup_with_yjp.sh script:
Since you elect to expand YJP to 'YourKit Java Profiler 4.5 EAP build 602.app',
that will require quotes in all places which set shell variables:

_YH_="/tmp/YourKit Java Profiler 4.5 EAP build 602.app"
and subsequently in all places where _YH_ is being used.
mschulz
 
Posts: 17
Joined: Mon May 16, 2005 8:40 pm

Postby Anton Katilin » Tue May 17, 2005 8:09 am

1) yjp.sh

If YJP_JAVA_HOME is not set, the result is to pick up /bin/java.
That's not good enough (since I have JAVA_HOME set).
So please test "$YJP_JAVA_HOME" != "":
if [ "$YJP_JAVA_HOME" != "" ] ; then
JAVA_EXE=$YJP_JAVA_HOME/bin/java
fi



I'm sorry, I'm afraid I do not understand what's wrong.

The script yjp.sh actually probes YJP_JAVA_HOME, then JAVA_HOME, and only then java in PATH.

So if you have JAVA_HOME specified, it should be used.


2) Tomcat, the modified startup_with_yjp.sh script:
Since you elect to expand YJP to 'YourKit Java Profiler 4.5 EAP build 602.app',
that will require quotes in all places which set shell variables:

_YH_="/tmp/YourKit Java Profiler 4.5 EAP build 602.app"
and subsequently in all places where _YH_ is being used.


Corrected in 606, thank you.
Anton Katilin
 
Posts: 5966
Joined: Wed Aug 11, 2004 8:37 am

Postby mschulz » Tue May 17, 2005 4:00 pm

I have YJP_JAVA_HOME _not_ defined.

Hence, the script probes /bin/java,
which happens to exist, but it is not the desired one.
mschulz
 
Posts: 17
Joined: Mon May 16, 2005 8:40 pm

Postby Anton Katilin » Tue May 17, 2005 4:42 pm

If you have YJP_JAVA_HOME not defined, but JAVA_HOME defined, it will take JAVA_HOME. Isn't it what you desire?
Anton Katilin
 
Posts: 5966
Joined: Wed Aug 11, 2004 8:37 am

Postby mschulz » Tue May 17, 2005 5:41 pm

The difference is with the program sitting there as /bin/java.

If you don't have that, everything is fine. But then try:

cat > /bin/java
#!/bin/sh
echo "Gotcha!"
^D
chmod 755 /bin/java.

Then try again yjp.sh
mschulz
 
Posts: 17
Joined: Mon May 16, 2005 8:40 pm

Postby Anton Katilin » Tue May 17, 2005 6:13 pm

Now I see the problem, thanks a lot!

Build 606 will contain a fix.
Anton Katilin
 
Posts: 5966
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.