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

Side by Side Diff: base/trace_event/winheap_dump_provider_win.h

Issue 2273703003: Hook memory tracing into Windows heap shim. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Primiano's nits. Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/winheap_dump_provider_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
6 #define BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
7
8 #include <stddef.h>
9
10 #include <set>
11
12 #include "base/macros.h"
13 #include "base/memory/singleton.h"
14 #include "base/trace_event/memory_dump_provider.h"
15
16 namespace base {
17 namespace trace_event {
18
19 // A structure containing some information about a given heap.
20 struct WinHeapInfo {
21 HANDLE heap_id;
22 size_t committed_size;
23 size_t allocated_size;
24 size_t block_count;
25 };
26
27 // Dump provider which collects process-wide heap memory stats. This provider
28 // iterates over all the heaps of the current process to gather some metrics
29 // about them.
30 class BASE_EXPORT WinHeapDumpProvider : public MemoryDumpProvider {
31 public:
32 // Name of the allocated_objects dump. Use this to declare suballocator dumps
33 // from other dump providers.
34 static const char kAllocatedObjects[];
35
36 static WinHeapDumpProvider* GetInstance();
37
38 // MemoryDumpProvider implementation.
39 bool OnMemoryDump(const MemoryDumpArgs& args,
40 ProcessMemoryDump* pmd) override;
41
42 private:
43 friend struct DefaultSingletonTraits<WinHeapDumpProvider>;
44
45 // Retrieves the information about given heap. The |heap_info| should contain
46 // a valid handle to an existing heap. The blocks contained in the
47 // |block_to_skip| set will be ignored.
48 bool GetHeapInformation(WinHeapInfo* heap_info,
49 const std::set<void*>& block_to_skip);
50
51 WinHeapDumpProvider() {}
52 ~WinHeapDumpProvider() override {}
53
54 DISALLOW_COPY_AND_ASSIGN(WinHeapDumpProvider);
55 };
56
57 } // namespace trace_event
58 } // namespace base
59
60 #endif // BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/winheap_dump_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698