TraceProcessor: Add table for logcat events
Bug: 122243384
Change-Id: I3d3217d995628474fc0c85449a0ac665c409302e
diff --git a/src/trace_processor/trace_storage.h b/src/trace_processor/trace_storage.h
index 0ea97e6..d0e30f2 100644
--- a/src/trace_processor/trace_storage.h
+++ b/src/trace_processor/trace_storage.h
@@ -381,6 +381,37 @@
std::deque<UniqueTid> utids_;
};
+ class AndroidLogs {
+ public:
+ inline size_t AddLogEvent(int64_t timestamp,
+ UniqueTid utid,
+ uint8_t prio,
+ StringId tag_id,
+ StringId msg_id) {
+ timestamps_.emplace_back(timestamp);
+ utids_.emplace_back(utid);
+ prios_.emplace_back(prio);
+ tag_ids_.emplace_back(tag_id);
+ msg_ids_.emplace_back(msg_id);
+ return size() - 1;
+ }
+
+ size_t size() const { return timestamps_.size(); }
+
+ const std::deque<int64_t>& timestamps() const { return timestamps_; }
+ const std::deque<UniqueTid>& utids() const { return utids_; }
+ const std::deque<uint8_t>& prios() const { return prios_; }
+ const std::deque<StringId>& tag_ids() const { return tag_ids_; }
+ const std::deque<StringId>& msg_ids() const { return msg_ids_; }
+
+ private:
+ std::deque<int64_t> timestamps_;
+ std::deque<UniqueTid> utids_;
+ std::deque<uint8_t> prios_;
+ std::deque<StringId> tag_ids_;
+ std::deque<StringId> msg_ids_;
+ };
+
void ResetStorage();
UniqueTid AddEmptyThread(uint32_t tid) {
@@ -445,6 +476,9 @@
const Instants& instants() const { return instants_; }
Instants* mutable_instants() { return &instants_; }
+ const AndroidLogs& android_logs() const { return android_log_; }
+ AndroidLogs* mutable_android_log() { return &android_log_; }
+
const Stats& stats() const { return stats_; }
Stats* mutable_stats() { return &stats_; }
@@ -512,6 +546,7 @@
// args table. This table can be used to generate a text version of the
// trace.
RawEvents raw_events_;
+ AndroidLogs android_log_;
};
} // namespace trace_processor