From: Eric Holk Date: Mon, 20 May 2019 22:22:22 +0000 (-0700) Subject: Remove obtainStyledAttribute and AssetManager2::GetBag tracing X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4487398e0dca180c0a3223cd23949861440702db;p=android-x86%2Fframeworks-base.git Remove obtainStyledAttribute and AssetManager2::GetBag tracing These traces are small and noisy, so they hurt performance more than they help. This reverts commit c37457799be3db0590a5d94832b2fef5f64ef439. Test: m Bug: 132721345 Change-Id: I9ef719f54f2bc8a54f23e88f46d74e35417a6519 (cherry picked from commit 3509b624feecbcb8be850f9e1f397cdd7aeea5e2) --- diff --git a/core/java/android/content/res/ResourcesImpl.java b/core/java/android/content/res/ResourcesImpl.java index 633966c38786..794be9e202be 100644 --- a/core/java/android/content/res/ResourcesImpl.java +++ b/core/java/android/content/res/ResourcesImpl.java @@ -1390,11 +1390,9 @@ public class ResourcesImpl { @StyleableRes int[] attrs, @AttrRes int defStyleAttr, @StyleRes int defStyleRes) { - Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, "obtainStyledAttributes"); - TypedArray array; synchronized (mKey) { final int len = attrs.length; - array = TypedArray.obtain(wrapper.getResources(), len); + final TypedArray array = TypedArray.obtain(wrapper.getResources(), len); // XXX note that for now we only work with compiled XML files. // To support generic XML files we will need to manually parse @@ -1405,9 +1403,8 @@ public class ResourcesImpl { array.mDataAddress, array.mIndicesAddress); array.mTheme = wrapper; array.mXml = parser; + return array; } - Trace.traceEnd(Trace.TRACE_TAG_RESOURCES); - return array; } @NonNull diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp index 1b515ad41e68..d20aecaaf0f6 100644 --- a/libs/androidfw/AssetManager2.cpp +++ b/libs/androidfw/AssetManager2.cpp @@ -778,8 +778,6 @@ const ResolvedBag* AssetManager2::GetBag(uint32_t resid) { } const ResolvedBag* AssetManager2::GetBag(uint32_t resid, std::vector& child_resids) { - ATRACE_NAME("AssetManager::GetBag"); - auto cached_iter = cached_bags_.find(resid); if (cached_iter != cached_bags_.end()) { return cached_iter->second.get();