| // Copyright 2017 The Chromium OS 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 = "proto3"; |
| |
| option cc_enable_arenas = true; |
| |
| // This file defines services that will be running on the host for the VM. |
| package vm_tools; |
| |
| import "common.proto"; |
| |
| // Used to indicate a crash of an application inside the VM. |
| message CrashReportRequest { |
| // Name of the program that crashed. |
| string exe_name = 1; |
| // The core dump after it’s been converted to a minidump. |
| bytes minidump = 2; |
| // Any additional metadata that we want to upload with the minidump. |
| map<string, string> metadata = 3; |
| } |
| |
| // Timestamp message as defined by google.protobuf.timestamp.proto |
| message Timestamp { |
| // Represents seconds of UTC time since Unix epoch |
| // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to |
| // 9999-12-31T23:59:59Z inclusive. |
| int64 seconds = 1; |
| |
| // Non-negative fractions of a second at nanosecond resolution. Negative |
| // second values with fractions must still have non-negative nanos values |
| // that count forward in time. Must be from 0 to 999,999,999 |
| // inclusive. |
| int32 nanos = 2; |
| } |
| |
| // Log severity levels as described by RFC3164. The values don't line up with |
| // the ones defined by RFC3164 because proto3 requires all fields to have |
| // default values and the default value for an enum is 0. In case the severity |
| // field is missing it's better to default to UNKNOWN instead of EMERGENCY. |
| enum LogSeverity { |
| MISSING = 0; // Default value. |
| EMERGENCY = 1; // System is unusable. |
| ALERT = 2; // Action must be taken immediately. |
| CRITICAL = 3; // Critical conditions. |
| ERROR = 4; // Error conditions. |
| WARNING = 5; // Warning conditions. |
| NOTICE = 6; // Normal but significant condition. |
| INFO = 7; // Informational messages. |
| DEBUG = 8; // Debug-level messages. |
| } |
| |
| // Serialized log message. |
| message LogRecord { |
| // Severity of the message. |
| LogSeverity severity = 1; |
| |
| // Time that the message was created. |
| Timestamp timestamp = 2; |
| |
| // Actual content of the message. |
| bytes content = 5; |
| } |
| |
| // A request to log information. Multiple records may be coalesced into a |
| // single request. |
| message LogRequest { |
| repeated LogRecord records = 1; |
| } |
| |
| // The LogCollector service stores log records that were generated from within |
| // a VM in a persistent location outside the VM. |
| service LogCollector { |
| // Collect and store logs generated by the VM kernel. |
| rpc CollectKernelLogs(LogRequest) returns (EmptyMessage); |
| |
| // Collect and store logs generated by userspace applications inside the VM. |
| rpc CollectUserLogs(LogRequest) returns (EmptyMessage); |
| } |
| |
| // Service responsible for collecting crash reports from Chrome OS-controlled |
| // applications within the VM. |
| service CrashCollector { |
| // When an application in the VM crashes, maitre’d prepares |
| // the crash report by converting the core dump to a minidump, |
| // and then sends this request to concierge so that it |
| // can launch crash-reporter to report the crash. |
| rpc CollectCrashReport(CrashReportRequest) returns (EmptyMessage); |
| } |
| |
| // Service that is notified whenever a new VM starts up. |
| service StartupListener { |
| // Called by each VM when it starts up to indicate that it is ready to handle |
| // incoming requests. |
| rpc VmReady(EmptyMessage) returns (EmptyMessage); |
| } |