You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/java-perf-flamegraph/3_agent.md
+19-9Lines changed: 19 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,31 +8,41 @@ layout: learningpathall
8
8
---
9
9
10
10
## Java Flame Graph Generation via Java agent and perf
11
-
To profile a Java application with perf and ensure proper symbol resolution, you must include libperf-jvmti.so when launching the Java application.
12
-
- libperf-jvmti.so is a JVM TI agent library enabling perf to resolve Java symbols, facilitating accurate profiling of Java applications.
13
-
- A specialized shared library, libperf-jvmti.so bridges perf and the JVM, enabling proper translation of memory addresses to Java method names during profiling.
11
+
To profile a Java application with perf and ensure proper symbol resolution, you must include `libperf-jvmti.so` when launching the Java application.
12
+
-`libperf-jvmti.so` is a JVM TI agent library enabling perf to resolve Java symbols, facilitating accurate profiling of Java applications.
13
+
- A specialized shared library, `libperf-jvmti.so` bridges perf and the JVM, enabling proper translation of memory addresses to Java method names during profiling.
14
14
15
-
1. Find and add libperf-jvmti.so to Java option
15
+
1. Find where `libperf-jvmti.so` is installed on your Arm-based Linux server:
16
+
```bash
17
+
pushd /usr/lib
18
+
find . -name libperf-jvmti.so`
19
+
```
20
+
The output will show the path of the library that you will then include in your Tomcat setup file:
Add JAVA_OPTS="$JAVA_OPTS -agentpath:/usr/lib/linux-tools-6.8.0-63/libperf-jvmti.so -XX:+PreserveFramePointer" to `catalina.sh`. Make sure the path matches the location on your machine from the previous step.
25
+
26
+
Now shutdown and restart Tomcat:
27
+
```bash
19
28
cd apache-tomcat-11.0.9/bin
20
29
./shutdown.sh
21
30
./startup.sh
22
31
```
23
32
24
-
2. Use perf to profile Tomcat, and restart wrk if necessary
33
+
2. Use perf to profile Tomcat, and restart wrk that running on your x86 instance if necessary:
0 commit comments