Merge "Revert "Stack profiles: Reuse existing frame/module rows rather than adding one per sequence""
diff --git a/src/trace_processor/stack_profile_tracker.cc b/src/trace_processor/stack_profile_tracker.cc
index b006e77..aa6b764 100644
--- a/src/trace_processor/stack_profile_tracker.cc
+++ b/src/trace_processor/stack_profile_tracker.cc
@@ -82,35 +82,12 @@
static_cast<int64_t>(mapping.load_bias),
context_->storage->InternString(base::StringView(path))};
- TraceStorage::StackProfileMappings* mappings =
- context_->storage->mutable_stack_profile_mappings();
- int64_t cur_row = -1;
+ int64_t cur_row;
auto it = mapping_idx_.find(row);
if (it != mapping_idx_.end()) {
cur_row = it->second;
} else {
- std::vector<int64_t> db_mappings =
- mappings->FindMappingRow(row.name_id, row.build_id);
- for (const int64_t preexisting_mapping : db_mappings) {
- PERFETTO_DCHECK(preexisting_mapping >= 0);
- size_t preexisting_row_id = static_cast<size_t>(preexisting_mapping);
- TraceStorage::StackProfileMappings::Row preexisting_row{
- mappings->build_ids()[preexisting_row_id],
- mappings->exact_offsets()[preexisting_row_id],
- mappings->start_offsets()[preexisting_row_id],
- mappings->starts()[preexisting_row_id],
- mappings->ends()[preexisting_row_id],
- mappings->load_biases()[preexisting_row_id],
- mappings->names()[preexisting_row_id]};
-
- if (row == preexisting_row) {
- cur_row = preexisting_mapping;
- }
- }
- if (cur_row == -1) {
- cur_row =
- context_->storage->mutable_stack_profile_mappings()->Insert(row);
- }
+ cur_row = context_->storage->mutable_stack_profile_mappings()->Insert(row);
mapping_idx_.emplace(row, cur_row);
}
mappings_.emplace(id, cur_row);
@@ -146,11 +123,7 @@
if (it != frame_idx_.end()) {
cur_row = it->second;
} else {
- cur_row = context_->storage->stack_profile_frames().FindFrameRow(
- static_cast<size_t>(mapping_row), frame.rel_pc);
- if (cur_row == -1) {
- cur_row = context_->storage->mutable_stack_profile_frames()->Insert(row);
- }
+ cur_row = context_->storage->mutable_stack_profile_frames()->Insert(row);
frame_idx_.emplace(row, cur_row);
}
frames_.emplace(id, cur_row);