xray-graph-diff.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. //===-- xray-graph-diff.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 <cassert>
  14. #include <cmath>
  15. #include <limits>
  16. #include <string>
  17. #include "xray-graph-diff.h"
  18. #include "xray-graph.h"
  19. #include "xray-registry.h"
  20. #include "xray-color-helper.h"
  21. #include "llvm/ADT/iterator_range.h"
  22. #include "llvm/Support/FormatVariadic.h"
  23. #include "llvm/XRay/Trace.h"
  24. using namespace llvm;
  25. using namespace xray;
  26. static cl::SubCommand GraphDiff("graph-diff",
  27. "Generate diff of function-call graphs");
  28. static cl::opt<std::string> GraphDiffInput1(cl::Positional,
  29. cl::desc("<xray log file 1>"),
  30. cl::Required, cl::sub(GraphDiff));
  31. static cl::opt<std::string> GraphDiffInput2(cl::Positional,
  32. cl::desc("<xray log file 2>"),
  33. cl::Required, cl::sub(GraphDiff));
  34. static cl::opt<bool>
  35. GraphDiffKeepGoing("keep-going",
  36. cl::desc("Keep going on errors encountered"),
  37. cl::sub(GraphDiff), cl::init(false));
  38. static cl::alias GraphDiffKeepGoingA("k", cl::aliasopt(GraphDiffKeepGoing),
  39. cl::desc("Alias for -keep-going"),
  40. cl::sub(GraphDiff));
  41. static cl::opt<bool>
  42. GraphDiffKeepGoing1("keep-going-1",
  43. cl::desc("Keep going on errors encountered in trace 1"),
  44. cl::sub(GraphDiff), cl::init(false));
  45. static cl::alias GraphDiffKeepGoing1A("k1", cl::aliasopt(GraphDiffKeepGoing1),
  46. cl::desc("Alias for -keep-going-1"),
  47. cl::sub(GraphDiff));
  48. static cl::opt<bool>
  49. GraphDiffKeepGoing2("keep-going-2",
  50. cl::desc("Keep going on errors encountered in trace 2"),
  51. cl::sub(GraphDiff), cl::init(false));
  52. static cl::alias GraphDiffKeepGoing2A("k2", cl::aliasopt(GraphDiffKeepGoing2),
  53. cl::desc("Alias for -keep-going-2"),
  54. cl::sub(GraphDiff));
  55. static cl::opt<std::string>
  56. GraphDiffInstrMap("instr-map",
  57. cl::desc("binary with the instrumentation map, or "
  58. "a separate instrumentation map for graph"),
  59. cl::value_desc("binary with xray_instr_map or yaml"),
  60. cl::sub(GraphDiff), cl::init(""));
  61. static cl::alias GraphDiffInstrMapA("m", cl::aliasopt(GraphDiffInstrMap),
  62. cl::desc("Alias for -instr-map"),
  63. cl::sub(GraphDiff));
  64. static cl::opt<std::string>
  65. GraphDiffInstrMap1("instr-map-1",
  66. cl::desc("binary with the instrumentation map, or "
  67. "a separate instrumentation map for graph 1"),
  68. cl::value_desc("binary with xray_instr_map or yaml"),
  69. cl::sub(GraphDiff), cl::init(""));
  70. static cl::alias GraphDiffInstrMap1A("m1", cl::aliasopt(GraphDiffInstrMap1),
  71. cl::desc("Alias for -instr-map-1"),
  72. cl::sub(GraphDiff));
  73. static cl::opt<std::string>
  74. GraphDiffInstrMap2("instr-map-2",
  75. cl::desc("binary with the instrumentation map, or "
  76. "a separate instrumentation map for graph 2"),
  77. cl::value_desc("binary with xray_instr_map or yaml"),
  78. cl::sub(GraphDiff), cl::init(""));
  79. static cl::alias GraphDiffInstrMap2A("m2", cl::aliasopt(GraphDiffInstrMap2),
  80. cl::desc("Alias for -instr-map-2"),
  81. cl::sub(GraphDiff));
  82. static cl::opt<bool> GraphDiffDeduceSiblingCalls(
  83. "deduce-sibling-calls",
  84. cl::desc("Deduce sibling calls when unrolling function call stacks"),
  85. cl::sub(GraphDiff), cl::init(false));
  86. static cl::alias
  87. GraphDiffDeduceSiblingCallsA("d", cl::aliasopt(GraphDiffDeduceSiblingCalls),
  88. cl::desc("Alias for -deduce-sibling-calls"),
  89. cl::sub(GraphDiff));
  90. static cl::opt<bool> GraphDiffDeduceSiblingCalls1(
  91. "deduce-sibling-calls-1",
  92. cl::desc("Deduce sibling calls when unrolling function call stacks"),
  93. cl::sub(GraphDiff), cl::init(false));
  94. static cl::alias GraphDiffDeduceSiblingCalls1A(
  95. "d1", cl::aliasopt(GraphDiffDeduceSiblingCalls1),
  96. cl::desc("Alias for -deduce-sibling-calls-1"), cl::sub(GraphDiff));
  97. static cl::opt<bool> GraphDiffDeduceSiblingCalls2(
  98. "deduce-sibling-calls-2",
  99. cl::desc("Deduce sibling calls when unrolling function call stacks"),
  100. cl::sub(GraphDiff), cl::init(false));
  101. static cl::alias GraphDiffDeduceSiblingCalls2A(
  102. "d2", cl::aliasopt(GraphDiffDeduceSiblingCalls2),
  103. cl::desc("Alias for -deduce-sibling-calls-2"), cl::sub(GraphDiff));
  104. static cl::opt<GraphRenderer::StatType> GraphDiffEdgeLabel(
  105. "edge-label", cl::desc("Output graphs with edges labeled with this field"),
  106. cl::value_desc("field"), cl::sub(GraphDiff),
  107. cl::init(GraphRenderer::StatType::NONE),
  108. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  109. "Do not label Edges"),
  110. clEnumValN(GraphRenderer::StatType::COUNT, "count",
  111. "function call counts"),
  112. clEnumValN(GraphRenderer::StatType::MIN, "min",
  113. "minimum function durations"),
  114. clEnumValN(GraphRenderer::StatType::MED, "med",
  115. "median function durations"),
  116. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  117. "90th percentile durations"),
  118. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  119. "99th percentile durations"),
  120. clEnumValN(GraphRenderer::StatType::MAX, "max",
  121. "maximum function durations"),
  122. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  123. "sum of call durations")));
  124. static cl::alias GraphDiffEdgeLabelA("e", cl::aliasopt(GraphDiffEdgeLabel),
  125. cl::desc("Alias for -edge-label"),
  126. cl::sub(GraphDiff));
  127. static cl::opt<GraphRenderer::StatType> GraphDiffEdgeColor(
  128. "edge-color", cl::desc("Output graphs with edges colored by this field"),
  129. cl::value_desc("field"), cl::sub(GraphDiff),
  130. cl::init(GraphRenderer::StatType::NONE),
  131. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  132. "Do not color Edges"),
  133. clEnumValN(GraphRenderer::StatType::COUNT, "count",
  134. "function call counts"),
  135. clEnumValN(GraphRenderer::StatType::MIN, "min",
  136. "minimum function durations"),
  137. clEnumValN(GraphRenderer::StatType::MED, "med",
  138. "median function durations"),
  139. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  140. "90th percentile durations"),
  141. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  142. "99th percentile durations"),
  143. clEnumValN(GraphRenderer::StatType::MAX, "max",
  144. "maximum function durations"),
  145. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  146. "sum of call durations")));
  147. static cl::alias GraphDiffEdgeColorA("c", cl::aliasopt(GraphDiffEdgeColor),
  148. cl::desc("Alias for -edge-color"),
  149. cl::sub(GraphDiff));
  150. static cl::opt<GraphRenderer::StatType> GraphDiffVertexLabel(
  151. "vertex-label",
  152. cl::desc("Output graphs with vertices labeled with this field"),
  153. cl::value_desc("field"), cl::sub(GraphDiff),
  154. cl::init(GraphRenderer::StatType::NONE),
  155. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  156. "Do not label Vertices"),
  157. clEnumValN(GraphRenderer::StatType::COUNT, "count",
  158. "function call counts"),
  159. clEnumValN(GraphRenderer::StatType::MIN, "min",
  160. "minimum function durations"),
  161. clEnumValN(GraphRenderer::StatType::MED, "med",
  162. "median function durations"),
  163. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  164. "90th percentile durations"),
  165. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  166. "99th percentile durations"),
  167. clEnumValN(GraphRenderer::StatType::MAX, "max",
  168. "maximum function durations"),
  169. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  170. "sum of call durations")));
  171. static cl::alias GraphDiffVertexLabelA("v", cl::aliasopt(GraphDiffVertexLabel),
  172. cl::desc("Alias for -vertex-label"),
  173. cl::sub(GraphDiff));
  174. static cl::opt<GraphRenderer::StatType> GraphDiffVertexColor(
  175. "vertex-color",
  176. cl::desc("Output graphs with vertices colored by this field"),
  177. cl::value_desc("field"), cl::sub(GraphDiff),
  178. cl::init(GraphRenderer::StatType::NONE),
  179. cl::values(clEnumValN(GraphRenderer::StatType::NONE, "none",
  180. "Do not color Vertices"),
  181. clEnumValN(GraphRenderer::StatType::COUNT, "count",
  182. "function call counts"),
  183. clEnumValN(GraphRenderer::StatType::MIN, "min",
  184. "minimum function durations"),
  185. clEnumValN(GraphRenderer::StatType::MED, "med",
  186. "median function durations"),
  187. clEnumValN(GraphRenderer::StatType::PCT90, "90p",
  188. "90th percentile durations"),
  189. clEnumValN(GraphRenderer::StatType::PCT99, "99p",
  190. "99th percentile durations"),
  191. clEnumValN(GraphRenderer::StatType::MAX, "max",
  192. "maximum function durations"),
  193. clEnumValN(GraphRenderer::StatType::SUM, "sum",
  194. "sum of call durations")));
  195. static cl::alias GraphDiffVertexColorA("b", cl::aliasopt(GraphDiffVertexColor),
  196. cl::desc("Alias for -vertex-color"),
  197. cl::sub(GraphDiff));
  198. static cl::opt<int> GraphDiffVertexLabelTrunc(
  199. "vertex-label-trun", cl::desc("What length to truncate vertex labels to "),
  200. cl::sub(GraphDiff), cl::init(40));
  201. static cl::alias
  202. GraphDiffVertexLabelTrunc1("t", cl::aliasopt(GraphDiffVertexLabelTrunc),
  203. cl::desc("Alias for -vertex-label-trun"),
  204. cl::sub(GraphDiff));
  205. static cl::opt<std::string>
  206. GraphDiffOutput("output", cl::value_desc("Output file"), cl::init("-"),
  207. cl::desc("output file; use '-' for stdout"),
  208. cl::sub(GraphDiff));
  209. static cl::alias GraphDiffOutputA("o", cl::aliasopt(GraphDiffOutput),
  210. cl::desc("Alias for -output"),
  211. cl::sub(GraphDiff));
  212. Expected<GraphDiffRenderer> GraphDiffRenderer::Factory::getGraphDiffRenderer() {
  213. GraphDiffRenderer R;
  214. for (int i = 0; i < N; ++i) {
  215. const auto &G = this->G[i].get();
  216. for (const auto &V : G.vertices()) {
  217. const auto &VAttr = V.second;
  218. R.G[VAttr.SymbolName].CorrVertexPtr[i] = &V;
  219. }
  220. for (const auto &E : G.edges()) {
  221. auto &EdgeTailID = E.first.first;
  222. auto &EdgeHeadID = E.first.second;
  223. auto EdgeTailAttrOrErr = G.at(EdgeTailID);
  224. auto EdgeHeadAttrOrErr = G.at(EdgeHeadID);
  225. if (!EdgeTailAttrOrErr)
  226. return EdgeTailAttrOrErr.takeError();
  227. if (!EdgeHeadAttrOrErr)
  228. return EdgeHeadAttrOrErr.takeError();
  229. GraphT::EdgeIdentifier ID{EdgeTailAttrOrErr->SymbolName,
  230. EdgeHeadAttrOrErr->SymbolName};
  231. R.G[ID].CorrEdgePtr[i] = &E;
  232. }
  233. }
  234. return R;
  235. }
  236. // Returns the Relative change With respect to LeftStat between LeftStat
  237. // and RightStat.
  238. static double statRelDiff(const GraphDiffRenderer::TimeStat &LeftStat,
  239. const GraphDiffRenderer::TimeStat &RightStat,
  240. GraphDiffRenderer::StatType T) {
  241. double LeftAttr = LeftStat.getDouble(T);
  242. double RightAttr = RightStat.getDouble(T);
  243. return RightAttr / LeftAttr - 1.0;
  244. }
  245. static std::string getColor(const GraphDiffRenderer::GraphT::EdgeValueType &E,
  246. const GraphDiffRenderer::GraphT &G, ColorHelper H,
  247. GraphDiffRenderer::StatType T) {
  248. auto &EdgeAttr = E.second;
  249. if (EdgeAttr.CorrEdgePtr[0] == nullptr)
  250. return H.getColorString(2.0); // A number greater than 1.0
  251. if (EdgeAttr.CorrEdgePtr[1] == nullptr)
  252. return H.getColorString(-2.0); // A number less than -1.0
  253. if (T == GraphDiffRenderer::StatType::NONE)
  254. return H.getDefaultColorString();
  255. const auto &LeftStat = EdgeAttr.CorrEdgePtr[0]->second.S;
  256. const auto &RightStat = EdgeAttr.CorrEdgePtr[1]->second.S;
  257. double RelDiff = statRelDiff(LeftStat, RightStat, T);
  258. double CappedRelDiff = std::min(1.0, std::max(-1.0, RelDiff));
  259. return H.getColorString(CappedRelDiff);
  260. }
  261. static std::string getColor(const GraphDiffRenderer::GraphT::VertexValueType &V,
  262. const GraphDiffRenderer::GraphT &G, ColorHelper H,
  263. GraphDiffRenderer::StatType T) {
  264. auto &VertexAttr = V.second;
  265. if (VertexAttr.CorrVertexPtr[0] == nullptr)
  266. return H.getColorString(2.0); // A number greater than 1.0
  267. if (VertexAttr.CorrVertexPtr[1] == nullptr)
  268. return H.getColorString(-2.0); // A number less than -1.0
  269. if (T == GraphDiffRenderer::StatType::NONE)
  270. return H.getDefaultColorString();
  271. const auto &LeftStat = VertexAttr.CorrVertexPtr[0]->second.S;
  272. const auto &RightStat = VertexAttr.CorrVertexPtr[1]->second.S;
  273. double RelDiff = statRelDiff(LeftStat, RightStat, T);
  274. double CappedRelDiff = std::min(1.0, std::max(-1.0, RelDiff));
  275. return H.getColorString(CappedRelDiff);
  276. }
  277. static Twine truncateString(const StringRef &S, size_t n) {
  278. return (S.size() > n) ? Twine(S.substr(0, n)) + "..." : Twine(S);
  279. }
  280. template <typename T> static bool containsNullptr(const T &Collection) {
  281. for (const auto &E : Collection)
  282. if (E == nullptr)
  283. return true;
  284. return false;
  285. }
  286. static std::string getLabel(const GraphDiffRenderer::GraphT::EdgeValueType &E,
  287. GraphDiffRenderer::StatType EL) {
  288. auto &EdgeAttr = E.second;
  289. switch (EL) {
  290. case GraphDiffRenderer::StatType::NONE:
  291. return "";
  292. default:
  293. if (containsNullptr(EdgeAttr.CorrEdgePtr))
  294. return "";
  295. const auto &LeftStat = EdgeAttr.CorrEdgePtr[0]->second.S;
  296. const auto &RightStat = EdgeAttr.CorrEdgePtr[1]->second.S;
  297. double RelDiff = statRelDiff(LeftStat, RightStat, EL);
  298. return formatv(R"({0:P})", RelDiff);
  299. }
  300. }
  301. static std::string getLabel(const GraphDiffRenderer::GraphT::VertexValueType &V,
  302. GraphDiffRenderer::StatType VL, int TrunLen) {
  303. const auto &VertexId = V.first;
  304. const auto &VertexAttr = V.second;
  305. switch (VL) {
  306. case GraphDiffRenderer::StatType::NONE:
  307. return formatv(R"({0})", truncateString(VertexId, TrunLen).str());
  308. default:
  309. if (containsNullptr(VertexAttr.CorrVertexPtr))
  310. return formatv(R"({0})", truncateString(VertexId, TrunLen).str());
  311. const auto &LeftStat = VertexAttr.CorrVertexPtr[0]->second.S;
  312. const auto &RightStat = VertexAttr.CorrVertexPtr[1]->second.S;
  313. double RelDiff = statRelDiff(LeftStat, RightStat, VL);
  314. return formatv(R"({{{0}|{1:P}})", truncateString(VertexId, TrunLen).str(),
  315. RelDiff);
  316. }
  317. }
  318. static double getLineWidth(const GraphDiffRenderer::GraphT::EdgeValueType &E,
  319. GraphDiffRenderer::StatType EL) {
  320. auto &EdgeAttr = E.second;
  321. switch (EL) {
  322. case GraphDiffRenderer::StatType::NONE:
  323. return 1.0;
  324. default:
  325. if (containsNullptr(EdgeAttr.CorrEdgePtr))
  326. return 1.0;
  327. const auto &LeftStat = EdgeAttr.CorrEdgePtr[0]->second.S;
  328. const auto &RightStat = EdgeAttr.CorrEdgePtr[1]->second.S;
  329. double RelDiff = statRelDiff(LeftStat, RightStat, EL);
  330. return (RelDiff > 1.0) ? RelDiff : 1.0;
  331. }
  332. }
  333. void GraphDiffRenderer::exportGraphAsDOT(raw_ostream &OS, StatType EdgeLabel,
  334. StatType EdgeColor,
  335. StatType VertexLabel,
  336. StatType VertexColor, int TruncLen) {
  337. // Get numbering of vertices for dot output.
  338. StringMap<int32_t> VertexNo;
  339. int i = 0;
  340. for (const auto &V : G.vertices()) {
  341. VertexNo[V.first] = i++;
  342. }
  343. ColorHelper H(ColorHelper::DivergingScheme::PiYG);
  344. OS << "digraph xrayDiff {\n";
  345. if (VertexLabel != StatType::NONE)
  346. OS << "node [shape=record]\n";
  347. for (const auto &E : G.edges()) {
  348. const auto &HeadId = E.first.first;
  349. const auto &TailId = E.first.second;
  350. OS << formatv(R"(F{0} -> F{1} [tooltip="{2} -> {3}" label="{4}" )"
  351. R"(color="{5}" labelfontcolor="{5}" penwidth={6}])"
  352. "\n",
  353. VertexNo[HeadId], VertexNo[TailId],
  354. (HeadId.equals("")) ? static_cast<StringRef>("F0") : HeadId,
  355. TailId, getLabel(E, EdgeLabel), getColor(E, G, H, EdgeColor),
  356. getLineWidth(E, EdgeColor));
  357. }
  358. for (const auto &V : G.vertices()) {
  359. const auto &VertexId = V.first;
  360. if (VertexId.equals("")) {
  361. OS << formatv(R"(F{0} [label="F0"])"
  362. "\n",
  363. VertexNo[VertexId]);
  364. continue;
  365. }
  366. OS << formatv(R"(F{0} [label="{1}" color="{2}"])"
  367. "\n",
  368. VertexNo[VertexId], getLabel(V, VertexLabel, TruncLen),
  369. getColor(V, G, H, VertexColor));
  370. }
  371. OS << "}\n";
  372. }
  373. template <typename T> static T &ifSpecified(T &A, cl::alias &AA, T &B) {
  374. if (A.getPosition() == 0 && AA.getPosition() == 0)
  375. return B;
  376. return A;
  377. }
  378. static CommandRegistration Unused(&GraphDiff, []() -> Error {
  379. std::array<GraphRenderer::Factory, 2> Factories{
  380. {{ifSpecified(GraphDiffKeepGoing1, GraphDiffKeepGoing1A,
  381. GraphDiffKeepGoing),
  382. ifSpecified(GraphDiffDeduceSiblingCalls1, GraphDiffDeduceSiblingCalls1A,
  383. GraphDiffDeduceSiblingCalls),
  384. ifSpecified(GraphDiffInstrMap1, GraphDiffInstrMap1A, GraphDiffInstrMap),
  385. Trace()},
  386. {ifSpecified(GraphDiffKeepGoing2, GraphDiffKeepGoing2A,
  387. GraphDiffKeepGoing),
  388. ifSpecified(GraphDiffDeduceSiblingCalls2, GraphDiffDeduceSiblingCalls2A,
  389. GraphDiffDeduceSiblingCalls),
  390. ifSpecified(GraphDiffInstrMap2, GraphDiffInstrMap2A, GraphDiffInstrMap),
  391. Trace()}}};
  392. std::array<std::string, 2> Inputs{{GraphDiffInput1, GraphDiffInput2}};
  393. std::array<GraphRenderer::GraphT, 2> Graphs;
  394. for (int i = 0; i < 2; i++) {
  395. auto TraceOrErr = loadTraceFile(Inputs[i], true);
  396. if (!TraceOrErr)
  397. return make_error<StringError>(
  398. Twine("Failed Loading Input File '") + Inputs[i] + "'",
  399. make_error_code(llvm::errc::invalid_argument));
  400. Factories[i].Trace = std::move(*TraceOrErr);
  401. auto GraphRendererOrErr = Factories[i].getGraphRenderer();
  402. if (!GraphRendererOrErr)
  403. return GraphRendererOrErr.takeError();
  404. auto GraphRenderer = *GraphRendererOrErr;
  405. Graphs[i] = GraphRenderer.getGraph();
  406. }
  407. GraphDiffRenderer::Factory DGF(Graphs[0], Graphs[1]);
  408. auto GDROrErr = DGF.getGraphDiffRenderer();
  409. if (!GDROrErr)
  410. return GDROrErr.takeError();
  411. auto &GDR = *GDROrErr;
  412. std::error_code EC;
  413. raw_fd_ostream OS(GraphDiffOutput, EC, sys::fs::OpenFlags::OF_Text);
  414. if (EC)
  415. return make_error<StringError>(
  416. Twine("Cannot open file '") + GraphDiffOutput + "' for writing.", EC);
  417. GDR.exportGraphAsDOT(OS, GraphDiffEdgeLabel, GraphDiffEdgeColor,
  418. GraphDiffVertexLabel, GraphDiffVertexColor,
  419. GraphDiffVertexLabelTrunc);
  420. return Error::success();
  421. });