xray-graph.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. //===-- xray-graph.cpp: XRay Function Call Graph Renderer -----------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // Generate a DOT file to represent the function call graph encountered in
  10. // the trace.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "xray-graph.h"
  14. #include "xray-registry.h"
  15. #include "llvm/Support/ErrorHandling.h"
  16. #include "llvm/XRay/InstrumentationMap.h"
  17. #include "llvm/XRay/Trace.h"
  18. #include <cmath>
  19. using namespace llvm;
  20. using namespace llvm::xray;
  21. // Setup llvm-xray graph subcommand and its options.
  22. static cl::SubCommand GraphC("graph", "Generate function-call graph");
  23. static cl::opt<std::string> GraphInput(cl::Positional,
  24. cl::desc("<xray log file>"),
  25. cl::Required, cl::sub(GraphC));
  26. static cl::opt<bool>
  27. GraphKeepGoing("keep-going", cl::desc("Keep going on errors encountered"),
  28. cl::sub(GraphC), cl::init(false));
  29. static cl::alias GraphKeepGoing2("k", cl::aliasopt(GraphKeepGoing),
  30. cl::desc("Alias for -keep-going"));
  31. static cl::opt<std::string>
  32. GraphOutput("output", cl::value_desc("Output file"), cl::init("-"),
  33. cl::desc("output file; use '-' for stdout"), cl::sub(GraphC));
  34. static cl::alias GraphOutput2("o", cl::aliasopt(GraphOutput),
  35. cl::desc("Alias for -output"));
  36. static cl::opt<std::string>
  37. GraphInstrMap("instr_map",
  38. cl::desc("binary with the instrumrntation map, or "
  39. "a separate instrumentation map"),
  40. cl::value_desc("binary with xray_instr_map"), cl::sub(GraphC),
  41. cl::init(""));
  42. static cl::alias GraphInstrMap2("m", cl::aliasopt(GraphInstrMap),
  43. cl::desc("alias for -instr_map"));
  44. static cl::opt<bool> GraphDeduceSiblingCalls(
  45. "deduce-sibling-calls",
  46. cl::desc("Deduce sibling calls when unrolling function call stacks"),
  47. cl::sub(GraphC), cl::init(false));
  48. static cl::alias
  49. GraphDeduceSiblingCalls2("d", cl::aliasopt(GraphDeduceSiblingCalls),
  50. cl::desc("Alias for -deduce-sibling-calls"));
  51. static cl::opt<GraphRenderer::StatType>
  52. GraphEdgeLabel("edge-label",
  53. cl::desc("Output graphs with edges labeled with this field"),
  54. cl::value_desc("field"), cl::sub(GraphC),
  55. cl::init(GraphRenderer::StatType::NONE),
  56. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  57. "Do not label Edges"),
  58. clEnumValN(GraphRenderer::StatType::COUNT,
  59. "count", "function call counts"),
  60. clEnumValN(GraphRenderer::StatType::MIN, "min",
  61. "minimum function durations"),
  62. clEnumValN(GraphRenderer::StatType::MED, "med",
  63. "median function durations"),
  64. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  65. "90th percentile durations"),
  66. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  67. "99th percentile durations"),
  68. clEnumValN(GraphRenderer::StatType::MAX, "max",
  69. "maximum function durations"),
  70. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  71. "sum of call durations")));
  72. static cl::alias GraphEdgeLabel2("e", cl::aliasopt(GraphEdgeLabel),
  73. cl::desc("Alias for -edge-label"));
  74. static cl::opt<GraphRenderer::StatType> GraphVertexLabel(
  75. "vertex-label",
  76. cl::desc("Output graphs with vertices labeled with this field"),
  77. cl::value_desc("field"), cl::sub(GraphC),
  78. cl::init(GraphRenderer::StatType::NONE),
  79. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  80. "Do not label Vertices"),
  81. clEnumValN(GraphRenderer::StatType::COUNT, "count",
  82. "function call counts"),
  83. clEnumValN(GraphRenderer::StatType::MIN, "min",
  84. "minimum function durations"),
  85. clEnumValN(GraphRenderer::StatType::MED, "med",
  86. "median function durations"),
  87. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  88. "90th percentile durations"),
  89. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  90. "99th percentile durations"),
  91. clEnumValN(GraphRenderer::StatType::MAX, "max",
  92. "maximum function durations"),
  93. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  94. "sum of call durations")));
  95. static cl::alias GraphVertexLabel2("v", cl::aliasopt(GraphVertexLabel),
  96. cl::desc("Alias for -edge-label"));
  97. static cl::opt<GraphRenderer::StatType> GraphEdgeColorType(
  98. "color-edges",
  99. cl::desc("Output graphs with edge colors determined by this field"),
  100. cl::value_desc("field"), cl::sub(GraphC),
  101. cl::init(GraphRenderer::StatType::NONE),
  102. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  103. "Do not color Edges"),
  104. clEnumValN(GraphRenderer::StatType::COUNT, "count",
  105. "function call counts"),
  106. clEnumValN(GraphRenderer::StatType::MIN, "min",
  107. "minimum function durations"),
  108. clEnumValN(GraphRenderer::StatType::MED, "med",
  109. "median function durations"),
  110. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  111. "90th percentile durations"),
  112. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  113. "99th percentile durations"),
  114. clEnumValN(GraphRenderer::StatType::MAX, "max",
  115. "maximum function durations"),
  116. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  117. "sum of call durations")));
  118. static cl::alias GraphEdgeColorType2("c", cl::aliasopt(GraphEdgeColorType),
  119. cl::desc("Alias for -color-edges"));
  120. static cl::opt<GraphRenderer::StatType> GraphVertexColorType(
  121. "color-vertices",
  122. cl::desc("Output graphs with vertex colors determined by this field"),
  123. cl::value_desc("field"), cl::sub(GraphC),
  124. cl::init(GraphRenderer::StatType::NONE),
  125. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  126. "Do not color vertices"),
  127. clEnumValN(GraphRenderer::StatType::COUNT, "count",
  128. "function call counts"),
  129. clEnumValN(GraphRenderer::StatType::MIN, "min",
  130. "minimum function durations"),
  131. clEnumValN(GraphRenderer::StatType::MED, "med",
  132. "median function durations"),
  133. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  134. "90th percentile durations"),
  135. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  136. "99th percentile durations"),
  137. clEnumValN(GraphRenderer::StatType::MAX, "max",
  138. "maximum function durations"),
  139. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  140. "sum of call durations")));
  141. static cl::alias GraphVertexColorType2("b", cl::aliasopt(GraphVertexColorType),
  142. cl::desc("Alias for -edge-label"));
  143. template <class T> T diff(T L, T R) { return std::max(L, R) - std::min(L, R); }
  144. // Updates the statistics for a GraphRenderer::TimeStat
  145. static void updateStat(GraphRenderer::TimeStat &S, int64_t L) {
  146. S.Count++;
  147. if (S.Min > L || S.Min == 0)
  148. S.Min = L;
  149. if (S.Max < L)
  150. S.Max = L;
  151. S.Sum += L;
  152. }
  153. // Labels in a DOT graph must be legal XML strings so it's necessary to escape
  154. // certain characters.
  155. static std::string escapeString(StringRef Label) {
  156. std::string Str;
  157. Str.reserve(Label.size());
  158. for (const auto C : Label) {
  159. switch (C) {
  160. case '&':
  161. Str.append("&amp;");
  162. break;
  163. case '<':
  164. Str.append("&lt;");
  165. break;
  166. case '>':
  167. Str.append("&gt;");
  168. break;
  169. default:
  170. Str.push_back(C);
  171. break;
  172. }
  173. }
  174. return Str;
  175. }
  176. // Evaluates an XRay record and performs accounting on it.
  177. //
  178. // If the record is an ENTER record it pushes the FuncID and TSC onto a
  179. // structure representing the call stack for that function.
  180. // If the record is an EXIT record it checks computes computes the ammount of
  181. // time the function took to complete and then stores that information in an
  182. // edge of the graph. If there is no matching ENTER record the function tries
  183. // to recover by assuming that there were EXIT records which were missed, for
  184. // example caused by tail call elimination and if the option is enabled then
  185. // then tries to recover from this.
  186. //
  187. // This funciton will also error if the records are out of order, as the trace
  188. // is expected to be sorted.
  189. //
  190. // The graph generated has an immaginary root for functions called by no-one at
  191. // FuncId 0.
  192. //
  193. // FIXME: Refactor this and account subcommand to reduce code duplication.
  194. Error GraphRenderer::accountRecord(const XRayRecord &Record) {
  195. using std::make_error_code;
  196. using std::errc;
  197. if (CurrentMaxTSC == 0)
  198. CurrentMaxTSC = Record.TSC;
  199. if (Record.TSC < CurrentMaxTSC)
  200. return make_error<StringError>("Records not in order",
  201. make_error_code(errc::invalid_argument));
  202. auto &ThreadStack = PerThreadFunctionStack[Record.TId];
  203. switch (Record.Type) {
  204. case RecordTypes::ENTER:
  205. case RecordTypes::ENTER_ARG: {
  206. if (Record.FuncId != 0 && G.count(Record.FuncId) == 0)
  207. G[Record.FuncId].SymbolName = FuncIdHelper.SymbolOrNumber(Record.FuncId);
  208. ThreadStack.push_back({Record.FuncId, Record.TSC});
  209. break;
  210. }
  211. case RecordTypes::EXIT:
  212. case RecordTypes::TAIL_EXIT: {
  213. // FIXME: Refactor this and the account subcommand to reduce code
  214. // duplication
  215. if (ThreadStack.size() == 0 || ThreadStack.back().FuncId != Record.FuncId) {
  216. if (!DeduceSiblingCalls)
  217. return make_error<StringError>("No matching ENTRY record",
  218. make_error_code(errc::invalid_argument));
  219. bool FoundParent =
  220. llvm::any_of(llvm::reverse(ThreadStack), [&](const FunctionAttr &A) {
  221. return A.FuncId == Record.FuncId;
  222. });
  223. if (!FoundParent)
  224. return make_error<StringError>(
  225. "No matching Entry record in stack",
  226. make_error_code(errc::invalid_argument)); // There is no matching
  227. // Function for this exit.
  228. while (ThreadStack.back().FuncId != Record.FuncId) {
  229. TimestampT D = diff(ThreadStack.back().TSC, Record.TSC);
  230. VertexIdentifier TopFuncId = ThreadStack.back().FuncId;
  231. ThreadStack.pop_back();
  232. assert(ThreadStack.size() != 0);
  233. EdgeIdentifier EI(ThreadStack.back().FuncId, TopFuncId);
  234. auto &EA = G[EI];
  235. EA.Timings.push_back(D);
  236. updateStat(EA.S, D);
  237. updateStat(G[TopFuncId].S, D);
  238. }
  239. }
  240. uint64_t D = diff(ThreadStack.back().TSC, Record.TSC);
  241. ThreadStack.pop_back();
  242. VertexIdentifier VI = ThreadStack.empty() ? 0 : ThreadStack.back().FuncId;
  243. EdgeIdentifier EI(VI, Record.FuncId);
  244. auto &EA = G[EI];
  245. EA.Timings.push_back(D);
  246. updateStat(EA.S, D);
  247. updateStat(G[Record.FuncId].S, D);
  248. break;
  249. }
  250. case RecordTypes::CUSTOM_EVENT:
  251. case RecordTypes::TYPED_EVENT:
  252. // TODO: Support custom and typed events in the graph processing?
  253. break;
  254. }
  255. return Error::success();
  256. }
  257. template <typename U>
  258. void GraphRenderer::getStats(U begin, U end, GraphRenderer::TimeStat &S) {
  259. if (begin == end) return;
  260. std::ptrdiff_t MedianOff = S.Count / 2;
  261. std::nth_element(begin, begin + MedianOff, end);
  262. S.Median = *(begin + MedianOff);
  263. std::ptrdiff_t Pct90Off = (S.Count * 9) / 10;
  264. std::nth_element(begin, begin + Pct90Off, end);
  265. S.Pct90 = *(begin + Pct90Off);
  266. std::ptrdiff_t Pct99Off = (S.Count * 99) / 100;
  267. std::nth_element(begin, begin + Pct99Off, end);
  268. S.Pct99 = *(begin + Pct99Off);
  269. }
  270. void GraphRenderer::updateMaxStats(const GraphRenderer::TimeStat &S,
  271. GraphRenderer::TimeStat &M) {
  272. M.Count = std::max(M.Count, S.Count);
  273. M.Min = std::max(M.Min, S.Min);
  274. M.Median = std::max(M.Median, S.Median);
  275. M.Pct90 = std::max(M.Pct90, S.Pct90);
  276. M.Pct99 = std::max(M.Pct99, S.Pct99);
  277. M.Max = std::max(M.Max, S.Max);
  278. M.Sum = std::max(M.Sum, S.Sum);
  279. }
  280. void GraphRenderer::calculateEdgeStatistics() {
  281. assert(!G.edges().empty());
  282. for (auto &E : G.edges()) {
  283. auto &A = E.second;
  284. assert(!A.Timings.empty());
  285. getStats(A.Timings.begin(), A.Timings.end(), A.S);
  286. updateMaxStats(A.S, G.GraphEdgeMax);
  287. }
  288. }
  289. void GraphRenderer::calculateVertexStatistics() {
  290. std::vector<uint64_t> TempTimings;
  291. for (auto &V : G.vertices()) {
  292. if (V.first != 0) {
  293. for (auto &E : G.inEdges(V.first)) {
  294. auto &A = E.second;
  295. llvm::append_range(TempTimings, A.Timings);
  296. }
  297. getStats(TempTimings.begin(), TempTimings.end(), G[V.first].S);
  298. updateMaxStats(G[V.first].S, G.GraphVertexMax);
  299. TempTimings.clear();
  300. }
  301. }
  302. }
  303. // A Helper function for normalizeStatistics which normalises a single
  304. // TimeStat element.
  305. static void normalizeTimeStat(GraphRenderer::TimeStat &S,
  306. double CycleFrequency) {
  307. int64_t OldCount = S.Count;
  308. S = S / CycleFrequency;
  309. S.Count = OldCount;
  310. }
  311. // Normalises the statistics in the graph for a given TSC frequency.
  312. void GraphRenderer::normalizeStatistics(double CycleFrequency) {
  313. for (auto &E : G.edges()) {
  314. auto &S = E.second.S;
  315. normalizeTimeStat(S, CycleFrequency);
  316. }
  317. for (auto &V : G.vertices()) {
  318. auto &S = V.second.S;
  319. normalizeTimeStat(S, CycleFrequency);
  320. }
  321. normalizeTimeStat(G.GraphEdgeMax, CycleFrequency);
  322. normalizeTimeStat(G.GraphVertexMax, CycleFrequency);
  323. }
  324. // Returns a string containing the value of statistic field T
  325. std::string
  326. GraphRenderer::TimeStat::getString(GraphRenderer::StatType T) const {
  327. std::string St;
  328. raw_string_ostream S{St};
  329. double TimeStat::*DoubleStatPtrs[] = {&TimeStat::Min, &TimeStat::Median,
  330. &TimeStat::Pct90, &TimeStat::Pct99,
  331. &TimeStat::Max, &TimeStat::Sum};
  332. switch (T) {
  333. case GraphRenderer::StatType::NONE:
  334. break;
  335. case GraphRenderer::StatType::COUNT:
  336. S << Count;
  337. break;
  338. default:
  339. S << (*this).*
  340. DoubleStatPtrs[static_cast<int>(T) -
  341. static_cast<int>(GraphRenderer::StatType::MIN)];
  342. break;
  343. }
  344. return S.str();
  345. }
  346. // Returns the quotient between the property T of this and another TimeStat as
  347. // a double
  348. double GraphRenderer::TimeStat::getDouble(StatType T) const {
  349. double retval = 0;
  350. double TimeStat::*DoubleStatPtrs[] = {&TimeStat::Min, &TimeStat::Median,
  351. &TimeStat::Pct90, &TimeStat::Pct99,
  352. &TimeStat::Max, &TimeStat::Sum};
  353. switch (T) {
  354. case GraphRenderer::StatType::NONE:
  355. retval = 0.0;
  356. break;
  357. case GraphRenderer::StatType::COUNT:
  358. retval = static_cast<double>(Count);
  359. break;
  360. default:
  361. retval =
  362. (*this).*DoubleStatPtrs[static_cast<int>(T) -
  363. static_cast<int>(GraphRenderer::StatType::MIN)];
  364. break;
  365. }
  366. return retval;
  367. }
  368. // Outputs a DOT format version of the Graph embedded in the GraphRenderer
  369. // object on OS. It does this in the expected way by itterating
  370. // through all edges then vertices and then outputting them and their
  371. // annotations.
  372. //
  373. // FIXME: output more information, better presented.
  374. void GraphRenderer::exportGraphAsDOT(raw_ostream &OS, StatType ET, StatType EC,
  375. StatType VT, StatType VC) {
  376. OS << "digraph xray {\n";
  377. if (VT != StatType::NONE)
  378. OS << "node [shape=record];\n";
  379. for (const auto &E : G.edges()) {
  380. const auto &S = E.second.S;
  381. OS << "F" << E.first.first << " -> "
  382. << "F" << E.first.second << " [label=\"" << S.getString(ET) << "\"";
  383. if (EC != StatType::NONE)
  384. OS << " color=\""
  385. << CHelper.getColorString(
  386. std::sqrt(S.getDouble(EC) / G.GraphEdgeMax.getDouble(EC)))
  387. << "\"";
  388. OS << "];\n";
  389. }
  390. for (const auto &V : G.vertices()) {
  391. const auto &VA = V.second;
  392. if (V.first == 0)
  393. continue;
  394. OS << "F" << V.first << " [label=\"" << (VT != StatType::NONE ? "{" : "")
  395. << escapeString(VA.SymbolName.size() > 40
  396. ? VA.SymbolName.substr(0, 40) + "..."
  397. : VA.SymbolName);
  398. if (VT != StatType::NONE)
  399. OS << "|" << VA.S.getString(VT) << "}\"";
  400. else
  401. OS << "\"";
  402. if (VC != StatType::NONE)
  403. OS << " color=\""
  404. << CHelper.getColorString(
  405. std::sqrt(VA.S.getDouble(VC) / G.GraphVertexMax.getDouble(VC)))
  406. << "\"";
  407. OS << "];\n";
  408. }
  409. OS << "}\n";
  410. }
  411. Expected<GraphRenderer> GraphRenderer::Factory::getGraphRenderer() {
  412. InstrumentationMap Map;
  413. if (!GraphInstrMap.empty()) {
  414. auto InstrumentationMapOrError = loadInstrumentationMap(GraphInstrMap);
  415. if (!InstrumentationMapOrError)
  416. return joinErrors(
  417. make_error<StringError>(
  418. Twine("Cannot open instrumentation map '") + GraphInstrMap + "'",
  419. std::make_error_code(std::errc::invalid_argument)),
  420. InstrumentationMapOrError.takeError());
  421. Map = std::move(*InstrumentationMapOrError);
  422. }
  423. const auto &FunctionAddresses = Map.getFunctionAddresses();
  424. symbolize::LLVMSymbolizer Symbolizer;
  425. const auto &Header = Trace.getFileHeader();
  426. llvm::xray::FuncIdConversionHelper FuncIdHelper(InstrMap, Symbolizer,
  427. FunctionAddresses);
  428. xray::GraphRenderer GR(FuncIdHelper, DeduceSiblingCalls);
  429. for (const auto &Record : Trace) {
  430. auto E = GR.accountRecord(Record);
  431. if (!E)
  432. continue;
  433. for (const auto &ThreadStack : GR.getPerThreadFunctionStack()) {
  434. errs() << "Thread ID: " << ThreadStack.first << "\n";
  435. auto Level = ThreadStack.second.size();
  436. for (const auto &Entry : llvm::reverse(ThreadStack.second))
  437. errs() << "#" << Level-- << "\t"
  438. << FuncIdHelper.SymbolOrNumber(Entry.FuncId) << '\n';
  439. }
  440. if (!GraphKeepGoing)
  441. return joinErrors(make_error<StringError>(
  442. "Error encountered generating the call graph.",
  443. std::make_error_code(std::errc::invalid_argument)),
  444. std::move(E));
  445. handleAllErrors(std::move(E),
  446. [&](const ErrorInfoBase &E) { E.log(errs()); });
  447. }
  448. GR.G.GraphEdgeMax = {};
  449. GR.G.GraphVertexMax = {};
  450. GR.calculateEdgeStatistics();
  451. GR.calculateVertexStatistics();
  452. if (Header.CycleFrequency)
  453. GR.normalizeStatistics(Header.CycleFrequency);
  454. return GR;
  455. }
  456. // Here we register and implement the llvm-xray graph subcommand.
  457. // The bulk of this code reads in the options, opens the required files, uses
  458. // those files to create a context for analysing the xray trace, then there is a
  459. // short loop which actually analyses the trace, generates the graph and then
  460. // outputs it as a DOT.
  461. //
  462. // FIXME: include additional filtering and annalysis passes to provide more
  463. // specific useful information.
  464. static CommandRegistration Unused(&GraphC, []() -> Error {
  465. GraphRenderer::Factory F;
  466. F.KeepGoing = GraphKeepGoing;
  467. F.DeduceSiblingCalls = GraphDeduceSiblingCalls;
  468. F.InstrMap = GraphInstrMap;
  469. auto TraceOrErr = loadTraceFile(GraphInput, true);
  470. if (!TraceOrErr)
  471. return make_error<StringError>(
  472. Twine("Failed loading input file '") + GraphInput + "'",
  473. make_error_code(llvm::errc::invalid_argument));
  474. F.Trace = std::move(*TraceOrErr);
  475. auto GROrError = F.getGraphRenderer();
  476. if (!GROrError)
  477. return GROrError.takeError();
  478. auto &GR = *GROrError;
  479. std::error_code EC;
  480. raw_fd_ostream OS(GraphOutput, EC, sys::fs::OpenFlags::OF_TextWithCRLF);
  481. if (EC)
  482. return make_error<StringError>(
  483. Twine("Cannot open file '") + GraphOutput + "' for writing.", EC);
  484. GR.exportGraphAsDOT(OS, GraphEdgeLabel, GraphEdgeColorType, GraphVertexLabel,
  485. GraphVertexColorType);
  486. return Error::success();
  487. });