1// Copyright 2021 The Pigweed Authors 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); you may not 4// use this file except in compliance with the License. You may obtain a copy of 5// the License at 6// 7// https://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12// License for the specific language governing permissions and limitations under 13// the License. 14syntax = "proto3"; 15 16package pw.snapshot; 17 18import "pw_tokenizer/proto/options.proto"; 19 20option java_package = "pw.snapshot.proto"; 21option java_outer_classname = "Snapshot"; 22 23message CpuArchitecture { 24 enum Enum { 25 UNKNOWN = 0; 26 ARMV6M = 1; 27 ARMV7M = 2; 28 ARMV8M = 3; 29 } 30} 31 32message Metadata { 33 // A relatively unique descriptive reason for what triggered the snapshot 34 // capture. This should either be human readable text, or tokenized data 35 // (e.g. base-64 encoded or binary data). 36 // 37 // Examples: 38 // Null-pointer dereference 39 // [main.cc:22] True is not false! 40 // STACK_OVERFLOW 41 bytes reason = 1 [(tokenizer.format) = TOKENIZATION_OPTIONAL]; 42 43 // Whether or not the snapshot was captured due to a crash of some kind. 44 bool fatal = 2; 45 46 // Project name to assist in identifying where to redirect this snapshot. A 47 // single project might have multiple devices that can produce snapshots. 48 bytes project_name = 3 [(tokenizer.format) = TOKENIZATION_OPTIONAL]; 49 50 // Version characters must be alphanumeric, punctuation, and space. This 51 // string is case-sensitive. This should always be human readable text, and 52 // does not support tokenization by design. If this field was tokenized, it's 53 // possible that the token could be lost (e.g. generated by a local developer 54 // build and not uploaded anywhere) and a firmware version running on a device 55 // in the field would be left entirely unidentifiable. 56 // 57 // Examples: 58 // "codename-local-[build_id]" 59 // "codename-release-193" 60 string software_version = 4; 61 62 // UUID associated with the build for the software version. 63 bytes software_build_uuid = 5; 64 65 // String containing the specific device name. This should be as specific as 66 // possible, detailing hardware revision, and distinguishing different cores 67 // in a multi-core device. Snapshots aggregated as related_snapshots should 68 // include information that distinguishes the source of the snapshot. This 69 // should either be human readable text, or tokenized data. 70 // 71 // Examples: 72 // "propellerhat-evk" 73 // "gshoe-sensor-core-pvt" 74 // "alarm-clock-dsp-p1" 75 bytes device_name = 6 [(tokenizer.format) = TOKENIZATION_OPTIONAL]; 76 77 // 128-bit UUID for this snapshot, used to help with de-duplication. 78 bytes snapshot_uuid = 7; 79 80 // The architecture of the CPU that generated this report. 81 CpuArchitecture.Enum cpu_arch = 8; 82} 83 84// This message overlays the pw.snapshot.Snapshot proto. It's valid to encode 85// this message to the same sink that a Snapshot proto is being written to. 86message SnapshotBasicInfo { 87 Metadata metadata = 16; 88 map<string, string> tags = 17; 89} 90