From 2d34e76daceaac41a8c578d7fa02aca864019dbb Mon Sep 17 00:00:00 2001 From: Fabien Sanglard Date: Thu, 21 Feb 2019 15:13:29 -0800 Subject: Add --trace_folder to aapt2 Add a tracing API and instrument key functions in order to profile aapt2 bottleneck. The API allows to generate systrace fragment files. Impact on performance is neglibible with each Trace requiring less than 1us and the final Flush operation at the end of a command requiring around 40us. Bug: None Test: None Change-Id: I51b564d3694e9384679f43b878b32295527dddf6 --- tools/aapt2/ResourceTable.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/aapt2/ResourceTable.cpp') diff --git a/tools/aapt2/ResourceTable.cpp b/tools/aapt2/ResourceTable.cpp index dbd0a0ca1799..7c0619f33851 100644 --- a/tools/aapt2/ResourceTable.cpp +++ b/tools/aapt2/ResourceTable.cpp @@ -30,6 +30,7 @@ #include "NameMangler.h" #include "ResourceValues.h" #include "ValueVisitor.h" +#include "trace/TraceBuffer.h" #include "text/Unicode.h" #include "util/Util.h" @@ -79,6 +80,7 @@ ResourceTablePackage* ResourceTable::FindPackageById(uint8_t id) const { } ResourceTablePackage* ResourceTable::CreatePackage(const StringPiece& name, Maybe id) { + TRACE_CALL(); ResourceTablePackage* package = FindOrCreatePackage(name); if (id && !package->id) { package->id = id; -- cgit v1.2.3