Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ | 5 #ifndef CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ |
| 6 #define CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ | 6 #define CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | |
| 9 | |
| 8 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 9 | 11 |
| 10 namespace profiling { | 12 namespace profiling { |
| 11 | 13 |
| 14 static const uint32_t kStreamSignature = 0xF6103B71; | |
| 15 static const uint32_t kStreamVersion = 1; | |
| 16 | |
| 17 static const uint32_t kAllocPacketType = 0xA1A1A1A1; | |
| 18 static const uint32_t kFreePacketType = 0xFEFEFEFE; | |
| 19 | |
| 20 #pragma pack(push, 1) | |
| 21 struct StreamHeader { | |
| 22 uint32_t signature; // kStreamSignature | |
| 23 uint32_t version; | |
| 24 | |
| 25 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
| |
| 26 }; | |
| 27 | |
| 28 struct AllocPacket { | |
| 29 uint32_t op; // = kAllocPacketType | |
| 30 | |
| 31 uint64_t time; | |
| 32 uint64_t address; | |
| 33 uint64_t size; | |
| 34 | |
| 35 uint32_t stack_len; | |
| 36 // Immediately followed by |stack_len| more addresses. | |
| 37 }; | |
| 38 | |
| 39 struct FreePacket { | |
| 40 uint32_t op; // = kFreePacketType | |
| 41 | |
| 42 uint64_t time; | |
| 43 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
| |
| 44 }; | |
| 45 #pragma pack(pop) | |
| 46 | |
| 12 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 13 // Prefix for pipe name for communicating between chrome processes and the | 48 // Prefix for pipe name for communicating between chrome processes and the |
| 14 // memlog process. The pipe ID is appended to this to get the pipe name. | 49 // memlog process. The pipe ID is appended to this to get the pipe name. |
| 15 extern const wchar_t kWindowsPipePrefix[]; | 50 extern const wchar_t kWindowsPipePrefix[]; |
| 16 #endif // OS_WIN | 51 #endif // OS_WIN |
| 17 | 52 |
| 18 } // namespace profiling | 53 } // namespace profiling |
| 19 | 54 |
| 20 #endif // CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ | 55 #endif // CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ |
| OLD | NEW |