blob: c1b44386ab4af9150eae9197893b895c1b88c37c [file] [log] [blame]
/*
* Copyright (C) 2016 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;
option java_package = "com.android.tools.profiler.proto";
option java_outer_classname = "GraphicsProfiler";
import "common.proto";
service GraphicsService {
// Returns graphics data from the monitored Activity. This will return no data for
// Activities that do not use a SurfaceView.
rpc GetData(GraphicsDataRequest) returns (GraphicsDataResponse) {
}
// Starts collecting execution metrics of a running app's SurfaceView Activity, such
// as frame stats. Does nothing if the app is already being monitored.
rpc StartMonitoringGraphics(GraphicsStartRequest) returns (GraphicsStartResponse) {
}
// Stops monitoring a running app. Does nothing if the app is not being
// monitored.
rpc StopMonitoringGraphics(GraphicsStopRequest) returns (GraphicsStopResponse) {
}
}
// Requests graphics data from the app's Activity, in the time range
// from |start_timestamp| (exclusive) to |end_timestamp| (inclusive), or
// mathematically written as in interval (start_timestamp, end_timestamp].
message GraphicsDataRequest {
Session session = 1;
int64 start_timestamp = 2; // Use -2^63 if no data is too old to return.
int64 end_timestamp = 3; // Use 2^63 - 1 if no data is too recent to return.
}
// Response contains data on the frames rendered within the requested time.
message GraphicsDataResponse {
repeated GraphicsData data = 1;
}
message GraphicsStartRequest {
Session session = 1;
}
message GraphicsStartResponse {
enum Status {
UNSPECIFIED = 0;
SUCCESS = 1;
FAILURE = 2;
}
Status status = 1;
}
message GraphicsStopRequest {
Session session = 1;
}
message GraphicsStopResponse {
enum Status {
UNSPECIFIED = 0;
SUCCESS = 1;
FAILURE = 2;
}
Status status = 1;
}
// Graphics data of a SurfaceView frame.
message GraphicsData {
int64 end_timestamp = 1;
FrameStats frame_stats = 2;
}
// Framestats of a SurfaceView frame.
message FrameStats {
// The app draw timestamp in nanoseconds (when the app started to draw)
int64 app_draw_timestamp = 1;
// The vsync timestamp in nanoseconds immediately after SF submited the frame to the h/w
int64 vsync_timestamp = 2;
// The timestamp in nanoseconds immediately after SF submitted the frame to the h/w
int64 set_timestamp = 3;
}