| 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 |
| 16 static const uint32_t kAllocPacketType = 0xA1A1A1A1; |
| 17 static const uint32_t kFreePacketType = 0xFEFEFEFE; |
| 18 |
| 19 #pragma pack(push, 1) |
| 20 struct StreamHeader { |
| 21 uint32_t signature; // kStreamSignature |
| 22 }; |
| 23 |
| 24 struct AllocPacket { |
| 25 uint32_t op; // = kAllocPacketType |
| 26 |
| 27 uint64_t time; |
| 28 uint64_t address; |
| 29 uint64_t size; |
| 30 |
| 31 uint32_t stack_len; |
| 32 // Immediately followed by |stack_len| more addresses. |
| 33 }; |
| 34 |
| 35 struct FreePacket { |
| 36 uint32_t op; // = kFreePacketType |
| 37 |
| 38 uint64_t time; |
| 39 uint64_t address; |
| 40 }; |
| 41 #pragma pack(pop) |
| 42 |
| 12 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
| 13 // Prefix for pipe name for communicating between chrome processes and the | 44 // 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. | 45 // memlog process. The pipe ID is appended to this to get the pipe name. |
| 15 extern const wchar_t kWindowsPipePrefix[]; | 46 extern const wchar_t kWindowsPipePrefix[]; |
| 16 #endif // OS_WIN | 47 #endif // OS_WIN |
| 17 | 48 |
| 18 } // namespace profiling | 49 } // namespace profiling |
| 19 | 50 |
| 20 #endif // CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ | 51 #endif // CHROME_COMMON_PROFILING_MEMLOG_STREAM_H_ |
| OLD | NEW |