/* Copyright 2025 The OpenXLA Authors. All Rights Reserved.

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 xprof.pywrap;

service XprofAnalysisWorkerService {
  // Retrieves specific tool's data for specific session.
  // TODO(subhamsoni): Add the deadline to the service.
  rpc GetProfileData(WorkerProfileDataRequest)
      returns (WorkerProfileDataResponse);
}

message ProfileDataRequest {
  // The absolute path to the xplane.pb file.
  string session_id = 1;
  // The name of the tool to run.
  string tool_name = 2;
  map<string, string> parameters = 3;
}

message WorkerProfileDataRequest {
  // The original request that triggered this worker request.
  ProfileDataRequest origin_request = 1;
}

message WorkerProfileDataResponse {
  // The absolute path to the tool specific output.
  bytes output = 1;
  // A unique identifier for the worker that handled the request.
  string worker_id = 2;
}
