summaryrefslogtreecommitdiff
path: root/tools/aapt2/link/XmlReferenceLinker.cpp
diff options
context:
space:
mode:
authorFabien Sanglard <sanglardf@google.com>2019-02-21 15:13:29 -0800
committerFabien Sanglard <sanglardf@google.com>2019-03-05 15:09:27 -0800
commit2d34e76daceaac41a8c578d7fa02aca864019dbb (patch)
treebd46b9065635728d88f2a6f40236c442ecad5f12 /tools/aapt2/link/XmlReferenceLinker.cpp
parent63ebfcba5d62de4db9cfeb627ac98a4bc65ef425 (diff)
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
Diffstat (limited to 'tools/aapt2/link/XmlReferenceLinker.cpp')
-rw-r--r--tools/aapt2/link/XmlReferenceLinker.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/aapt2/link/XmlReferenceLinker.cpp b/tools/aapt2/link/XmlReferenceLinker.cpp
index 160ff925f6cc..d68f7dd44c9f 100644
--- a/tools/aapt2/link/XmlReferenceLinker.cpp
+++ b/tools/aapt2/link/XmlReferenceLinker.cpp
@@ -25,6 +25,7 @@
#include "link/ReferenceLinker.h"
#include "process/IResourceTableConsumer.h"
#include "process/SymbolTable.h"
+#include "trace/TraceBuffer.h"
#include "util/Util.h"
#include "xml/XmlDom.h"
@@ -151,6 +152,7 @@ class XmlVisitor : public xml::PackageAwareVisitor {
} // namespace
bool XmlReferenceLinker::Consume(IAaptContext* context, xml::XmlResource* resource) {
+ TRACE_NAME("XmlReferenceLinker::Consume");
CallSite callsite{resource->file.name.package};
std::string out_name = resource->file.name.entry;