Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: components/metrics/leak_detector/call_stack_table.cc

Issue 2417403002: Revert of Leak reports collect information about the last uptrend (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/metrics/leak_detector/call_stack_table.cc
diff --git a/components/metrics/leak_detector/call_stack_table.cc b/components/metrics/leak_detector/call_stack_table.cc
index ec9b78699ce635bf95eb2e1c712e688bd1f395b8..8f9540bc0d4b35f6f619c350fd8c13ba2fc1514f 100644
--- a/components/metrics/leak_detector/call_stack_table.cc
+++ b/components/metrics/leak_detector/call_stack_table.cc
@@ -42,7 +42,7 @@
CallStackTable::~CallStackTable() {}
void CallStackTable::Add(const CallStack* call_stack) {
- ++entry_map_[call_stack].count;
+ ++entry_map_[call_stack];
++num_allocs_;
}
@@ -50,7 +50,7 @@
auto iter = entry_map_.find(call_stack);
if (iter == entry_map_.end())
return;
- uint32_t& count_for_call_stack = iter->second.count;
+ uint32_t& count_for_call_stack = iter->second;
--count_for_call_stack;
++num_frees_;
@@ -67,40 +67,9 @@
}
void CallStackTable::GetTopCallStacks(RankedSet* top_entries) const {
- for (const auto& call_stack_count_info : entry_map_) {
- top_entries->AddCallStack(call_stack_count_info.first,
- call_stack_count_info.second.count);
- }
-}
-
-void CallStackTable::UpdateLastDropInfo(size_t timestamp) {
- for (auto& call_stack_and_info : entry_map_) {
- auto& count_info = call_stack_and_info.second;
-
- // If the |previous_count| is 0 then we need to initialize info.
- if (count_info.previous_count == 0 ||
- count_info.count < count_info.previous_count) {
- count_info.last_drop_timestamp = timestamp;
- count_info.last_drop_count = count_info.count;
- }
- count_info.previous_count = count_info.count;
- }
-}
-
-void CallStackTable::GetLastUptrendInfo(
- const CallStack* call_stack, size_t timestamp, size_t* timestamp_delta,
- uint32_t* count_delta) const {
- const auto& call_stack_count_info_iter = entry_map_.find(call_stack);
-
- if (call_stack_count_info_iter != entry_map_.end()) {
- const auto& count_info = call_stack_count_info_iter->second;
- *timestamp_delta = timestamp - count_info.last_drop_timestamp;
- *count_delta = count_info.count - count_info.last_drop_count;
- } else {
- DLOG(WARNING) << "Accessing information about a call stack that has not "
- << "been recorded";
- *timestamp_delta = timestamp;
- *count_delta = 0;
+ for (const auto& call_stack_and_count : entry_map_) {
+ top_entries->AddCallStack(call_stack_and_count.first,
+ call_stack_and_count.second);
}
}
« no previous file with comments | « components/metrics/leak_detector/call_stack_table.h ('k') | components/metrics/leak_detector/call_stack_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698