xref: /aosp_15_r20/external/pigweed/pw_snapshot/pw_snapshot_protos/snapshot_metadata.proto (revision 61c4878ac05f98d0ceed94b57d316916de578985)
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    RV32E = 4;
30    RV32I = 5;
31    RV64E = 6;
32    RV64I = 7;
33    RV128I = 8;
34  }
35}
36
37message Metadata {
38  // A relatively unique descriptive reason for what triggered the snapshot
39  // capture. This should either be human readable text, or tokenized data
40  // (e.g. base-64 encoded or binary data).
41  //
42  // Examples:
43  //   Null-pointer dereference
44  //   [main.cc:22] True is not false!
45  //   STACK_OVERFLOW
46  bytes reason = 1 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
47
48  // Whether or not the snapshot was captured due to a crash of some kind.
49  bool fatal = 2;
50
51  // Project name to assist in identifying where to redirect this snapshot. A
52  // single project might have multiple devices that can produce snapshots.
53  bytes project_name = 3 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
54
55  // Version characters must be alphanumeric, punctuation, and space. This
56  // string is case-sensitive. This should always be human readable text, and
57  // does not support tokenization by design. If this field was tokenized, it's
58  // possible that the token could be lost (e.g. generated by a local developer
59  // build and not uploaded anywhere) and a firmware version running on a device
60  // in the field would be left entirely unidentifiable.
61  //
62  // Examples:
63  //   "codename-local-[build_id]"
64  //   "codename-release-193"
65  string software_version = 4;
66
67  // UUID associated with the build for the software version.
68  bytes software_build_uuid = 5;
69
70  // String containing the specific device name. This should be as specific as
71  // possible, detailing hardware revision, and distinguishing different cores
72  // in a multi-core device. Snapshots aggregated as related_snapshots should
73  // include information that distinguishes the source of the snapshot. This
74  // should either be human readable text, or tokenized data.
75  //
76  // Examples:
77  //   "propellerhat-evk"
78  //   "gshoe-sensor-core-pvt"
79  //   "alarm-clock-dsp-p1"
80  bytes device_name = 6 [(tokenizer.format) = TOKENIZATION_OPTIONAL];
81
82  // 128-bit UUID for this snapshot, used to help with de-duplication.
83  bytes snapshot_uuid = 7;
84
85  // The architecture of the CPU that generated this report.
86  CpuArchitecture.Enum cpu_arch = 8;
87}
88
89// This message overlays the pw.snapshot.Snapshot proto. It's valid to encode
90// this message to the same sink that a Snapshot proto is being written to.
91message SnapshotBasicInfo {
92  Metadata metadata = 16;
93  map<string, string> tags = 17;
94}
95