diff options
author | Nick Kralevich <nnk@google.com> | 2014-06-11 18:29:07 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2014-06-11 18:29:07 -0700 |
commit | 7bfa86ddf31a961a61e2994fe771345acd1717b4 (patch) | |
tree | 8799c7a20c34c311706b3db5978b3d77cc913994 /runtime/native | |
parent | 3a7a8d18a01c6930b9bcf3897762af301b25e8ca (diff) | |
download | art-7bfa86ddf31a961a61e2994fe771345acd1717b4.zip art-7bfa86ddf31a961a61e2994fe771345acd1717b4.tar.gz art-7bfa86ddf31a961a61e2994fe771345acd1717b4.tar.bz2 |
consolidate profiles and profile-cache
Ownership problems originally prevented using the same directory
for /data/dalvik-cache/profiles and /data/dalvik-cache/profile-cache.
Now that ownership is assigned via init.rc, we can consolidate these
two directories.
Old profile files are stored in /data/dalvik-cache/profiles/ with
the "@old" extension. We use "@" instead of "." to avoid conflicts
should someone create a package ending in ".old".
Change-Id: Ic1b44009faa30d704855e97631006c4b990a4ad3
Diffstat (limited to 'runtime/native')
-rw-r--r-- | runtime/native/dalvik_system_DexFile.cc | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc index 7e3810c..9512a5a 100644 --- a/runtime/native/dalvik_system_DexFile.cc +++ b/runtime/native/dalvik_system_DexFile.cc @@ -340,16 +340,7 @@ static jboolean IsDexOptNeededInternal(JNIEnv* env, const char* filename, if (Runtime::Current()->GetProfilerOptions().IsEnabled() && (pkgname != nullptr)) { const std::string profile_file = GetDalvikCacheOrDie("profiles", false /* create_if_absent */) + std::string("/") + pkgname; - const std::string profile_cache_dir = GetDalvikCacheOrDie("profile-cache", - false /* create_if_absent */); - - // Make the profile cache if it doesn't exist. - mkdir(profile_cache_dir.c_str(), 0700); - - // The previous profile file (a copy of the profile the last time this was run) is - // in the dalvik-cache directory because this is owned by system. The profiles - // directory is owned by install so system cannot write files in there. - std::string prev_profile_file = profile_cache_dir + std::string("/") + pkgname; + const std::string prev_profile_file = profile_file + std::string("@old"); struct stat profstat, prevstat; int e1 = stat(profile_file.c_str(), &profstat); |