Skip to content

Commit

Permalink
建立lib、bin目录结构,添加类unix(linux、mac等)命令行sampler-log-analysis,
Browse files Browse the repository at this point in the history
tprofiler-client,tprofiler-log-analysis
  • Loading branch information
manlge committed Aug 22, 2013
1 parent 5cf496b commit c5e9ad7
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 12 deletions.
19 changes: 10 additions & 9 deletions README
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
TProfiler is a code profiling tool.
author:[email protected]
Note: TProfiler requires Java6™ VM.
Please refer to Wiki for more information:
https://github.com/alibaba/TProfiler/wiki
TProfiler is a code profiling tool.

author:[email protected]

Note: TProfiler requires Java6™ VM.

Please refer to Wiki for more information:
https://github.com/alibaba/TProfiler/wiki

The source code is available using the GPL version 2. We are actively looking for contributors, so if you have any ideas, bug reports, or patches you would like to contribute please do not hesitate to do that.

67 changes: 67 additions & 0 deletions dist/TProfiler/bin/common-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/sh

# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
if [ -z "$JAVA_VERSION" ] ; then
JAVA_VERSION="CurrentJDK"
fi
if [ -z "$JAVA_HOME" ] ; then
JAVA_HOME=`/usr/libexec/java_home`
fi
;;
esac

if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi

if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" -a ! "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
javaExecutable="`readlink -f \"$javaExecutable\"`"
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi

if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi

if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD"
exit 1
fi

if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi

TP_HOME=$(dirname $0)/..

CLASS_PATH=$TP_HOME/lib/tprofiler-1.0.1.jar

7 changes: 7 additions & 0 deletions dist/TProfiler/bin/sampler-log-analysis
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

. $(dirname $0)/common-env

MAIN_CLASS=com.taobao.profile.analysis.SamplerLogAnalysis

exec "$JAVACMD" -classpath $CLASS_PATH $MAIN_CLASS "$@"
7 changes: 7 additions & 0 deletions dist/TProfiler/bin/tprofiler-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

. $(dirname $0)/common-env

MAIN_CLASS=com.taobao.profile.client.TProfilerClient

exec "$JAVACMD" -classpath $CLASS_PATH $MAIN_CLASS "$@"
7 changes: 7 additions & 0 deletions dist/TProfiler/bin/tprofiler-log-analysis
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

. $(dirname $0)/common-env

MAIN_CLASS=com.taobao.profile.analysis.ProfilerLogAnalysis

exec "$JAVACMD" -classpath $CLASS_PATH $MAIN_CLASS "$@"
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ logFilePath = ${user.home}/logs/${logFileName}
methodFilePath = ${user.home}/logs/${methodFileName}
samplerFilePath = ${user.home}/logs/${samplerFileName}

#exclude & excludes items
#include & excludes items
excludeClassLoader = org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
includePackageStartsWith = com.taobao;com.taobao.common
excludePackageStartsWith = com.taobao.sketch;org.apache.velocity;com.alibaba;com.taobao.forest.domain.dataobject
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.taobao</groupId>
<artifactId>tprofiler</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<name>profile</name>
<packaging>jar</packaging>
<dependencies>
Expand Down Expand Up @@ -47,6 +47,7 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>dist/TProfiler/lib</outputDirectory>
<archive>
<manifestEntries>
<Premain-Class>com.taobao.profile.Main</Premain-Class>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/profile.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ logFilePath = ${user.home}/logs/${logFileName}
methodFilePath = ${user.home}/logs/${methodFileName}
samplerFilePath = ${user.home}/logs/${samplerFileName}

#exclude & excludes items
#include & excludes items
excludeClassLoader = org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
includePackageStartsWith = com.taobao;com.taobao.common
excludePackageStartsWith = com.taobao.sketch;org.apache.velocity;com.alibaba;com.taobao.forest.domain.dataobject

0 comments on commit c5e9ad7

Please sign in to comment.