https://github.com/yinheli/lightweight-java-profiler
forked from from code.google.com/p/lightweight-java-profiler
https://github.com/yinheli/lightweight-java-profiler
Last synced: 6 months ago
JSON representation
forked from from code.google.com/p/lightweight-java-profiler
- Host: GitHub
- URL: https://github.com/yinheli/lightweight-java-profiler
- Owner: yinheli
- License: apache-2.0
- Created: 2015-08-11T02:32:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-06T06:59:32.000Z (over 9 years ago)
- Last Synced: 2023-03-21T23:56:17.981Z (about 2 years ago)
- Language: C++
- Homepage:
- Size: 164 KB
- Stars: 9
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# lightweight-java-profiler
> the project is forked from code.google.com/p/lightweight-java-profiler
## GettingStarted
### Introduction
This document contains information on how to use the profiler.
### Details
First, check out the profiler:
> svn checkout http://lightweight-java-profiler.googlecode.com/svn/trunk/ lightweight-java-profiler-read-only
Then change into the directory, and build:> cd lightweight-java-profiler-read-only
> make all### build
#### install dependencies
```
sudo apt-get install gcc g++ g++-multilib
```#### make
```
make all
```It defaults to a 32-bit build; it will place the resulting liblagent.so file in the build-32 directory; if you want to have a 64-bit build, say "make BITS=64 all" instead.
To use the profiler, you can invoke Java as follows:
> java -agentpath:path/to/liblagent.so[:file=fname]
It will spit out stack traces into traces.txt (or into the optional fname passed to the agent). The current implementation samples every 1/100th of a second. It stores the first 3000 stack traces it encounters; additional stack traces will be ignored, but duplicate stack traces will continue to be counted indefinitely (or until the counter overflows, which will take a while).
Yes, this is a horrible user interface. I imagine it would be relatively straightforward to spit out results in dot, or create any interface you want for parsing the output. Patches welcome.
### gen Flame Graph
```
git clone http://github.com/brendangregg/FlameGraph
cd FlameGraph
./stackcollapse-ljp.awk < ../traces.txt | ./flamegraph.pl > ../traces.svg
```more detail see http://www.brendangregg.com/blog/2014-06-12/java-flame-graphs.html