| /* |
| * Copyright (C) 2018 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| syntax = "proto3"; |
| |
| package profiler.proto; |
| |
| service InternalCpuService { |
| // Through this API, agent notifies daemon when a method tracing API is called |
| // in ART. Since there are a variety of APIs to start tracing, the API's |
| // (a method of android.os.Debug) name and signature are reported, as well as |
| // the values of the arguments. The daemon has succesfully recorded the trace |
| // request IFF the grpc returns Status::OK. |
| rpc SendTraceEvent(CpuTraceOperationRequest) |
| returns (CpuTraceOperationResponse) { |
| } |
| } |
| |
| message CpuStartTraceApiInfo { |
| string method_name = 1; |
| string method_signature = 2; // e.g., "(Ljava/lang/String;)V". |
| string arg_trace_path = 3; |
| int32 arg_buffer_size = 4; |
| int32 arg_flags = 5; |
| int32 arg_interval_us = 6; |
| } |
| |
| message CpuStopTraceApiInfo { |
| bytes trace_content = 1; |
| } |
| |
| message CpuTraceOperationRequest { |
| int32 pid = 1; |
| // Native thread ID of the thread invoking the method tracing API. |
| int32 thread_id = 2; |
| int64 timestamp = 3; |
| oneof detail { |
| CpuStartTraceApiInfo start = 4; |
| CpuStopTraceApiInfo stop = 5; |
| } |
| } |
| |
| // The field must be set if the corresponding request is for a start event. |
| // It is optional for a stop event. |
| message CpuTraceOperationResponse { |
| bool start_operation_allowed = 1; |
| } |