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

Unified Diff: base/trace_event/memory_dump_request_args.h

Issue 2755343003: memory-infra: Add a struct to carry memory use information (Closed)
Patch Set: remove one field and rename one field Created 3 years, 9 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
« no previous file with comments | « no previous file | base/trace_event/memory_dump_request_args.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_request_args.h
diff --git a/base/trace_event/memory_dump_request_args.h b/base/trace_event/memory_dump_request_args.h
index 90a866fa7a3fbd229b0290cf8053f7fa6861127c..a8b3f423cad37f4aaaac3b9f395e4f20b509a65a 100644
--- a/base/trace_event/memory_dump_request_args.h
+++ b/base/trace_event/memory_dump_request_args.h
@@ -9,10 +9,12 @@
// These are also used in the IPCs for coordinating inter-process memory dumps.
#include <stdint.h>
+#include <map>
#include <string>
#include "base/base_export.h"
#include "base/callback.h"
+#include "base/process/process_handle.h"
namespace base {
namespace trace_event {
@@ -72,6 +74,33 @@ struct MemoryDumpArgs {
MemoryDumpLevelOfDetail level_of_detail;
};
+// TODO(hjd): Not used yet, see crbug.com/703184
+// Summarises information about memory use as seen by a single process.
+// This information will eventually be passed to a service to be colated
+// and reported.
+struct MemoryDumpCallbackResult {
+ struct OSMemDump {
+ uint32_t resident_set_kb = 0;
+ };
+ struct ChromeMemDump {
+ uint32_t malloc_total_kb = 0;
+ uint32_t partition_alloc_total_kb = 0;
+ uint32_t blink_gc_total_kb = 0;
+ uint32_t v8_total_kb = 0;
+ };
+
+ // These are for the current process.
+ OSMemDump os_dump;
+ ChromeMemDump chrome_dump;
+
+ // In some cases, OS stats can only be dumped from a privileged process to
+ // get around to sandboxing/selinux restrictions (see crbug.com/461788).
+ std::map<ProcessId, OSMemDump> extra_processes_dump;
+
+ MemoryDumpCallbackResult();
+ ~MemoryDumpCallbackResult();
+};
+
using MemoryDumpCallback = Callback<void(uint64_t dump_guid, bool success)>;
BASE_EXPORT const char* MemoryDumpTypeToString(const MemoryDumpType& dump_type);
« no previous file with comments | « no previous file | base/trace_event/memory_dump_request_args.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698