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

Unified Diff: chrome/common/profiling/memlog_stream.h

Issue 2943733002: Add out-of-process memory logging stream parsing. (Closed)
Patch Set: Format Created 3 years, 6 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 | chrome/profiling/BUILD.gn » ('j') | chrome/profiling/allocation_tracker.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/profiling/memlog_stream.h
diff --git a/chrome/common/profiling/memlog_stream.h b/chrome/common/profiling/memlog_stream.h
index 7a9e98d2c4a700473ceabd9632777e12a823586d..fa6810bf3c661f79b80d8a755f4544a18d2966aa 100644
--- a/chrome/common/profiling/memlog_stream.h
+++ b/chrome/common/profiling/memlog_stream.h
@@ -5,10 +5,45 @@
#ifndef CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_
#define CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_
+#include <stdint.h>
+
#include "build/build_config.h"
namespace profiling {
+static const uint32_t kStreamSignature = 0xF6103B71;
+static const uint32_t kStreamVersion = 1;
+
+static const uint32_t kAllocPacketType = 0xA1A1A1A1;
+static const uint32_t kFreePacketType = 0xFEFEFEFE;
+
+#pragma pack(push, 1)
+struct StreamHeader {
+ uint32_t signature; // kStreamSignature
+ uint32_t version;
+
+ char proctype[16];
Boris Vidolov 2017/06/16 21:16:46 What will this be?
brettw 2017/06/16 23:58:13 I meant to delete that but did it in the next path
+};
+
+struct AllocPacket {
+ uint32_t op; // = kAllocPacketType
+
+ uint64_t time;
+ uint64_t address;
+ uint64_t size;
+
+ uint32_t stack_len;
+ // Immediately followed by |stack_len| more addresses.
+};
+
+struct FreePacket {
+ uint32_t op; // = kFreePacketType
+
+ uint64_t time;
+ uint64_t address;
Boris Vidolov 2017/06/16 21:16:45 No stack trace here?
brettw 2017/06/16 23:58:13 No, I didn't hook up free stack traces. It's easy
+};
+#pragma pack(pop)
+
#if defined(OS_WIN)
// Prefix for pipe name for communicating between chrome processes and the
// memlog process. The pipe ID is appended to this to get the pipe name.
« no previous file with comments | « no previous file | chrome/profiling/BUILD.gn » ('j') | chrome/profiling/allocation_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698