Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions libkineto/src/output_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,27 @@ void ChromeTraceLogger::handleCpuActivity(
return;
}

auto op_metadata = op.getMetadata();
std::string separator = "";
if (op_metadata.find_first_not_of(" \t\n") != std::string::npos) {
separator = ",";
}
// clang-format off
traceOf_ << fmt::format(R"JSON(
{{
"ph": "X", "cat": "Operator", {},
"args": {{
"Device": {}, "External id": {},
"Trace name": "{}", "Trace iteration": {},
"Trace name": "{}", "Trace iteration": {} {}
{}
}}
}},)JSON",
traceActivityJson(op, ""),
// args
op.device, op.correlation,
span.name, span.iteration,
op.getMetadata());
separator,
op_metadata);
// clang-format on
}

Expand Down