xref: /aosp_15_r20/external/pigweed/pw_trace_tokenized/pw_trace_protos/trace_service.proto (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1// Copyright 2023 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.trace.proto;
17
18import "pw_chrono_protos/chrono.proto";
19
20// TODO: b/309643763 - This is the prefered service for tracing, and the service
21// defined in trace_rpc.proto has been deprecated and will be removed once
22// existings clients migrate to this service.
23service TraceService {
24  // Start will enable tracing, populating the trace ring buffer.
25  rpc Start(StartRequest) returns (StartResponse) {}
26
27  // On stop the ring buffer will be written to the configured
28  // stream.  No data is written to the stream until Stop is called.
29  rpc Stop(StopRequest) returns (StopResponse) {}
30
31  // Returns the clock paramaters of the system.
32  rpc GetClockParameters(ClockParametersRequest)
33      returns (ClockParametersResponse) {}
34}
35
36message StartRequest {}
37
38message StartResponse {}
39
40message StopRequest {}
41
42message StopResponse {
43  // as a convenience, the file id is returned on stop which can be
44  // used to start a transfer directly, rather that requiring a user
45  // list the files to obtain the file id.
46  optional uint32 file_id = 1;
47}
48
49message ClockParametersRequest {}
50
51message ClockParametersResponse {
52  pw.chrono.ClockParameters clock_parameters = 1;
53}
54