summaryrefslogtreecommitdiffstats
path: root/dalvik/src
Commit message (Collapse)AuthorAgeFilesLines
* Include library path information in BaseDexClassLoader for better error ↵Brian Carlstrom2012-08-011-1/+6
| | | | | | | | reporting in Runtime.loadLibrary (cherry-pick of b6a576f43f1c23bb92493590a04bf9c72f092438.) Change-Id: I6f34862327cf99d8c6f9a7e9aa3aeab47985969b
* Improve the BaseDexClassLoader detail message, and make ScopedLocalRef more ↵Elliott Hughes2012-08-011-1/+1
| | | | | | | | | | | | unique_ptr-like. (cherry-pick of 1c459db4ea31c1f284353bc71bfd2dbc97ca53d7.) Conflicts: include/ScopedLocalRef.h Change-Id: Id01cb907406cc93f6b0f6ddaa8e7fb3714d18c53
* Use float comparison for setTargetHeapUtilization constants.Ian Rogers2012-08-011-1/+1
| | | | | | (cherry-pick of f655188036ceab8968a510ae67455a27917546cf.) Change-Id: I587ad497ee9ac38f4052cdfdd861e8b24dd80712
* Fix HttpURLConnection CloseGuard warning due to lack of close on GZIPInputStreamBrian Carlstrom2012-07-271-2/+2
| | | | | | | | | | | | | | | | java.lang.Throwable: Explicit termination method 'end' not called at dalvik.system.CloseGuard.open(CloseGuard.java:184) at java.util.zip.Inflater.<init>(Inflater.java:82) at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:96) at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81) at libcore.net.http.HttpEngine.initContentStream(HttpEngine.java:523) at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:831) at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274) at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486) at ... Bug: 6602529 Change-Id: I9b49cbca561f8780d08844e566820087fdffc4d7
* am 4ee3fff2: Merge "Extend forkAndSpecialize to take further input arguments."Kenny Root2012-06-211-5/+8
|\ | | | | | | | | * commit '4ee3fff217e72eccf5d1b1d7e252a214b0233bb3': Extend forkAndSpecialize to take further input arguments.
| * Extend forkAndSpecialize to take further input arguments.Stephen Smalley2012-01-181-5/+8
| | | | | | | | | | | | | | | | | | Extend forkAndSpecialize to take two further input arguments, a seInfo string and the niceName for the process. These can be used as further selectors in determining the SELinux security context for the process. Change-Id: If3a654070025e699b2266425f6eb8ab7e6b8c562
* | Merge "Refuse to write optimized dex files to a non-private directory."Jesse Wilson2012-01-081-0/+16
|\ \
| * | Refuse to write optimized dex files to a non-private directory.Jesse Wilson2012-01-061-0/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's infeasible to test if other applications can write to a given directory, particularly since directories like /sdcard/ are accessible to named groups like sdcard_rw. Instead we take a shortcut and just test that the optimized directory is owned by the current process. I tested this manually; the '/data/data/vogar.test.java.StatTest/' app directory could be successfully used but other directories ('/data', '/sdcard', '/') throw exceptions as expected. Bug: http://b/4609061 Change-Id: Ia72b50aa3c73051b0c03c06c0bc7c0470f76b212
* | Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-051-1/+1
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: Ia340ff04d8e9c6344df07a9f921147d06f367bfe
* | Track removal of unsupported experimental opcodes.Elliott Hughes2012-01-052-2/+42
|/ | | | Change-Id: Id97e603ce8dc4cc3246f99c5b215b0f862a700dd
* Only tag/untag sockets when open.Jeff Sharkey2011-10-251-2/+6
| | | | | Bug: 5274621 Change-Id: Icc42a80c8cce6adb20d16ca2bb1fb51e2a8e8e1b
* Fix typo in Javadoc for onReadFromDiskCasey Ho2011-08-171-1/+1
| | | | Change-Id: I7d8d683bd81fd96e826584cf502e418b29acab61
* Document a semantic change to setTargetSdkVersion.Elliott Hughes2011-07-101-1/+3
| | | | | | | (The actual change is in another project, confusingly.) Bug: 4772166 Change-Id: Ib7c242a2d2a7d1cbf468b09319392a5b8cca2e18
* Allow an app's targetSdkVersion to be set by the zygote (libcore).Elliott Hughes2011-07-081-0/+7
| | | | | Bug: 4772166 Change-Id: I33ff94e92e8e840e2a397c34b293a25c013a2052
* resolved conflicts for merge of ba450023 to masterJesse Wilson2011-07-071-15/+22
|\ | | | | | | Change-Id: Ib8e7b68547f139b38ce2790c13a5748801faf9bd
| * Use a clear warning in the DexClassLoader docs.Jesse Wilson2011-06-291-18/+20
| | | | | | | | | | | | | | Cherry-pick of I0cc4bb3ec86b1c3c578c548f6fc646bce9e45745 http://b/4609061 Change-Id: I8ef78c4117f67b1b517d4512b28e73533f64645c
* | Add a constant for enabling logging of third-party JNI activity.Elliott Hughes2011-07-061-0/+2
| | | | | | | | Change-Id: I7038c894f98e713047cdc23e65c972962c75183e
* | Move socket tagging to frameworks/base.Jesse Wilson2011-06-282-132/+76
| | | | | | | | Change-Id: I6f6f840d5d5eee6ca2170fc127fd525155dd40b8
* | Migrate setThreadStatsTag() from String to int.Jeff Sharkey2011-06-281-24/+34
| | | | | | | | | | | | | | Also write out tag as unsigned int. Bug: 4948913 Change-Id: I314655d0698df26e545107b4dea37ce4629be01a
* | Remove an unused internal native.Elliott Hughes2011-06-231-8/+0
| | | | | | | | Change-Id: I562deaf3991018a828757c87afcc27f9901942f7
* | Implement the finalizer watchdog.Jesse Wilson2011-06-202-6/+7
| | | | | | | | | | Change-Id: Ia4aaf5f0ef5a2f5f7e6ec3e8b4c4e300c9e1b2ee http://b/4144865
* | blockguard: tweak netfilter cmd handling, document function.JP Abgrall2011-06-091-3/+23
| | | | | | | | | | | | | | | | Remove the unneeded string replace. Add comments and function doc. Change-Id: I69d435ca175e1a3c7a1dc28cdd2cf51c249ca8d0
* | BlockGuard: bandwidth control: enable and simplify talking to kernel.JP Abgrall2011-06-031-25/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let the BlockGuard attempt to set tags. For now, it will silently do nothing if the needed /proc/net/xt_qtaguid/ctrl file is not available. It distinguishes "t"agging from "u"ntagging. For now, it does not pass down the tag as a string, but just its hash. It doesn't attempt to control the module when nothing needs doing. This needs the kernel with the new xt_qtaguid netfilter module. And the new system/netd bandwidth management support that sets up the iptables. Change-Id: Ie20def02f8d6aa4b67249f1b46ec5aefb9396305
* | am 46fc50e8: Merge "Support wrapping app processes to inject debug ↵Jeff Brown2011-05-241-0/+27
|\ \ | | | | | | | | | | | | | | | | | | instrumentation. Bug: 4437846" * commit '46fc50e810eaab93f2787b355257ab1e837d8bf7': Support wrapping app processes to inject debug instrumentation. Bug: 4437846
| * \ Merge "Support wrapping app processes to inject debug instrumentation. Bug: ↵Jeff Brown2011-05-241-0/+27
| |\ \ | | | | | | | | | | | | 4437846"
| | * | Support wrapping app processes to inject debug instrumentation.Jeff Brown2011-05-201-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 4437846 Change-Id: I8d66b13f1c1dc9c30f72033f190121979a44b212
| * | | Disable verbose socket logging.Jeff Sharkey2011-05-171-1/+1
| |/ / | | | | | | | | | Change-Id: I3b8a1a532b186fee81cca0c7eb9199a436570999
* | | Expose accept(2).Elliott Hughes2011-05-191-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of PlainSocketImpl.accept is made ugly by the fact that the SocketImpl we mutate may share its FileDescriptor with a SocketChannel, so we need to mutate the FileDescriptor itself, and can't simply swap in a new one. I've raised http://b/4452981 to see if we can integrate the nio and io socket classes more closely, to avoid this kind of mess. Bug: 3107501 Change-Id: I4964b64c25e936a44d1e4c22504ca29bba247ab6
* | | Implement recvfrom(2).Elliott Hughes2011-05-191-26/+3
| | | | | | | | | | | | | | | | | | | | | This one's a little bit hairy because of multiple return values. Bug: 3107501 Change-Id: I3bd35647d94bb6bc2192d6f31a39ecca07a3926e
* | | Add sendto(2) and reimplement all network writes in terms of it.Elliott Hughes2011-05-161-30/+0
| | | | | | | | | | | | | | | | | | | | | Note that this doesn't fix http://b/4182806. Bug: 3107501 Change-Id: I9b56eae226389a63a12b4c0499d40d5a54a462e2
* | | Quieten socket tagging.Elliott Hughes2011-05-161-1/+1
| | | | | | | | | | | | | | | | | | This is pretty noisy, and not our problem. Change-Id: I5fbd54ccbcbf66d089455efd68cf68e5a91aef20
* | | Remove OSNetworkSystem.close.Elliott Hughes2011-05-161-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | For now I'm keeping AsynchronousCloseMonitor as a special case in native code. We can see about doing something more general-purpose in a later pass. Bug: 3107501 Change-Id: Ib79b9fc0bebfafc2d14896d957bd8591ae8e6e97
* | | resolved conflicts for merge of 1e8d508f to dalvik-devJeff Sharkey2011-05-131-3/+92
|\ \ \ | |/ / | | | | | | Change-Id: Id0739d4e567b112cbea48f5ecb7dd46425da1a36
| * | Add Socket tagging for granular data accounting.Jeff Sharkey2011-05-131-4/+92
| | | | | | | | | | | | | | | | | | | | | | | | Changes BlockGuard to maintain a set of "tags" for the current thread, which it communicates to kernel before each Socket use. Also changes HttpConnectionPool to tag/untag sockets as they are recycled. Change-Id: I33e614f1f570466bdffbf07cc5c718f18b8f3773
* | | Reimplement OSNetworkSystem.isConnected in Java.Elliott Hughes2011-05-121-8/+0
| | | | | | | | | | | | | | | | | | We can do this in Java now we've exposed poll(2). Change-Id: I9f2700d09134198c1cd2681e3814fb482e8e271c
* | | Expose poll(2) and reimplement java.nio.channels.Selector.Elliott Hughes2011-05-111-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | This also adds UnsafeArrayList<T>, which is like ArrayList but lets you access the underlying array (as opposed to ArrayList.toArray which creates a copy). Bug: 3107501 Change-Id: I8dc570a9fd7951b1435047017ea7aa19f8f8fc53
* | | Clean up the select(2) implementation.Elliott Hughes2011-05-111-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I wasn't planning on touching this code (since I want to replace it), but the purported "fix" for http://code.google.com/p/android/issues/detail?id=6309 was actually a regression. The supplied test fails on the RI. This patch replaces the bogus test with new tests, and reverts the old "fix". This was found while trying to work out what "true" and "false" return values from OSNetworkSystem.select are supposed to mean. This patch also switches to a more traditional int return value. Bug: 3107501 Change-Id: Iddce55e081d440b7eb3ddcf94db7d0739dc89c70
* | | DatagramSocket.disconnect is really a connect(2) of an AF_UNSPEC sockaddr.Elliott Hughes2011-05-101-4/+0
| | | | | | | | | | | | | | | Bug: 3107501 Change-Id: Ib04369b9ca63ff3fe7eb87dcbf2926fe704813e3
* | | Expose connect(2).Elliott Hughes2011-05-091-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new NET_FAILURE_RETRY in Posix.cpp is intended to replace the legacy one in NetFd.h, but during the transition we need both. The new one also takes care of the asynchronous Socket.close semantics, and changes the behavior when the FileDescriptor is invalid on entry: that is now reported as EBADF; it's only reported as "Socket closed" when we've been round the loop at least once, giving us reason to believe the socket was ever open. Having had to debug this distinction, I think the new semantics are less confusing. Bug: 3107501 Change-Id: I243dc4fa2eddde7ba40e9b66ec8fc555bc4e80f9
* | | Expose bind(2).Elliott Hughes2011-05-091-6/+0
|/ / | | | | | | | | | | | | | | | | | | I've renamed the java.net.InetAddress to struct sockaddr conversion functions too, after initially screwing up this patch by copy & pasting a usage of the one that only one caller actually wants. Now the name's so ugly no-one will be likely to use it by accident. Bug: 3107501 Change-Id: I869a8d27fc40e462505e02bf25a67e771a403e92
* | Fix non-blocking connects.Elliott Hughes2011-05-031-3/+1
| | | | | | | | | | | | | | | | | | | | The key change here is reintroducing the boolean return value, which we need as long as the native code treats EINPROGRESS as a special case which doesn't throw. The rest is just drive-by incremental cleanup of the code. Change-Id: I761b052adbb14e912c3853a35327f8a589cd4023
* | Rewrite blocking connects in terms of the non-blocking primitives.Elliott Hughes2011-05-021-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies OSNetworkSystem, getting us closer to replacing the connect(2)-related bits with our new POSIX interface. It also lets us remove cruft on the Java side that was resetting the socket's blocking/non-blocking state (which should never have been touched), which in turn fixes bug 4193212. Detail messages for socket timeouts get better too, now we're throwing on the Java side. The only thing that's worse is that we used to get away with throwing a checked exception from native code, which simplified our "throws" clauses. Now we actually have to jump through a few hoops to make javac happy. (Especially awkward because SocketTimeoutException isn't a SocketException.) Stupid checked exceptions. Bug: 4193212 Bug: 3107501 Change-Id: I00695d22094e6d785458dfbb7050fbaecf2db89f
* | Finish setsockopt(2).Elliott Hughes2011-04-061-5/+0
| | | | | | | | | | Bug: 3107501 Change-Id: I8f026dcba78acb555834bdcc594e114238f3cc52
* | Ensure that the zygote is single-threaded before forking.Elliott Hughes2011-04-051-0/+18
| | | | | | | | | | | | | | We really need to wait for the pthreads to exit. Bug: 4235038 Change-Id: Ic0ce32be80bcdc27ff8fc6ac27fa37f7c3e17e0c
* | Implement reference queuing in managed code.Carl Shapiro2011-03-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a thread to the core library which receives a list of references after a garbage collection and enqueues each element. This list is constructed by linking together the pendingNext field of cleared references into a circular queue. To support this change, the pendingNext field has been replaced by the new zombie field for the purposes of providing a strongly reachable location within a FinalizerReference class instance. Change-Id: Id09133e44c850797e7f14c5471123a036d027c80
* | Add getsockname(2) and getsockopt(2).Elliott Hughes2011-03-301-20/+5
| | | | | | | | | | Bug: 3107501 Change-Id: Ibb0d5a576ecb46e51dbda6051776145eec9e7fe1
* | am e9af8901: SamplingProfilerIntegration and SamplingProfiler improvements (2/3)Brian Carlstrom2011-03-2912-86/+392
|\ \ | | | | | | | | | | | | * commit 'e9af8901fc4ed7c05d085e2e492f5dcc857f0146': SamplingProfilerIntegration and SamplingProfiler improvements (2/3)
| * | SamplingProfilerIntegration and SamplingProfiler improvements (2/3)Brian Carlstrom2011-03-2912-86/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: frameworks/base - fix profiling to collect data beyond the first snapshot - avoid many small files, accumulate data over process lifetime libcore: - add support for VM specific sampling, trying to cut down overhead - added support for converting snapshot files to text format - fixed race in profiler when stopping dalvik - added VMStack.setThreadStackTrace interface for filling a stack trace into an existing StackTraceElement[] Details: frameworks/base Changed snapshots from text to binary hprof format (bumping version to 3) Changed from one file per snapshot to one file per process lifetime. Restart profiling after snapshot. core/java/com/android/internal/os/SamplingProfilerIntegration.java Add quick test in maybeSnapshot to avoid doing work when the SamplingProfilerIntegration is disabled. Make maybeSnapshot private. Remove unneeded memory allocation in handleLowMemory. core/java/android/app/ActivityThread.java libcore Added ThreadSampler interface. This allows VM specific thread sampling optimizations. The portable version continues to use Thread.getStackTrace(). dalvik/src/main/java/dalvik/system/profiler/ThreadSampler.java dalvik/src/main/java/dalvik/system/profiler/PortableThreadSampler.java dalvik/src/main/java/dalvik/system/profiler/SamplingProfiler.java Add VMStack.setThreadStackTrace and use in new DalvikThreadSampler to avoid allocating a full stack trace when only a limited depth is desired. dalvik/src/main/java/dalvik/system/profiler/DalvikThreadSampler.java dalvik/src/main/java/dalvik/system/VMStack.java Refactored BinaryHprof.readMagic out of BinaryHprofReader so it can be used by HprofBinaryToAscii converter to probing file types. Added magic number constant to be shared between readMagic and BinaryHprofWriter. dalvik/src/main/java/dalvik/system/profiler/BinaryHprof.java dalvik/src/main/java/dalvik/system/profiler/BinaryHprofReader.java dalvik/src/main/java/dalvik/system/profiler/BinaryHprofWriter.java dalvik/src/main/java/dalvik/system/profiler/HprofBinaryToAscii.java Removed unneeded HprofWriter interface. Changed to simpler static interface to write HprofData to binary and text formats. dalvik/src/main/java/dalvik/system/profiler/HprofWriter.java dalvik/src/main/java/dalvik/system/profiler/AsciiHprofWriter.java dalvik/src/main/java/dalvik/system/profiler/BinaryHprofWriter.java dalvik/src/test/java/dalvik/system/profiler/SamplingProfilerTest.java Added support for reading snapshot files created by SamplingProfilerIntegration by stripping the text header to allow easier conversion to the text format. dalvik/src/main/java/dalvik/system/profiler/HprofBinaryToAscii.java Fixed race between Sampler and SamplingProfiler.stop. SamplingProfiler.stop previously simply called the Sampler's TimerTask.cancel method, but this does not wait for a currently running Sampler to finish. The TimerTask documentation says the only reliable way to do this is to have the run() cancel itself, so that is what is now done, with new code to ensure that SamplingProfiler.stop does not return until the Sampler has been terminated. dalvik/src/main/java/dalvik/system/profiler/SamplingProfiler.java dalvik Refactored VMStack_getThreadStackTrace to create helper getTraceBuf used to implement new VMStack_setThreadStackTrace. The new version interface fills an existing StackTraceElement[], avoid allocating unnecessary StackTraceElements. vm/native/dalvik_system_VMStack.c Refactor dvmGetStackTraceRaw to create dvmSetStackTraceRaw which fills in an existing, potentially smaller, StackTraceElement[]. vm/Exception.c vm/Exception.h Change stack depths to be unsigned to avoid signed/unsigned comparison warnings. vm/Ddm.c vm/Exception.c vm/Exception.h Change-Id: Id65df6e72b7c727a0c8af15dbf6943297c591541
* | | Add socket(2) and start adding setsockopt(2).Elliott Hughes2011-03-291-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | I've added just enough setsockopt to keep the hack from our old socket creation code. More later (but not necessarily right away). Bug: 3107501 Change-Id: Id57bdd3c760bc58ed79d675b268c55493cbc24c8
* | | Add sendfile(2).Elliott Hughes2011-03-291-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch marks the end of OSFileSystem. Having to support a Java "long*" for sendfile(2) gave me an opportunity to go back and improve my ioctl(2) to use a corresponding "int*" equivalent, instead of its previous special-case hack. Bug: 3107501 Change-Id: I9fde4777700552263fab4fe9aeb556174163e3dc