@@ -2,16 +2,24 @@ Loader for AsyncProfiler
22========================
33
44Packages [ async-profiler] ( https://github.com/jvm-profiling-tools/async-profiler ) releases in a JAR
5- with a ` AsyncProfilerLoader ` that loads the suitable native library for the current platform.
5+ with a ` AsyncProfilerLoader ` (version 2+) that loads the suitable native library for the current platform.
66
77This is usable as a java agent (same arguments as the async-profiler agent) and as the basis for other libraries.
88The real rationale behind this library is that the async-profiler is a nice tool, but it cannot be easily integrated
99into other Java based tools.
1010
11- Take the ` all ` build and you have a JAR that provides the important features of async-profiler on all supported platforms:
11+ The wrapper is tested against all relevant tests of the async-profiler tool, ensuring that it has the same behavior.
12+
13+ Take the ` all ` build and you have a JAR that provides the important features of async-profiler on all supported
14+ platforms.
1215
1316A changelog can be found at the async-profiler repository, as this library should rarely change itself.
1417
18+ _ This project assumes that you used async-profiler before, if not, don't worry, you can still use this project,
19+ but be aware that it's documentation refers you to the async-profiler documentation a lot._
20+
21+ _ fdtransfer is currently not supported, feel free to create an issue if you need it._
22+
1523Supported Platforms
1624-------------------
1725
@@ -30,27 +38,29 @@ Commands
3038
3139The following is a more in-depth description of the commands of ` java -jar ap-loader.jar ` .
3240
33- Be aware that it is recommended to use run the JVM with the
34- ` -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints ` flags when attaching to a running JVM .
41+ Be aware that it is recommended to use run the JVM with the
42+ ` -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints ` flags.
3543This improves the accuracy of the profiler.
3644
3745Overview over the commands:
3846
3947``` sh
4048Usage: java -jar ap-loader.jar < command> [args]
4149Commands:
42- help show this help
43- jattach run the included jattach binary
44- profiler run the included profiler.sh
45- supported fails if this JAR does not include a profiler for the current OS and architecture
46- converter run the included converter JAR
47- version version of the included async-profiler
48- clear clear the directory used for storing extracted files
50+ help show this help
51+ jattach run the included jattach binary
52+ profiler run the included profiler.sh
53+ agentpath prints the path of the extracted async-profiler agent
54+ jattachpath prints the path of the extracted jattach binary
55+ supported fails if this JAR does not include a profiler for the current OS and architecture
56+ converter run the included converter JAR
57+ version version of the included async-profiler
58+ clear clear the directory used for storing extracted files
4959` ` `
5060
5161# ## jattach
5262
53- ` java -jar ap-loader.jar jattach` is equivalent to calling the suitable ` jattach` binary
63+ ` java -jar ap-loader.jar jattach` is equivalent to calling the suitable ` jattach` binary
5464from [GitHub](https://github.com/apangin/jattach)> :
5565
5666` ` ` sh
@@ -67,6 +77,7 @@ java -jar ap-loader.jar jattach <pid> jcmd "help -all"
6777See the [GitHub page of jattach](https://github.com/apangin/jattach) for more details.
6878
6979# ## profiler
80+
7081` java -jar ap-loader.jar profiler` is equivalent to calling the suitable ` profiler.sh` :
7182
7283` ` ` sh
@@ -97,7 +108,7 @@ java -jar ap-loader.jar converter jfr2flame <input.jfr> <output.html>
97108
98109The available converters depend on the included async-profiler version.
99110Call ` java -jar converter` to a list of available converters, see
100- [the source code on GitHub](https://github.com/jvm-profiling-tools/async-profiler/blob/master/src/converter/Main.java)
111+ [the source code on GitHub](https://github.com/jvm-profiling-tools/async-profiler/blob/master/src/converter/Main.java)
101112for more details.
102113
103114# ## clear
@@ -127,18 +138,21 @@ Using in Java code
127138Then you can use the ` AsyncProfilerLoader` class to load the native library:
128139
129140` ` ` java
130- AsyncProfiler profiler + one.profiler.AsyncProfilerLoader.load ();
141+ AsyncProfiler profiler = one.profiler.AsyncProfilerLoader.load ();
131142` ` `
132143
133- ` AsyncProfiler` is the [main API class](https://github.com/jvm-profiling-tools/async-profiler/blob/master/src/api/one/profiler/AsyncProfiler.java)
144+ ` AsyncProfiler` is
145+ the [main API class](https://github.com/jvm-profiling-tools/async-profiler/blob/master/src/api/one/profiler/AsyncProfiler.java)
134146from the async-profiler.jar.
135147
136148The API of the ` AsyncProfilerLoader` can be used to execute all commands the CLI programmatically.
137149
138150# ## Snapsshots
151+
139152We currently only release to snapshop, as the API is not stable yet.
140153
141154` ` ` xml
155+
142156< dependency>
143157 < groupId> me.bechberger< /groupId>
144158 < artifactId> ap-loader< /artifactId>
@@ -147,7 +161,9 @@ We currently only release to snapshop, as the API is not stable yet.
147161` ` `
148162
149163For example for the all variant of version 2.8.3:
164+
150165` ` ` xml
166+
151167< dependency>
152168 < groupId> me.bechberger< /groupId>
153169 < artifactId> ap-loader< /artifactId>
@@ -156,7 +172,9 @@ For example for the all variant of version 2.8.3:
156172` ` `
157173
158174You also have to add the snapshot repository:
175+
159176` ` ` xml
177+
160178< repositories>
161179 < repository>
162180 < id> snapshots< /id>
@@ -171,7 +189,6 @@ You also have to add the snapshot repository:
171189< /repositories>
172190` ` `
173191
174-
175192Build and test
176193--------------
177194
@@ -187,21 +204,41 @@ unzip -o async-profiler-2.8.3-macos.zip -d ap-releases
187204# build the JAR for the release
188205# maven might throw warnings, related to the project version setting,
189206# but the alternative solutions don't work, so we ignore the warning for now
190- mvn -Dproject.versionPlatform=2.8.3-macos assembly:single
207+ mvn -Dproject.versionPlatform=2.8.3-macos package assembly:single
191208# use it
192209java -jar target/ap-loader-2.8.3-macos-full.jar ...
193210# build the all JAR
194- mvn -Dproject.versionPlatform=2.8.3-all -f pom_all.xml assembly:single
211+ mvn -Dproject.versionPlatform=2.8.3-all -f pom_all.xml package assembly:single
195212` ` `
196213
197214Development
198215-----------
199216This project is written in Java 8, to support all relevant platforms.
200- The feature set should not increase beyond what is currently:
217+ The feature set should not increase beyond what is currently:
201218Just build your library on top of it. But I' m of course happy for bug reports and fixes.
202219
203220The code is formatted using [google-java-format](https://github.com/google/google-java-format).
204221
222+ ### bin/releaser.py
223+
224+ ```sh
225+ Usage:
226+ python3 ./bin/releaser.py <command> ... <command> [release or current if not present]
227+
228+ Commands:
229+ current_version print the youngest released version of async-profiler
230+ versions print all released versions of async-profiler (supported by this project)
231+ download download and prepare the folders for the given release
232+ build build the wrappers for the given release
233+ test test the given release
234+ deploy deploy the wrappers for the given release, i.e., use "mvn deploy"
235+ clear clear the ap-releases and target folders for a fresh start
236+
237+ Environment variables:
238+ JAVA_VERSIONS comma-separated list of Java versions to test with
239+ (in the form of sdkman! version names, e.g. 17.0.1-sapmchn)
240+ ```
241+
205242License
206243-------
207244Apache 2.0
0 commit comments