Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
Android.bp | D | 23-Mar-2024 | 1.8 KiB | 74 | 65 | |
README.md | D | 23-Mar-2024 | 1.8 KiB | 94 | 54 | |
enablevlog.cc | D | 23-Mar-2024 | 3.7 KiB | 120 | 81 |
README.md
1# enablevlog 2 3enablevlog is a JVMTI agent designed for changing the VLOG options of a 4running process. Currently it only allows one to turn vlog options 'on'. 5 6# Usage 7### Build 8> `m libenablevlog` 9 10The libraries will be built for 32-bit, 64-bit, host and target. Below 11examples assume you want to use the 64-bit version. 12 13Use `libenablevlogs` if you wish to build a version without non-NDK dynamic 14dependencies. 15 16### Command Line 17 18The agent is loaded using -agentpath like normal. It takes arguments in the 19following format: 20 21`[vlog1[,vlog2[,...]]]` 22 23It will cause the runtime to act as though you had passed these after the 24`-verbose:[...]` argument to `dalvikvm`. 25 26#### Supported events 27 28At the time of writing, the following events may be listened for with this agent 29 30* `class` 31 32* `collector` 33 34* `compiler` 35 36* `deopt` 37 38* `gc` 39 40* `heap` 41 42* `interpreter` 43 44* `jdwp` 45 46* `jit` 47 48* `jni` 49 50* `monitor` 51 52* `oat` 53 54* `profiler` 55 56* `signals` 57 58* `simulator` 59 60* `startup` 61 62* `third-party-jni` 63 64* `threads` 65 66* `verifier` 67 68* `verifier-debug` 69 70* `image` 71 72* `systrace-locks` 73 74* `plugin` 75 76* `agents` 77 78* `dex` 79 80These are not particularly stable and new options might get added. Examine 81the LogVerbosity struct definition and the parser for a up-to-date list. 82 83#### ART 84> `art -Xplugin:$ANDROID_HOST_OUT/lib64/libopenjdkjvmti.so '-agentpath:libenablevlog.so=class,profiler' -cp tmp/java/helloworld.dex -Xint helloworld` 85 86* `-Xplugin` and `-agentpath` need to be used, otherwise the agent will fail during init. 87* If using `libartd.so`, make sure to use the debug version of jvmti. 88 89> `adb shell setenforce 0` 90> 91> `adb push $ANDROID_PRODUCT_OUT/system/lib64/libenablevlog.so /data/local/tmp/` 92> 93> `adb shell am start-activity --attach-agent /data/local/tmp/libenablevlog.so=class,jit some.debuggable.apps/.the.app.MainActivity` 94