summaryrefslogtreecommitdiffstats
path: root/runtime/trace.h
Commit message (Collapse)AuthorAgeFilesLines
* ART: Fix streaming tracing issuesAndreas Gampe2015-06-261-11/+14
| | | | | | | | | | | | Fix a lock ordering issue in streaming-mode tracing. Fix a moving-GC issue in streaming-mode tracing. DexCache objects are not good keys for a map. Expose streaming mode for testing in run-tests. Bug: 21760614 Change-Id: Idcd0575684ee3cc0cec3f81b4fdd0d5988c11e8c
* Fix tracingMathieu Chartier2015-06-021-0/+59
| | | | | | | | | Move back to 32 bit method IDs, add a bijective map for method IDs. Also some cleanup. Bug: 19264997 Change-Id: Icdd36591df53ff975d30b9000cfe67d3ae8c51d5
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-021-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 (cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33) Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d Fix some ArtMethod related bugs Added root visiting for runtime methods, not currently required since the GcRoots in these methods are null. Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes --trace run-tests 005, 044. Fixed optimizing compiler bug where we used a normal stack location instead of double on ARM64, this fixes the debuggable tests. TODO: Fix JDWP tests. Bug: 19264997 Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3 ART: Fix casts for 64-bit pointers on 32-bit compiler. Bug: 19264997 Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457 Fix JDWP tests after ArtMethod change Fixes Throwable::GetStackDepth for exception event detection after internal stack trace representation change. Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of proxy method. Bug: 19264997 Change-Id: I363e293796848c3ec491c963813f62d868da44d2 Fix accidental IMT and root marking regression Was always using the conflict trampoline. Also included fix for regression in GC time caused by extra roots. Most of the regression was IMT. Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to detached thread. EvaluateAndApplyChanges: From ~2500 -> ~1980 GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots Bug: 19264997 Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0 Fix bogus image test assert Previously we were comparing the size of the non moving space to size of the image file. Now we properly compare the size of the image space against the size of the image file. Bug: 19264997 Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a [MIPS64] Fix art_quick_invoke_stub argument offsets. ArtMethod reference's size got bigger, so we need to move other args and leave enough space for ArtMethod* and 'this' pointer. This fixes mips64 boot. Bug: 19264997 Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
* Fix mismatched new[]/delete.Christopher Ferris2015-05-041-1/+1
| | | | | | | Another two cases where a new[] is used but only a delete occurs. Bug: 18202869 Change-Id: If68264807150f3a9783e44ef8823cc366bff8df2
* ART: Fix Trace types, check minimum buf sizeAndreas Gampe2015-04-251-3/+4
| | | | | | | | | Also make streaming mode adhere to the given buffer (and fix the case where the buffer is too small for a packet). This is important to not lose too much tracing information when the runtime is destroyed with an unflushed buffer. Change-Id: I6525fe4326ac5c3d7c9cda41c54a2a911ca889b7
* Replace NULL with nullptrMathieu Chartier2015-04-221-2/+2
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* ART: Streaming trace modeAndreas Gampe2015-04-151-4/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a streaming mode for tracing. Streaming uses a buffer of 16KB and writes to the output when that buffer gets full. Streaming mode can be enabled with -Xmethod-trace-stream and is currently not exposed otherwise. Add a python script that can parse the streaming format, which simply contains strings for newly encountered threads and methods inline, and create output that can be used with traceview. Add Trace::Pause and Trace::Abort, which can pause and abort tracing. Abort is different from Stop in that it does not write the data. Add code to the zygote hooks JNI implementation that pauses tracing before the fork, making sure that a child cannot clobber the parent's data. Add code to the zygote hooks JNI implementation that aborts old tracing and starts new tracing in the child after the fork. Currently base the output on the pid. This will not work on an unmodified device, as the profiles directory is not generally writable, but we do not have enough information at that point. Consider a scheme that restarts tracing later. Change-Id: I93c7bf87e35af582bdfdd3ecc7c52454514220dd
* Move ArtField to nativeMathieu Chartier2015-04-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add linear alloc. Moved ArtField to be native object. Changed image writer to put ArtFields after the mirror section. Savings: 2MB on low ram devices 4MB on normal devices Total PSS measurements before (normal N5, 95s after shell start): Image size: 7729152 bytes 23112 kB: .NonMoving 23212 kB: .NonMoving 22868 kB: .NonMoving 23072 kB: .NonMoving 22836 kB: .NonMoving 19618 kB: .Zygote 19850 kB: .Zygote 19623 kB: .Zygote 19924 kB: .Zygote 19612 kB: .Zygote Avg: 42745.4 kB After: Image size: 7462912 bytes 17440 kB: .NonMoving 16776 kB: .NonMoving 16804 kB: .NonMoving 17812 kB: .NonMoving 16820 kB: .NonMoving 18788 kB: .Zygote 18856 kB: .Zygote 19064 kB: .Zygote 18841 kB: .Zygote 18629 kB: .Zygote 3499 kB: .LinearAlloc 3408 kB: .LinearAlloc 3424 kB: .LinearAlloc 3600 kB: .LinearAlloc 3436 kB: .LinearAlloc Avg: 39439.4 kB No reflection performance changes. Bug: 19264997 Bug: 17643507 Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
* ART: Use enums in TraceAndreas Gampe2015-03-291-3/+13
| | | | | | | Move away from booleans. Will make introduction of streaming mode a bit easier / obvious. Change-Id: Id7ae92f6b97f627e848510d473931537d7db0db8
* Compute the right catch location for the debugger.Nicolas Geoffray2015-03-091-3/+1
| | | | | | Also remove tls ThrowLocation, it is not needed anymore. Change-Id: I78fddf09ce968ca475e39c17fa76d699c589c8d9
* Revert "Revert "Add JIT""Mathieu Chartier2015-02-241-1/+2
| | | | | | | | Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
* Revert "Add JIT"Nicolas Geoffray2015-02-241-2/+1
| | | | | | | | | | | | | | | Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
* Add JITMathieu Chartier2015-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently disabled by default unless -Xjit is passed in. The proposed JIT is a method JIT which works by utilizing interpreter instrumentation to request compilation of hot methods async during runtime. JIT options: -Xjit / -Xnojit -Xjitcodecachesize:N -Xjitthreshold:integervalue The JIT has a shared copy of a compiler driver which is accessed by worker threads to compile individual methods. Added JIT code cache and data cache, currently sized at 2 MB capacity by default. Most apps will only fill a small fraction of this cache however. Added support to the compiler for compiling interpreter quickened byte codes. Added test target ART_TEST_JIT=TRUE and --jit for run-test. TODO: Clean up code cache. Delete compiled methods after they are added to code cache. Add more optimizations related to runtime checks e.g. direct pointers for invokes. Add method recompilation. Move instrumentation to DexFile to improve performance and reduce memory usage. Bug: 17950037 Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
* Store exiting thread ids and names while tracing to output later.Jeff Hao2014-10-141-0/+5
| | | | | | | | Bug: 17909204 (cherry picked from commit fdcbc5c4c7c67bba06e038ac96a2e8bc49b91f84) Change-Id: Iea087560ba8b983412a6dde2ec166c9e7214f3a1
* Stop thread from reattaching during runtime shutdown while tracing.Jeff Hao2014-07-291-0/+5
| | | | | Bug: 16024763 Change-Id: Iad5ba180241ff74b15baf5c3a15ed2d2ed60fcf0
* Break apart header files.Ian Rogers2014-07-151-15/+4
| | | | | | | | Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
* Move another field away from android_atomic_cas.Ian Rogers2014-07-091-1/+2
| | | | Change-Id: If63aa2811e06ec401a601286a3bacb62a0da96ad
* Fix method tracing from command-lineSebastien Hertz2014-07-091-5/+8
| | | | | | | | | | | | | | | | | | Transitions current thread to the new kWaitingForMethodTracingStart thread state when starting method tracing. Ensures there is a current thread when method tracing is stopped due to runtime shutdown. If the current thread has been detached, we now re-attach it. Note: we only do this if method tracing has been activated from command-line. Fixes instrumentation when forcing interpreter mode (-Xint) with method tracing enabled. Removes unused parameter from UnsafeLogFatalForThreadSuspendAllTimeout. Bug: https://code.google.com/p/android/issues/detail?id=72094 Bug: 11683397 Change-Id: I70f000fb46ddd95d6ad51ea0a8eee77697a045e9
* Now we have a proper C++ library, use std::unique_ptr.Ian Rogers2014-05-191-4/+4
| | | | | | | Also remove the Android.libcxx.mk and other bits of stlport compatibility mechanics. Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
* Compatibility layer to transition from UniquePtr to std::unique_ptr.Ian Rogers2014-05-151-1/+1
| | | | | | | | | Use ART_WITH_STLPORT (enabled for the target) to cause the use of UniquePtr, for the host switch to std::unique_ptr. For now the type remains called UniquePtr. Make dalvik compile with clang on the host, move its build to C++11. Change-Id: I5ba8d2757904bc089ed62047ea03de3c0853fb12
* Prepare field watchpoint supportSebastien Hertz2014-04-151-18/+27
| | | | | | | | | | | | | Adds field read/write events in the instrumentation. The debugger now registers as a listener for these events so JDWP field access and field modification events can be reported. This CL will be followed by another one to report these events from the interpreter. Therefore no JDWP field access and field modification events can be sent for now. Bug: 8267708 Change-Id: If2a93eb590805567d69015c83cce9cd2ab712cbd
* Add ART -help and -showversionBrian Carlstrom2014-03-031-0/+6
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=62149 Change-Id: I5c21c0433f5f341f94e7d977e8d2d69cc46d6fe3
* Object model changes to support 64bit.Ian Rogers2014-02-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* Propagate 'this_object' for method unwind event.Sebastien Hertz2013-11-191-1/+2
| | | | | | Propagates the 'this_object' to InstrumentationListener::MethodUnwind callback. Change-Id: I12561f1a611b8399b94e669f9b8a6eaaf1a58631
* Change IsMethodTracingActive to GetMethodTracingMode for art.Jeff Hao2013-08-291-1/+7
| | | | | | | This allows traceview to tell whether sampling or just normal method profiling is enabled. Change-Id: I518a1888a90bc50568fe56bf708d801027ac98d7
* Add art support for sample profiling from traceview gui.Jeff Hao2013-08-261-10/+6
| | | | Change-Id: I6004bf143521b872084ca4aae873bea3524aa895
* Sampling profiler reads clocks once for all events in a trace.Jeff Hao2013-08-191-1/+4
| | | | Change-Id: I5954c5777384cebe01f913e5525481e1d127785c
* Clean up sampling tracing.Jeff Hao2013-08-161-5/+7
| | | | | | | - Moved maps to fields within thread. - Created temp trace field to lessen amount of traces allocated and freed. Change-Id: I23fe25a85ad2894cc6917f87d4046cdececf0739
* Build fix.Ian Rogers2013-08-131-2/+2
| | | | Change-Id: I75af55f6cd0f0d4b15844e427ff8057dbc26466b
* Merge "Refactor java.lang.reflect implementation" into dalvik-devIan Rogers2013-08-141-9/+9
|\
| * Refactor java.lang.reflect implementationBrian Carlstrom2013-08-131-9/+9
| | | | | | | | | | | | | | | | | | | | | | Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1. Move to ArtMethod/Field instead of AbstractMethod/Field and have java.lang.reflect APIs delegate to ArtMethod/ArtField. Bug: 10014286. Change-Id: Iafc1d8c5b62562c9af8fb9fd8c5e1d61270536e7
* | Modify traceview to sample instead of instrumenting methods.Jeff Hao2013-08-131-1/+21
|/ | | | | | | | | Disabled the method instrumentation in traceview. Now when traceview is triggered, it starts up a thread which periodically samples all threads instead, generating method entry/exit events that traceview can understand. Change-Id: Ifc4012a4509d8eb9f54941eee2a8b42c411e5e9c
* Fix cpplint whitespace/blank_line issuesBrian Carlstrom2013-07-181-0/+1
| | | | Change-Id: Ice937e95e23dd622c17054551d4ae4cebd0ef8a2
* Fix multiple inclusion guards to match new pathnamesBrian Carlstrom2013-07-171-3/+3
| | | | Change-Id: Id7735be1d75bc315733b1773fba45c1deb8ace43
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-121-0/+132
The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81