aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorSteve Capper <steve.capper@linaro.org>2015-11-13 13:59:50 +0000
committerSteve Capper <steve.capper@linaro.org>2015-11-13 13:59:50 +0000
commit6912debd7199ac74e07a134306449be4bbbffa84 (patch)
tree349fa0ce039fa663e2efb31a10d08ea586098cab /README
downloadnative-java-agent-master.tar.gz
Initial CommitHEADmaster
Here is the code for native-java-agent. Signed-off-by: Steve Capper <steve.capper@linaro.org>
Diffstat (limited to 'README')
-rw-r--r--README53
1 files changed, 53 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..1ec1887
--- /dev/null
+++ b/README
@@ -0,0 +1,53 @@
+native-java-agent
+=================
+v0.01 by Steve Capper <steve.capper@linaro.org>
+
+native-java-agent is a library and a Python script that allow Linux
+perf to view information about JIT'ed Java code.
+
+This software acts as a Java Virtual Machine Tools Interface (JVMTI)
+Agent. It is loosely based on perf-map-agent by Johannes Rudolph:
+https://github.com/jrudolph/perf-map-agent
+
+Rather than sample all the function addresses at an instant in time,
+native-java-agent runs throughout the entire workload and captures the
+following as the JVM generates JIT'ed functions:
+ 1) Address offsets and names,
+ 2) Source code filenames, linenumber and bytecode offsets.
+
+Building
+--------
+ cmake .
+ make
+
+
+Recording in Perf
+-----------------
+
+One can invoke perf via:
+
+$ perf record -g java \
+ -agentpath:/full/path/to/libnativejava.so \
+ -jar workload.jar
+
+For JDK9 workloads, I would recommend the following flag be enabled too:
+ -XX:+PreserveFramePointer
+as this will give reliable call stack information.
+
+
+Viewing JIT'ed code in Perf
+---------------------------
+
+One can view JIT'ed code by overriding the default objdump command
+thusly:
+
+$ perf report --objdump=./java-objdump.py
+
+The JAVA_SOURCE_PATH environment variable contains the base paths for
+Java source that java-objdump.py will scan.
+
+Todo
+----
+ * Add attach/detach to already running JVM.
+ * Clean up the Python code a lot!
+ * Test on architectures other than AArch64.