Minor cleanup for strings in xplane_to_profile_response.

PiperOrigin-RevId: 311774079
Change-Id: I445cd1121c548dd2beb133057eeab4f434939df9
This commit is contained in:
A. Unique TensorFlower 2020-05-15 11:54:21 -07:00 committed by TensorFlower Gardener
parent 362818b71e
commit 75132b735b

View File

@ -14,6 +14,8 @@ limitations under the License.
==============================================================================*/
#include "tensorflow/core/profiler/convert/xplane_to_profile_response.h"
#include <string>
#include "absl/container/flat_hash_set.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -78,14 +80,14 @@ Status ConvertProtoToJson(const Proto& proto_output, std::string* json_output) {
// tensorflow::StringPiece.
auto error_msg = status.message();
return errors::Internal(
strings::StrCat("Could not convert proto to JSON string: ",
StringPiece(error_msg.data(), error_msg.length())));
"Could not convert proto to JSON string: ",
absl::string_view(error_msg.data(), error_msg.length()));
}
return Status::OK();
}
// Returns the tool name with extension.
string ToolName(absl::string_view tool) {
std::string ToolName(absl::string_view tool) {
if (tool == kTraceViewer) return "trace.json.gz";
if (tool == kMemoryProfile) return "memory_profile.json.gz";
return absl::StrCat(tool, ".pb");