Lines Matching +full:sub +full:- +full:function
1 //===-- xray-graph-diff.cpp: XRay Function Call Graph Renderer ------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Generate a DOT file to represent the function call graph encountered in
12 //===----------------------------------------------------------------------===//
18 #include "xray-graph-diff.h"
19 #include "xray-graph.h"
20 #include "xray-registry.h"
22 #include "xray-color-helper.h"
30 static cl::SubCommand GraphDiff("graph-diff",
31 "Generate diff of function-call graphs");
34 cl::Required, cl::sub(GraphDiff));
37 cl::Required, cl::sub(GraphDiff));
40 GraphDiffKeepGoing("keep-going",
42 cl::sub(GraphDiff), cl::init(false));
44 cl::desc("Alias for -keep-going"));
46 GraphDiffKeepGoing1("keep-going-1",
48 cl::sub(GraphDiff), cl::init(false));
50 cl::desc("Alias for -keep-going-1"));
52 GraphDiffKeepGoing2("keep-going-2",
54 cl::sub(GraphDiff), cl::init(false));
56 cl::desc("Alias for -keep-going-2"));
59 GraphDiffInstrMap("instr-map",
63 cl::sub(GraphDiff), cl::init(""));
65 cl::desc("Alias for -instr-map"));
67 GraphDiffInstrMap1("instr-map-1",
71 cl::sub(GraphDiff), cl::init(""));
73 cl::desc("Alias for -instr-map-1"));
75 GraphDiffInstrMap2("instr-map-2",
79 cl::sub(GraphDiff), cl::init(""));
81 cl::desc("Alias for -instr-map-2"));
84 "deduce-sibling-calls",
85 cl::desc("Deduce sibling calls when unrolling function call stacks"),
86 cl::sub(GraphDiff), cl::init(false));
89 cl::desc("Alias for -deduce-sibling-calls"));
91 "deduce-sibling-calls-1",
92 cl::desc("Deduce sibling calls when unrolling function call stacks"),
93 cl::sub(GraphDiff), cl::init(false));
96 cl::desc("Alias for -deduce-sibling-calls-1"));
98 "deduce-sibling-calls-2",
99 cl::desc("Deduce sibling calls when unrolling function call stacks"),
100 cl::sub(GraphDiff), cl::init(false));
103 cl::desc("Alias for -deduce-sibling-calls-2"));
106 "edge-label", cl::desc("Output graphs with edges labeled with this field"),
107 cl::value_desc("field"), cl::sub(GraphDiff),
112 "function call counts"),
114 "minimum function durations"),
116 "median function durations"),
122 "maximum function durations"),
126 cl::desc("Alias for -edge-label"));
129 "edge-color", cl::desc("Output graphs with edges colored by this field"),
130 cl::value_desc("field"), cl::sub(GraphDiff),
135 "function call counts"),
137 "minimum function durations"),
139 "median function durations"),
145 "maximum function durations"),
149 cl::desc("Alias for -edge-color"));
152 "vertex-label",
154 cl::value_desc("field"), cl::sub(GraphDiff),
159 "function call counts"),
161 "minimum function durations"),
163 "median function durations"),
169 "maximum function durations"),
173 cl::desc("Alias for -vertex-label"));
176 "vertex-color",
178 cl::value_desc("field"), cl::sub(GraphDiff),
183 "function call counts"),
185 "minimum function durations"),
187 "median function durations"),
193 "maximum function durations"),
197 cl::desc("Alias for -vertex-color"));
200 "vertex-label-trun", cl::desc("What length to truncate vertex labels to "),
201 cl::sub(GraphDiff), cl::init(40));
204 cl::desc("Alias for -vertex-label-trun"));
207 GraphDiffOutput("output", cl::value_desc("Output file"), cl::init("-"),
208 cl::desc("output file; use '-' for stdout"),
209 cl::sub(GraphDiff));
211 cl::desc("Alias for -output"));
217 const auto &G = this->G[i].get(); in getGraphDiffRenderer()
231 GraphT::EdgeIdentifier ID{EdgeTailAttrOrErr->SymbolName, in getGraphDiffRenderer()
232 EdgeHeadAttrOrErr->SymbolName}; in getGraphDiffRenderer()
247 return RightAttr / LeftAttr - 1.0; in statRelDiff()
257 return H.getColorString(-2.0); // A number less than -1.0 in getColor()
262 const auto &LeftStat = EdgeAttr.CorrEdgePtr[0]->second.S; in getColor()
263 const auto &RightStat = EdgeAttr.CorrEdgePtr[1]->second.S; in getColor()
266 double CappedRelDiff = std::clamp(RelDiff, -1.0, 1.0); in getColor()
278 return H.getColorString(-2.0); // A number less than -1.0 in getColor()
283 const auto &LeftStat = VertexAttr.CorrVertexPtr[0]->second.S; in getColor()
284 const auto &RightStat = VertexAttr.CorrVertexPtr[1]->second.S; in getColor()
287 double CappedRelDiff = std::clamp(RelDiff, -1.0, 1.0); in getColor()
310 const auto &LeftStat = EdgeAttr.CorrEdgePtr[0]->second.S; in getLabel()
311 const auto &RightStat = EdgeAttr.CorrEdgePtr[1]->second.S; in getLabel()
331 const auto &LeftStat = VertexAttr.CorrVertexPtr[0]->second.S; in getLabel()
332 const auto &RightStat = VertexAttr.CorrVertexPtr[1]->second.S; in getLabel()
350 const auto &LeftStat = EdgeAttr.CorrEdgePtr[0]->second.S; in getLineWidth()
351 const auto &RightStat = EdgeAttr.CorrEdgePtr[1]->second.S; in getLineWidth()
380 OS << formatv(R"(F{0} -> F{1} [tooltip="{2} -> {3}" label="{4}" )" in exportGraphAsDOT()
413 static CommandRegistration Unused(&GraphDiff, []() -> Error { in __anon0eabb36e0102()