summaryrefslogtreecommitdiffstats
path: root/runtime/profiler.cc
Commit message (Collapse)AuthorAgeFilesLines
* Compile time performance improvements focusing on interpret-only.Ian Rogers2014-09-121-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce virtual method dispatch in the method verifier and make more code inline-able. Add a StringPiece with const char* equality operator to avoid redundant StringPieces and strlens. Remove back link from register line to verifier and pass as argument to reduce size of RegisterLine. Remove instruction length from instruction flags and compute from the instruction, again to reduce size. Add suspend checks to resolve and verify to allow for more easy monitor inflation and reduce contention on Locks::thread_list_suspend_thread_lock_. Change ThrowEarlierClassFailure to throw pre-allocated exception. Avoid calls to Thread::Current() by passing self. Template specialize IsValidClassName. Make ANR reporting with SIGQUIT run using checkpoints rather than suspending all threads. This makes the stack/lock analysis less lock error prone. Extra Barrier assertions and condition variable time out is now returned as a boolean both from Barrier and ConditionVariable::Wait. 2 threaded host x86-64 interpret-only numbers from 341 samples: Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms After change: Avg 139.163% 99% CI 3.027ms to 838.257ms Reduction in average compile time after change is 20.9%. Slow-down without change is 26.5%. Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable could return unresolved type when class loading is disabled. Bug: 17398101 Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
* Remove profiler log lineDave Allison2014-08-211-1/+0
| | | | | | | | | | This removes a LOG(INFO) saying that the profile is disabled. Bug: 17166556 (cherry picked from commit b9c3888380666a7b44718f04f787693787cd57c6) Change-Id: I9c9c470f554605a1183bcf84c5d864f9c4f24f72
* Remove object_utils.h.Ian Rogers2014-07-161-1/+0
| | | | | | | | | Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
* Fix a string uint conversion bug in profilerWei Jin2014-06-301-11/+11
| | | | | | | | | This CL fixes a potential string to uint32_t conversion bug caused by using atoi. The bug can be trigger when the dex_pc or count pass 2^31 - 1. The CL replaces all string uint32_t conversions in profiler to stroul. Change-Id: I54f1aea9c5f5053d79813ea83050ace3749691d6
* Add a new type of profile data in ART profilerWei Jin2014-06-271-110/+251
| | | | | | | | | | | This CL allows the ART profiler to collect bounded stack information that contains only method signature and dex pc on the current stack frames to a bounded depth. The type of the profile data is by default disabled, and can be enabled by setting the option "-Xprofile-type:stack". The bound is controlled by the option "-Xprofile-max-stack-depth:integervalue". Change-Id: Ieab789951018b2263c4d140b40b6c73bffc6a549
* Add an option to enable collecting dex pc in ART profilerWei Jin2014-06-191-43/+161
| | | | | | | | | | This CL allows the ART profiler to collect both method signature and dex pc. The type of the profile data is controlled by the option "-Xprofile-type:{method,dexpc}". To avoid conflicting with the original profile data based on method signatures, the new profile data are stored in files with extension ".pc". Change-Id: I8afb2541d386bff77c5b07fc9367d817a79f58e1
* Change MethodHelper to use a Handle.Mathieu Chartier2014-06-091-4/+2
| | | | | | | | | | | Added ConstHandle to help prevent errors where you modify the value stored in the handle of the caller. Also fixed compaction bugs related to not knowing MethodHelper::GetReturnType can resolve types. This bug was present in interpreter RETURN_OBJECT. Bug: 13077697 Change-Id: I71f964d4d810ab4debda1a09bc968af8f3c874a3
* Fix top K percentage computation when loading profile data.Calin Juravle2014-06-061-6/+3
| | | | | | | | | Don't count boot and null methods when computing top K percentage for sampled methods. Bug: 15462067 Bug: 12877748 Change-Id: I11c2ea541066a15bc8a5ad323e21ccbfdf81c2c5
* Fixed and refactored profiler options handlingCalin Juravle2014-06-061-45/+29
| | | | | | | | | | | | | - extracted profiler options in a separate class - switched from system property reading to command line arguments - added profile based compilation options to CompilerOptions - removed no longer used kProfile compilation filter - optimize dex files only if the profiler is enabled - clean up unused arguments Bug: 12877748 Bug: 15275634 Change-Id: I37ff68e7694370950ce8db2360562e9058ecebb7
* Clean up the sampling profilerCalin Juravle2014-06-061-13/+14
| | | | | | | | | | | | - rename variables/fields names to match the code style (use _underscore_names_) - extract common property parsing in utils.cc - fail to load profile file if any line is malformed - added ProfileFile to manage the profile data generate in the previous runs (replaces ProfileHelper and nests ProfileData) Bug: 12877748 Change-Id: Ie7bda30bfdeb7e78534c986615b0649eac12a97b
* Fix the problem of not shutting down the profiler in ART properlyWei Jin2014-05-271-4/+3
| | | | | | | | | | | | | | | This CL fixes the problem of not saving the last batch of profile data to the external file when the runtime exits before the end of the current iteration of profile sampling. This problem was fixed by shutting down the ART profiler when the runtime exits and allowing the profiler to write the last batch of data even it was signaled to shut down. This CL increases the precision of profile data and fixes the bug that no data is saved if the duration of profile sampling specified by VM arguments (by default 20 seconds) is longer than the length of a single execution because the profiler was never signaled when the runtime exits. Change-Id: I7cc4805b7e2a22a990d04a5b9724ad1d931d7152 Signed-off-by: Wei Jin <wejin@google.com>
* Remove all LOG(DEBUG) which is not intended to be checked inBrian Carlstrom2014-05-091-5/+5
| | | | | Bug: 14632493 Change-Id: Id9da8b87798af0a1b2bd2c178133e5f1ba47d43d
* Fix problem with empty profiles.Dave Allison2014-04-101-1/+1
| | | | | | | | | | This fixes an issue where a profile file was created by the installer but never written by the runtime. This happens when profiles are off. This caused the compiler to think that there are no methods worthy of compilation and skipped everything. Bug: 13960166 Change-Id: I4c4598d4746218e21ca949112071dc1424d7d1f9
* Switch profiler off by defaultDave Allison2014-04-091-8/+6
| | | | Change-Id: I40fdbfa1145a2e80644125932756b8ec7eafd4a2
* Tweaked profile significant_difference.Calin Juravle2014-04-071-1/+98
| | | | | | | | | | - renamed to 'change_thr' - now it represents how much the top K leading samples need to change (in percents) in order to trigger compilation. - extracted ProfileData & file parsing in profiler.h Bug: 12877748 Change-Id: I10f66120dd5e68b8a690bfa0e9914c07f63c50d5
* Unify 64bit int constant definitions.Ian Rogers2014-03-101-1/+1
| | | | | | | LL and ULL prefixes are word size dependent, use the INT64_C and UINT64_C macros instead. Change-Id: I5b70027651898814fc0b3e9e22a18a1047e76cb9
* Make use of profiling information for dex2oatDave Allison2014-03-071-37/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the profile file exists, the compiler driver will read it and store the data in an internal map. Then, when we want to work out whether to compile a method or not, the map is consulted and if the method shows up with a high enough percentage of use we compile it. The profile file itself is created by installd and is writeable by the app. The file is in /data/dalvik-cache/profiles and is named by the package name. This also modifies the profiler itself to: 1. Only count runnable threads (not suspended threads) in the profile 2. Use system properties to allow tuning of the profile parameters 3. Merge profiles from multiple processes using file locking. Bug: 12877748 Change-Id: Iab2f3a327a2860db2a80d5724277d6c626227f2b Conflicts: compiler/dex/frontend.cc compiler/dex/mir_analysis.cc compiler/dex/verification_results.cc compiler/driver/compiler_driver.cc dex2oat/dex2oat.cc runtime/class_linker.cc runtime/runtime.cc runtime/runtime.h
* Object model changes to support 64bit.Ian Rogers2014-02-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | Modify mirror objects so that references between them use an ObjectReference value type rather than an Object* so that functionality to compress larger references can be captured in the ObjectRefererence implementation. ObjectReferences are 32bit and all other aspects of object layout remain as they are currently. Expand fields in objects holding pointers so they can hold 64bit pointers. Its expected the size of these will come down by improving where we hold compiler meta-data. Stub out x86_64 architecture specific runtime implementation. Modify OutputStream so that reads and writes are of unsigned quantities. Make the use of portable or quick code more explicit. Templatize AtomicInteger to support more than just int32_t as a type. Add missing, and fix issues relating to, missing annotalysis information on the mutator lock. Refactor and share implementations for array copy between System and uses elsewhere in the runtime. Fix numerous 64bit build issues. Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
* Add property to disable sampling profiler.Dave Allison2014-01-301-0/+16
| | | | | | | | | | | This is to enable power measurements to be performed without the profiler running. The default is off (no profiler). To enable the profiler: adb shell setprop dalvik.vm.profiler 1 Change-Id: I983f2ffcf6c2c7bb8e29f0610fe259f3d56a4b1d
* Add sampling profilerDave Allison2014-01-071-0/+448
This adds a sampling profiler thread that runs every so often, gathering profiling data and writing the results to a file in /data/data (specific to app running). The intention is to use these files as input to the compiler so that it can determine the best methods to compile. Bug: 11539952 Change-Id: I0bfbb4146fb7966673c792f017ffac8107b6272d