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

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

Issue 2403223002: 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.h
diff --git a/components/metrics/leak_detector/call_stack_table.h b/components/metrics/leak_detector/call_stack_table.h
index 77a4b2a3ed717d882f44fb2403eb93b73315348d..e8a4fb2d92a7ce907bdba7a0c72960e7ed60aa6e 100644
--- a/components/metrics/leak_detector/call_stack_table.h
+++ b/components/metrics/leak_detector/call_stack_table.h
@@ -48,6 +48,14 @@ class CallStackTable {
// must already be initialized with that number.
void GetTopCallStacks(RankedSet* top_entries) const;
+ // Updates fields in CallStackCountInfo for every stored call stack.
Simon Que 2016/10/11 01:11:05 Explain the behavior in more detail. Mention e.g.
mwlodar 2016/10/11 07:13:23 Done.
+ void UpdateLastDropInfo(size_t timestamp);
+
+ // Retrieves the number of timestamps and the count growth since the last
Simon Que 2016/10/11 01:11:05 "number of timestamps" isn't quite right... did yo
mwlodar 2016/10/11 07:13:24 Done.
+ // observed drop in the number for allocations for the given call stack.
+ void GetLastUptrendInfo(const CallStack* call_stack, size_t timestamp,
+ size_t *timestamp_delta, uint32_t *count_delta) const;
Simon Que 2016/10/11 01:11:05 Nit: alignment
mwlodar 2016/10/11 07:13:23 Done.
+
const LeakAnalyzer& leak_analyzer() const { return leak_analyzer_; }
size_t size() const { return entry_map_.size(); }
@@ -57,6 +65,11 @@ class CallStackTable {
uint32_t num_frees() const { return num_frees_; }
private:
+ struct CallStackCountInfo {
+ uint32_t count, previous_count, last_drop_count;
+ size_t last_drop_timestamp;
+ };
+
// Total number of allocs and frees in this table.
uint32_t num_allocs_;
uint32_t num_frees_;
@@ -70,7 +83,7 @@ class CallStackTable {
// Stores a mapping of each call stack to the number of recorded allocations
// made from that call site.
base::hash_map<const CallStack*,
- uint32_t,
+ CallStackCountInfo,
StoredHash,
std::equal_to<const CallStack*>,
TableEntryAllocator> entry_map_;

Powered by Google App Engine
This is Rietveld 408576698