Commit a28851ca authored by manzagop's avatar manzagop Committed by Commit bot

A simple minidump writer for postmortem stability reports.

Enables writing a minimal minidump for wrapping a StabilityReport protocol buffer. The minidump is meant to be valid for registration with the Crashpad reporter (includes the Crashpad info stream).

BUG=620813

Review-Url: https://codereview.chromium.org/2327043002
Cr-Commit-Position: refs/heads/master@{#418863}
parent 6f86fdaf
......@@ -2,6 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/protobuf/proto_library.gni")
proto_library("stability_report_proto") {
sources = [
"stability_report.proto",
]
}
static_library("browser_watcher") {
# This is a separate lib to minimize the dependencies for its
# hosting binary "chrome_watcher.dll".
......@@ -33,12 +41,28 @@ static_library("browser_watcher_client") {
]
}
static_library("postmortem_minidump_writer") {
# TODO(manzagop): remove this lib once Crashpad writes the minidumps.
sources = [
"postmortem_minidump_writer.h",
"postmortem_minidump_writer_win.cc",
]
deps = [
":stability_report_proto",
"//base",
"//third_party/crashpad/crashpad/client",
"//third_party/crashpad/crashpad/minidump",
"//third_party/crashpad/crashpad/util",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"endsession_watcher_window_win_unittest.cc",
"exit_code_watcher_win_unittest.cc",
"exit_funnel_win_unittest.cc",
"postmortem_minidump_writer_win_unittest.cc",
"watcher_client_win_unittest.cc",
"watcher_metrics_provider_win_unittest.cc",
"window_hang_monitor_win_unittest.cc",
......@@ -47,8 +71,17 @@ source_set("unit_tests") {
deps = [
":browser_watcher",
":browser_watcher_client",
":postmortem_minidump_writer",
":stability_report_proto",
"//base",
"//base/test:test_support",
"//testing/gtest",
"//third_party/crashpad/crashpad/client",
# TODO(manzagop): remove this lib once Crashpad writes the minidumps.
"//third_party/crashpad/crashpad/compat",
"//third_party/crashpad/crashpad/minidump",
"//third_party/crashpad/crashpad/snapshot",
"//third_party/crashpad/crashpad/util",
]
}
include_rules = [
"+components/metrics"
"+components/metrics",
"+third_party/crashpad/crashpad",
]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_
#define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_
#include <stdint.h>
#include <string>
#include "base/files/file.h"
#include "components/browser_watcher/stability_report.pb.h"
#include "third_party/crashpad/crashpad/util/misc/uuid.h"
namespace browser_watcher {
// Minidump information required by the Crashpad reporter.
struct MinidumpInfo {
crashpad::UUID client_id; // The client's identifier.
crashpad::UUID report_id; // The report's identifier.
std::string product_name; // The product name to be used by the reporter.
std::string version_number; // The product's version number.
};
// Write to |minidump_file| a minimal minidump that wraps |report|. Returns
// true on success, false otherwise.
// Note: the caller owns |minidump_file| and is responsible for keeping it valid
// for this function's duration. |minidump_file| is expected to be empty
// and a binary stream.
bool WritePostmortemDump(base::PlatformFile minidump_file,
const StabilityReport& report,
const MinidumpInfo& minidump_info);
} // namespace browser_watcher
#endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Note: aside from using windows headers to obtain the definitions of minidump
// structures, nothing here is windows specific. This seems like the best
// approach given this code is for temporary experimentation on Windows.
// Longer term, Crashpad will take over the minidump writing in this case as
// well.
#include "components/browser_watcher/postmortem_minidump_writer.h"
#include <windows.h> // NOLINT
#include <dbghelp.h>
#include <map>
#include <type_traits>
#include <vector>
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_piece.h"
#include "third_party/crashpad/crashpad/minidump/minidump_extensions.h"
namespace browser_watcher {
namespace {
// The stream type assigned to the minidump stream that holds the serialized
// stability report.
// Note: the value was obtained by adding 1 to the stream type used for holding
// the SyzyAsan proto.
// TODO(manzagop): centralize the stream type definitions to avoid issues.
const uint32_t kStabilityReportStreamType = 0x4B6B0002;
int64_t GetFileOffset(base::File* file) {
DCHECK(file);
return file->Seek(base::File::FROM_CURRENT, 0LL);
}
// Returns true if the file is empty, and false if the file is not empty or if
// there is an error.
bool IsFileEmpty(base::File* file) {
DCHECK(file);
int64_t end = file->Seek(base::File::FROM_END, 0LL);
return end == 0LL;
}
// A class with functionality for writing minimal minidump containers to wrap
// postmortem stability reports.
// TODO(manzagop): remove this class once Crashpad takes over writing postmortem
// minidumps.
// TODO(manzagop): revisit where the module information should be transported,
// in the protocol buffer or in a module stream.
class PostmortemMinidumpWriter {
public:
PostmortemMinidumpWriter();
~PostmortemMinidumpWriter();
// Write to |minidump_file| a minimal minidump that wraps |report|. Returns
// true on success, false otherwise.
// Note: the caller owns |minidump_file| and is responsible for keeping it
// valid for this object's lifetime. |minidump_file| is expected to be empty
// and a binary stream.
bool WriteDump(base::PlatformFile minidump_file,
const StabilityReport& report,
const MinidumpInfo& minidump_info);
private:
// An offset within a minidump file. Note: using this type to avoid including
// windows.h and relying on the RVA type.
using FilePosition = uint32_t;
// The minidump header is always located at the head.
static const FilePosition kHeaderPos = 0U;
bool WriteDumpImpl(const StabilityReport& report,
const MinidumpInfo& minidump_info);
bool AppendCrashpadInfo(const crashpad::UUID& client_id,
const crashpad::UUID& report_id,
const std::map<std::string, std::string>& crash_keys);
bool AppendCrashpadDictionaryEntry(
const std::string& key,
const std::string& value,
std::vector<crashpad::MinidumpSimpleStringDictionaryEntry>* entries);
// Allocate |size_bytes| within the minidump. On success, |pos| contains the
// location of the allocation. Returns true on success, false otherwise.
bool Allocate(size_t size_bytes, FilePosition* pos);
// Seeks |cursor_|. The seek operation is kept separate from the write in
// order to make the call explicit. Seek operations can be costly and should
// be avoided.
bool SeekCursor(FilePosition destination);
// Write to pre-allocated space.
// Note: |pos| must match |cursor_|.
template <class DataType>
bool Write(FilePosition pos, const DataType& data);
bool WriteBytes(FilePosition pos, size_t size_bytes, const char* data);
// Allocate space for and write the contents of |data|. On success, |pos|
// contains the location of the write. Returns true on success, false
// otherwise.
template <class DataType>
bool Append(const DataType& data, FilePosition* pos);
template <class DataType>
bool AppendVec(const std::vector<DataType>& data, FilePosition* pos);
bool AppendUtf8String(base::StringPiece data, FilePosition* pos);
bool AppendBytes(base::StringPiece data, FilePosition* pos);
void RegisterDirectoryEntry(uint32_t stream_type,
FilePosition pos,
uint32_t size);
// The next allocatable FilePosition.
FilePosition next_available_byte_;
// Storage for the directory during writes.
std::vector<MINIDUMP_DIRECTORY> directory_;
// The file to write to. Only valid within the scope of a call to WriteDump.
base::File* minidump_file_;
DISALLOW_COPY_AND_ASSIGN(PostmortemMinidumpWriter);
};
PostmortemMinidumpWriter::PostmortemMinidumpWriter()
: next_available_byte_(0U), minidump_file_(nullptr) {}
PostmortemMinidumpWriter::~PostmortemMinidumpWriter() {
DCHECK_EQ(nullptr, minidump_file_);
}
bool PostmortemMinidumpWriter::WriteDump(
base::PlatformFile minidump_platform_file,
const StabilityReport& report,
const MinidumpInfo& minidump_info) {
DCHECK_NE(base::kInvalidPlatformFile, minidump_platform_file);
DCHECK_EQ(0U, next_available_byte_);
DCHECK(directory_.empty());
DCHECK_EQ(nullptr, minidump_file_);
// We do not own |minidump_platform_file|, but we want to rely on base::File's
// API, and so we need to duplicate it.
HANDLE duplicated_handle;
BOOL duplicate_success = ::DuplicateHandle(
::GetCurrentProcess(), minidump_platform_file, ::GetCurrentProcess(),
&duplicated_handle, 0, FALSE, DUPLICATE_SAME_ACCESS);
if (!duplicate_success)
return false;
base::File minidump_file(duplicated_handle);
DCHECK(minidump_file.IsValid());
minidump_file_ = &minidump_file;
DCHECK_EQ(0LL, GetFileOffset(minidump_file_));
DCHECK(IsFileEmpty(minidump_file_));
// Write the minidump, then reset members.
bool success = WriteDumpImpl(report, minidump_info);
next_available_byte_ = 0U;
directory_.clear();
minidump_file_ = nullptr;
return success;
}
bool PostmortemMinidumpWriter::WriteDumpImpl(
const StabilityReport& report,
const MinidumpInfo& minidump_info) {
// Allocate space for the header and seek the cursor.
FilePosition pos = 0U;
if (!Allocate(sizeof(MINIDUMP_HEADER), &pos))
return false;
if (!SeekCursor(sizeof(MINIDUMP_HEADER)))
return false;
DCHECK_EQ(kHeaderPos, pos);
// Write the proto to the file.
std::string serialized_report;
if (!report.SerializeToString(&serialized_report))
return false;
FilePosition report_pos = 0U;
if (!AppendBytes(serialized_report, &report_pos))
return false;
// The directory entry for the stability report's stream.
RegisterDirectoryEntry(kStabilityReportStreamType, report_pos,
serialized_report.length());
// Write mandatory crash keys. These will be read by crashpad and used as
// http request parameters for the upload. Keys and values should match
// server side configuration.
// TODO(manzagop): use product and version from the stability report. The
// current executable's values are an (imperfect) proxy.
std::map<std::string, std::string> crash_keys = {
{"product", minidump_info.product_name + "_Postmortem"},
{"version", minidump_info.version_number}};
if (!AppendCrashpadInfo(minidump_info.client_id, minidump_info.report_id,
crash_keys))
return false;
// Write the directory.
FilePosition directory_pos = 0U;
if (!AppendVec(directory_, &directory_pos))
return false;
// Write the header.
MINIDUMP_HEADER header;
header.Signature = MINIDUMP_SIGNATURE;
header.Version = MINIDUMP_VERSION;
header.NumberOfStreams = directory_.size();
header.StreamDirectoryRva = directory_pos;
if (!SeekCursor(0U))
return false;
return Write(kHeaderPos, header);
}
bool PostmortemMinidumpWriter::AppendCrashpadInfo(
const crashpad::UUID& client_id,
const crashpad::UUID& report_id,
const std::map<std::string, std::string>& crash_keys) {
// Write the crash keys as the contents of a crashpad dictionary.
std::vector<crashpad::MinidumpSimpleStringDictionaryEntry> entries;
for (const auto& crash_key : crash_keys) {
if (!AppendCrashpadDictionaryEntry(crash_key.first, crash_key.second,
&entries)) {
return false;
}
}
// Write the dictionary's index.
FilePosition dict_pos = 0U;
uint32_t entry_count = entries.size();
if (entry_count > 0) {
if (!Append(entry_count, &dict_pos))
return false;
FilePosition unused_pos = 0U;
if (!AppendVec(entries, &unused_pos))
return false;
}
MINIDUMP_LOCATION_DESCRIPTOR simple_annotations = {0};
simple_annotations.DataSize = 0U;
if (entry_count > 0)
simple_annotations.DataSize = next_available_byte_ - dict_pos;
// Note: an RVA of 0 indicates the absence of a dictionary.
simple_annotations.Rva = dict_pos;
// Write the crashpad info.
crashpad::MinidumpCrashpadInfo crashpad_info;
crashpad_info.version = crashpad::MinidumpCrashpadInfo::kVersion;
crashpad_info.report_id = report_id;
crashpad_info.client_id = client_id;
crashpad_info.simple_annotations = simple_annotations;
// Note: module_list is left at 0, which means none.
FilePosition crashpad_pos = 0U;
if (!Append(crashpad_info, &crashpad_pos))
return false;
// Append a directory entry for the crashpad info stream.
RegisterDirectoryEntry(crashpad::kMinidumpStreamTypeCrashpadInfo,
crashpad_pos, sizeof(crashpad::MinidumpCrashpadInfo));
return true;
}
bool PostmortemMinidumpWriter::AppendCrashpadDictionaryEntry(
const std::string& key,
const std::string& value,
std::vector<crashpad::MinidumpSimpleStringDictionaryEntry>* entries) {
DCHECK_NE(nullptr, entries);
FilePosition key_pos = 0U;
if (!AppendUtf8String(key, &key_pos))
return false;
FilePosition value_pos = 0U;
if (!AppendUtf8String(value, &value_pos))
return false;
crashpad::MinidumpSimpleStringDictionaryEntry entry = {0};
entry.key = key_pos;
entry.value = value_pos;
entries->push_back(entry);
return true;
}
bool PostmortemMinidumpWriter::Allocate(size_t size_bytes, FilePosition* pos) {
DCHECK(pos);
*pos = next_available_byte_;
base::CheckedNumeric<FilePosition> next = next_available_byte_;
next += size_bytes;
if (!next.IsValid())
return false;
next_available_byte_ += size_bytes;
return true;
}
bool PostmortemMinidumpWriter::SeekCursor(FilePosition destination) {
DCHECK_NE(nullptr, minidump_file_);
DCHECK(minidump_file_->IsValid());
// Validate the write does not extend past the allocated space.
if (destination > next_available_byte_)
return false;
int64_t new_pos = minidump_file_->Seek(base::File::FROM_BEGIN,
static_cast<int64_t>(destination));
return new_pos != -1;
}
template <class DataType>
bool PostmortemMinidumpWriter::Write(FilePosition pos, const DataType& data) {
static_assert(std::is_trivially_copyable<DataType>::value,
"restricted to trivially copyable");
return WriteBytes(pos, sizeof(data), reinterpret_cast<const char*>(&data));
}
bool PostmortemMinidumpWriter::WriteBytes(FilePosition pos,
size_t size_bytes,
const char* data) {
DCHECK(data);
DCHECK_NE(nullptr, minidump_file_);
DCHECK(minidump_file_->IsValid());
DCHECK_EQ(static_cast<int64_t>(pos), GetFileOffset(minidump_file_));
// Validate the write does not extend past the next available byte.
base::CheckedNumeric<FilePosition> pos_end = pos;
pos_end += size_bytes;
if (!pos_end.IsValid() || pos_end.ValueOrDie() > next_available_byte_)
return false;
int size_bytes_signed = static_cast<int>(size_bytes);
CHECK_LE(0, size_bytes_signed);
int written_bytes =
minidump_file_->WriteAtCurrentPos(data, size_bytes_signed);
if (written_bytes < 0)
return false;
return static_cast<size_t>(written_bytes) == size_bytes;
}
template <class DataType>
bool PostmortemMinidumpWriter::Append(const DataType& data, FilePosition* pos) {
static_assert(std::is_trivially_copyable<DataType>::value,
"restricted to trivially copyable");
DCHECK(pos);
if (!Allocate(sizeof(data), pos))
return false;
return Write(*pos, data);
}
template <class DataType>
bool PostmortemMinidumpWriter::AppendVec(const std::vector<DataType>& data,
FilePosition* pos) {
static_assert(std::is_trivially_copyable<DataType>::value,
"restricted to trivially copyable");
DCHECK(!data.empty());
DCHECK(pos);
size_t size_bytes = sizeof(DataType) * data.size();
if (!Allocate(size_bytes, pos))
return false;
return WriteBytes(*pos, size_bytes,
reinterpret_cast<const char*>(&data.at(0)));
}
bool PostmortemMinidumpWriter::AppendUtf8String(base::StringPiece data,
FilePosition* pos) {
DCHECK(pos);
uint32_t string_size = data.size();
if (!Append(string_size, pos))
return false;
FilePosition unused_pos = 0U;
return AppendBytes(data, &unused_pos);
}
bool PostmortemMinidumpWriter::AppendBytes(base::StringPiece data,
FilePosition* pos) {
DCHECK(pos);
if (!Allocate(data.length(), pos))
return false;
return WriteBytes(*pos, data.length(), data.data());
}
void PostmortemMinidumpWriter::RegisterDirectoryEntry(uint32_t stream_type,
FilePosition pos,
uint32_t size) {
MINIDUMP_DIRECTORY entry = {0};
entry.StreamType = stream_type;
entry.Location.Rva = pos;
entry.Location.DataSize = size;
directory_.push_back(entry);
}
} // namespace
bool WritePostmortemDump(base::PlatformFile minidump_file,
const StabilityReport& report,
const MinidumpInfo& minidump_info) {
PostmortemMinidumpWriter writer;
return writer.WriteDump(minidump_file, report, minidump_info);
}
} // namespace browser_watcher
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/browser_watcher/postmortem_minidump_writer.h"
#include <windows.h> // NOLINT
#include <dbghelp.h>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/files/scoped_temp_dir.h"
#include "base/win/scoped_handle.h"
#include "components/browser_watcher/stability_report.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/crashpad/crashpad/snapshot/minidump/process_snapshot_minidump.h"
#include "third_party/crashpad/crashpad/util/file/file_reader.h"
#include "third_party/crashpad/crashpad/util/misc/uuid.h"
namespace browser_watcher {
using crashpad::UUID;
const char kProductName[] = "some-product";
const char kExpectedProductName[] = "some-product_Postmortem";
const char kVersion[] = "51.0.2704.106";
class WritePostmortemDumpTest : public testing::Test {
public:
void SetUp() override {
testing::Test::SetUp();
expected_client_id_ = UUID(UUID::InitializeWithNewTag{});
expected_report_id_ = UUID(UUID::InitializeWithNewTag{});
// Create a stability report.
// TODO(manzagop): flesh out the report once proto is more detailed.
ProcessState* process_state = expected_report_.add_process_states();
CodeModule* module = process_state->add_modules();
module->set_base_address(1024);
module->set_code_file("some_code_file.dll");
// Write the minidump.
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
minidump_path_ = temp_dir_.path().AppendASCII("minidump.dmp");
}
bool WriteDump() {
base::win::ScopedHandle file_handle(::CreateFile(
minidump_path_.value().c_str(), GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, CREATE_NEW,
FILE_ATTRIBUTE_NORMAL, nullptr));
if (!file_handle.IsValid())
return false;
MinidumpInfo mindump_info;
mindump_info.client_id = expected_client_id_;
mindump_info.report_id = expected_report_id_;
mindump_info.product_name = kProductName;
mindump_info.version_number = kVersion;
return WritePostmortemDump(file_handle.Get(), expected_report_,
mindump_info);
}
const base::FilePath& minidump_path() { return minidump_path_; }
const UUID& expected_client_id() { return expected_client_id_; }
const UUID& expected_report_id() { return expected_report_id_; }
const StabilityReport& expected_report() { return expected_report_; }
private:
base::ScopedTempDir temp_dir_;
base::FilePath minidump_path_;
UUID expected_client_id_;
UUID expected_report_id_;
StabilityReport expected_report_;
};
TEST_F(WritePostmortemDumpTest, ValidateStabilityReportTest) {
ASSERT_TRUE(WriteDump());
// Read back the minidump to extract the proto.
// TODO(manzagop): rely on crashpad for reading the proto once crashpad
// supports it (https://crashpad.chromium.org/bug/10).
base::ScopedFILE minidump_file;
minidump_file.reset(base::OpenFile(minidump_path(), "rb"));
ASSERT_TRUE(minidump_file.get());
MINIDUMP_HEADER header = {};
ASSERT_EQ(1U, fread(&header, sizeof(header), 1, minidump_file.get()));
ASSERT_EQ(static_cast<ULONG32>(MINIDUMP_SIGNATURE), header.Signature);
ASSERT_EQ(2U, header.NumberOfStreams);
RVA directory_rva = header.StreamDirectoryRva;
MINIDUMP_DIRECTORY directory = {};
ASSERT_EQ(0, fseek(minidump_file.get(), directory_rva, SEEK_SET));
ASSERT_EQ(1U, fread(&directory, sizeof(directory), 1, minidump_file.get()));
ASSERT_EQ(0x4B6B0002U, directory.StreamType);
RVA report_rva = directory.Location.Rva;
ULONG32 report_size_bytes = directory.Location.DataSize;
std::string recovered_serialized_report;
recovered_serialized_report.resize(report_size_bytes);
ASSERT_EQ(0, fseek(minidump_file.get(), report_rva, SEEK_SET));
ASSERT_EQ(report_size_bytes, fread(&recovered_serialized_report.at(0), 1,
report_size_bytes, minidump_file.get()));
// Validate the recovered report.
std::string expected_serialized_report;
expected_report().SerializeToString(&expected_serialized_report);
ASSERT_EQ(expected_serialized_report, recovered_serialized_report);
StabilityReport recovered_report;
ASSERT_TRUE(recovered_report.ParseFromString(recovered_serialized_report));
}
TEST_F(WritePostmortemDumpTest, CrashpadCanReadTest) {
ASSERT_TRUE(WriteDump());
// Validate crashpad can read the produced minidump.
crashpad::FileReader minidump_file_reader;
ASSERT_TRUE(minidump_file_reader.Open(minidump_path()));
crashpad::ProcessSnapshotMinidump minidump_process_snapshot;
ASSERT_TRUE(minidump_process_snapshot.Initialize(&minidump_file_reader));
// Validate the crashpadinfo.
UUID client_id;
minidump_process_snapshot.ClientID(&client_id);
ASSERT_EQ(expected_client_id(), client_id);
UUID report_id;
minidump_process_snapshot.ReportID(&report_id);
ASSERT_EQ(expected_report_id(), report_id);
std::map<std::string, std::string> parameters =
minidump_process_snapshot.AnnotationsSimpleMap();
auto it = parameters.find("product");
ASSERT_NE(parameters.end(), it);
ASSERT_EQ(kExpectedProductName, it->second);
it = parameters.find("version");
ASSERT_NE(parameters.end(), it);
ASSERT_EQ(kVersion, it->second);
}
} // namespace browser_watcher
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package browser_watcher;
// The state of the system on which Chrome is running (shutting down, battery
// level, load, etc.).
message SystemState {
// TODO(manzagop): flesh out.
}
message CodeModule {
// The base address of this code module as it was loaded by the process.
optional int64 base_address = 1;
// The size of the code module.
optional int64 size = 2;
// The path or file name that the code module was loaded from.
optional string code_file = 3;
// An identifying string used to discriminate between multiple versions and
// builds of the same code module. This may contain a uuid, timestamp,
// version number, or any combination of this or other information, in an
// implementation-defined format.
optional string code_identifier = 4;
// The filename containing debugging information associated with the code
// module. If debugging information is stored in a file separate from the
// code module itself (as is the case when .pdb or .dSYM files are used),
// this will be different from code_file. If debugging information is
// stored in the code module itself (possibly prior to stripping), this
// will be the same as code_file.
optional string debug_file = 5;
// An identifying string similar to code_identifier, but identifies a
// specific version and build of the associated debug file. This may be
// the same as code_identifier when the debug_file and code_file are
// identical or when the same identifier is used to identify distinct
// debug and code files.
optional string debug_identifier = 6;
// A human-readable representation of the code module's version.
optional string version = 7;
}
// The state of a thread.
message ThreadState {
optional string thread_name = 1;
// TODO(manzagop): flesh out.
}
// The state of a process.
message ProcessState {
// Note: likely only a subset of modules of interest (e.g. Chromium's own
// modules).
repeated CodeModule modules = 1;
repeated ThreadState threads = 2;
// TODO(manzagop): add experiment state.
}
// A stability report contains information pertaining to the execution of a
// single logical instance of a "chrome browser". It is comprised of information
// about the system state and about the chrome browser's processes.
message StabilityReport {
optional SystemState system_state = 1;
// TODO(manzagop): revisit whether a single repeated field should contain all
// processes, or whether it's preferable to have separate fields per type.
// TODO(manzagop): add information about the type of process, pid, process
// times (e.g. start time), hierarchical relationships (e.g. parent pid),
// command line, etc.
repeated ProcessState process_states = 2;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment