• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

Android.bpD23-Nov-20231.9 KiB8678

README.mdD23-Nov-20231.5 KiB3622

jitload.ccD23-Nov-20234.8 KiB145104

README.md

1# jitload
2
3Jitload is an art-specific agent allowing one to count the number of classes
4loaded on the jit-thread or verify that none were.
5
6# Usage
7### Build
8>    `make libjitload`  # or 'make libjitloadd' with debugging checks enabled
9
10The libraries will be built for 32-bit, 64-bit, host and target. Below examples assume you want to use the 64-bit version.
11### Command Line
12
13>    `art -Xplugin:$ANDROID_HOST_OUT/lib64/libopenjdkjvmti.so -agentpath:$ANDROID_HOST_OUT/lib64/libjitload.so -cp tmp/java/helloworld.dex -Xint helloworld`
14
15* `-Xplugin` and `-agentpath` need to be used, otherwise libtitrace agent will fail during init.
16* If using `libartd.so`, make sure to use the debug version of jvmti and agent.
17* Pass the '=fatal' option to the agent to cause it to abort if any classes are
18  loaded on a jit thread. Otherwise a warning will be printed.
19
20>    `art -d -Xplugin:$ANDROID_HOST_OUT/lib64/libopenjdkjvmtid.so -agentpath:$ANDROID_HOST_OUT/lib64/libjitloadd.so=fatal -cp tmp/java/helloworld.dex -Xint helloworld`
21
22* To use with run-test or testrunner.py use the --with-agent argument.
23
24>    `./test/run-test --host --with-agent libtitraced.so=fatal 001-HelloWorld`
25
26
27### Printing the Results
28All statistics gathered during the trace are printed automatically when the
29program normally exits. In the case of Android applications, they are always
30killed, so we need to manually print the results.
31
32>    `kill -SIGQUIT $(pid com.example.android.displayingbitmaps)`
33
34Will initiate a dump of the counts (to logcat).
35
36