tensorflow/core/profiler/rpc/client/remote_profiler_session_manager_test.cc
// Copied from capture_profile to not introduce a dependency.
Copied from capture_profile to not introduce a dependency.
Copied from capture_profile to not introduce a dependency .
ProfileRequest PopulateProfileRequest(
    absl::string_view repository_root, absl::string_view session_id,
    absl::string_view host_name,
    const RemoteProfilerSessionManagerOptions& options) {
  constexpr uint64 kMaxEvents = 1000000;
  const absl::string_view kXPlanePb = "xplane.pb";
  ProfileRequest request;
  request.set_duration_ms(options.profiler_options().duration_ms());
  request.set_max_events(kMaxEvents);
  request.set_repository_root(repository_root.data(), repository_root.size());
  request.set_session_id(session_id.data(), session_id.size());
  request.set_host_name(host_name.data(), host_name.size());
  request.add_tools(kXPlanePb.data(), kXPlanePb.size());
  *request.mutable_opts() = options.profiler_options();
  return request;
}
ProfileRequest PopulateProfileRequest ( absl :: string_view repository_root , absl :: string_view session_id , absl :: string_view host_name , const RemoteProfilerSessionManagerOptions & options ) { constexpr uint64 kMaxEvents = 1000000 ; const absl :: string_view kXPlanePb = " " ; ProfileRequest request ; request . set_duration_ms ( options . profiler_options ( ) . duration_ms ( ) ) ; request . set_max_events ( kMaxEvents ) ; request . set_repository_root ( repository_root . data ( ) , repository_root . size ( ) ) ; request . set_session_id ( session_id . data ( ) , session_id . size ( ) ) ; request . set_host_name ( host_name . data ( ) , host_name . size ( ) ) ; request . add_tools ( kXPlanePb . data ( ) , kXPlanePb . size ( ) ) ; * request . mutable_opts ( ) = options . profiler_options ( ) ; return request ; }
Copied from capture_profile to not introduce a dependency.
Copied from capture_profile to not introduce a dependency .
// TODO(b/169976117) Remove duration from request. // XPlane tool is only used by OSS profiler and safely ignored by TPU // profiler.