summaryrefslogtreecommitdiffstats
path: root/runtime/utils_test.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-02-27 12:49:04 -0800
committerAndreas Gampe <agampe@google.com>2015-04-15 20:45:35 -0700
commit40da286d3207d88ed8ff3f5caac4873874603428 (patch)
tree3f9720425b2a024a5a54a0a71447dcea107229a8 /runtime/utils_test.cc
parent6508158f8388847f4cc3693e2cc1dbee6c2c7d18 (diff)
downloadart-40da286d3207d88ed8ff3f5caac4873874603428.zip
art-40da286d3207d88ed8ff3f5caac4873874603428.tar.gz
art-40da286d3207d88ed8ff3f5caac4873874603428.tar.bz2
ART: Streaming trace mode
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
Diffstat (limited to 'runtime/utils_test.cc')
-rw-r--r--runtime/utils_test.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/utils_test.cc b/runtime/utils_test.cc
index aa7bc64..6ccbd13 100644
--- a/runtime/utils_test.cc
+++ b/runtime/utils_test.cc
@@ -367,6 +367,15 @@ TEST_F(UtilsTest, GetDalvikCacheFilenameOrDie) {
GetDalvikCacheFilenameOrDie("/system/framework/boot.oat", "/foo").c_str());
}
+TEST_F(UtilsTest, GetDalvikCache) {
+ EXPECT_STREQ("", GetDalvikCache("should-not-exist123", false).c_str());
+
+ EXPECT_STREQ((android_data_ + "/dalvik-cache/.").c_str(), GetDalvikCache(".", false).c_str());
+ EXPECT_STREQ((android_data_ + "/dalvik-cache/should-not-be-there").c_str(),
+ GetDalvikCache("should-not-be-there", true).c_str());
+}
+
+
TEST_F(UtilsTest, GetSystemImageFilename) {
EXPECT_STREQ("/system/framework/arm/boot.art",
GetSystemImageFilename("/system/framework/boot.art", kArm).c_str());