diff options
author | Igor Murashkin <iam@google.com> | 2014-11-13 14:38:00 -0800 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2014-12-16 12:00:59 -0800 |
commit | 3774335b08076117d6950cd472cdd59a167470b5 (patch) | |
tree | c2d24814e2d829f55ae25415b5b578cc040e0934 /runtime/common_runtime_test.cc | |
parent | 5b6912e455da798a79a4bb3235e276351b38ab58 (diff) | |
download | art-3774335b08076117d6950cd472cdd59a167470b5.zip art-3774335b08076117d6950cd472cdd59a167470b5.tar.gz art-3774335b08076117d6950cd472cdd59a167470b5.tar.bz2 |
Add a new imgdiag tool to diff boot.art/core.art against a process
Analyze the dirty memory pages of a running process per-object,
this allows is to to fine-tune the dirty object binning algorithm in
image writer.
Also:
* Factor out oatdump command line parsing code into cmdline.h
* Factor out common build rules for building variations of binaries
* Add a gtest for imgdiag
Bug: 17611661
Change-Id: I3ac852a0d223af66f6d59ae5dbc3df101475e3d0
Diffstat (limited to 'runtime/common_runtime_test.cc')
-rw-r--r-- | runtime/common_runtime_test.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc index 03b33e9..3d7bf53 100644 --- a/runtime/common_runtime_test.cc +++ b/runtime/common_runtime_test.cc @@ -169,6 +169,13 @@ void CommonRuntimeTest::TearDownAndroidData(const std::string& android_data, boo } } +std::string CommonRuntimeTest::GetCoreArtLocation() { + return GetCoreFileLocation("art"); +} + +std::string CommonRuntimeTest::GetCoreOatLocation() { + return GetCoreFileLocation("oat"); +} const DexFile* CommonRuntimeTest::LoadExpectSingleDexFile(const char* location) { std::vector<const DexFile*> dex_files; @@ -358,6 +365,21 @@ jobject CommonRuntimeTest::LoadDex(const char* dex_name) { return class_loader; } +std::string CommonRuntimeTest::GetCoreFileLocation(const char* suffix) { + CHECK(suffix != nullptr); + + std::string location; + if (IsHost()) { + const char* host_dir = getenv("ANDROID_HOST_OUT"); + CHECK(host_dir != NULL); + location = StringPrintf("%s/framework/core.%s", host_dir, suffix); + } else { + location = StringPrintf("/data/art-test/core.%s", suffix); + } + + return location; +} + CheckJniAbortCatcher::CheckJniAbortCatcher() : vm_(Runtime::Current()->GetJavaVM()) { vm_->SetCheckJniAbortHook(Hook, &actual_); } |