// // JitLogger supports two approaches of perf profiling. // // (1) perf-map: // The perf-map mechanism generates perf-PID.map file, // which provides simple "address, size, method_name" information to perf, // and allows perf to map samples in jit-code-cache to jitted method symbols. // // Command line Example: // $ perf record dalvikvm -Xcompiler-option --generate-debug-info -cp <classpath> Test // $ perf report // NOTE: // - Make sure that the perf-PID.map file is available for 'perf report' tool to access, // so that jitted method can be displayed. // // // (2) perf-inject: // The perf-inject mechansim generates jit-PID.dump file, // which provides rich informations about a jitted method. // It allows perf or other profiling tools to do advanced analysis on jitted code, // for example instruction level profiling. // // Command line Example: // $ perf record -k mono dalvikvm -Xcompiler-option --generate-debug-info -cp <classpath> Test // $ perf inject -j -i perf.data -o perf.data.jitted // $ perf report -i perf.data.jitted // $ perf annotate -i perf.data.jitted // NOTE: // REQUIREMENTS // - The 'perf record -k mono' option requires 4.1 (or higher) Linux kernel. // - The 'perf inject' (generating jit ELF files feature) requires perf 4.6 (or higher). // PERF RECORD // - The '-k mono' option tells 'perf record' to use CLOCK_MONOTONIC clock during sampling; // which is required by 'perf inject', to make sure that both perf.data and jit-PID.dump // have unified clock source for timestamps. // PERF INJECT // - The 'perf inject' tool injects information from jit-PID.dump into perf.data file, // and generates small ELF files (jitted-TID-CODEID.so) for each jitted method. // - On Android devices, the jit-PID.dump file is generated in /data/misc/trace/ folder, and // such location is recorded in perf.data file. // The 'perf inject' tool is going to look for jit-PID.dump and generates small ELF files in // this /data/misc/trace/ folder. // Make sure that you have the read/write access to /data/misc/trace/ folder. // - On non-Android devices, the jit-PID.dump file is generated in /tmp/ folder, and // 'perf inject' tool operates on this folder. // Make sure that you have the read/write access to /tmp/ folder. // - If you are executing 'perf inject' on non-Android devices (host), but perf.data and // jit-PID.dump files are adb-pulled from Android devices, make sure that there is a // /data/misc/trace/ folder on host, and jit-PID.dump file is copied to this folder. // - Currently 'perf inject' doesn't provide option to change the path for jit-PID.dump and // generated ELF files. // PERF ANNOTATE // - The 'perf annotate' tool displays assembly level profiling report. // Source code can also be displayed if the ELF file has debug symbols. // - Make sure above small ELF files are available for 'perf annotate' tool to access, // so that jitted code can be displayed in assembly view. // class JitLogger { public:
JitLogger() : code_index_(0), marker_address_(nullptr) {}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.