blob: a090545a1b5d9bb6f33c77921475e1c0c40eae8d [file] [log] [blame]
/*
* 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 perfd 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.
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 {
int32 trace_id = 1;
bytes trace_content = 2;
}
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 trace ID is generated by perfd to ensure the uniqueness. The fields must
// be set if the corresponding request is for a start event. They are optional
// for a stop event.
message CpuTraceOperationResponse {
bool start_operation_allowed = 1;
int32 trace_id = 2;
}