Lines Matching +full:s +full:- +full:merged
1 //===- Profile.cpp - XRay Profile Abstraction -----------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // XRay's profiling mode.
12 //===----------------------------------------------------------------------===//
26 // We need to re-create all the tries from the original (O), into the current in Profile()
80 // We're reading a sequence of int32_t's until we find a 0. in readPath()
99 // - A 64-bit CallCount in readData()
100 // - A 64-bit CumulativeLocalTime counter in readData()
138 for (auto Node = It->second; Node; Node = Node->Caller) in expandPath()
139 Path.push_back(Node->Func); in expandPath()
153 find_if(Roots, [PathRoot](TrieNode *N) { return N->Func == PathRoot; }); in internPath()
160 Node->Func = PathRoot; in internPath()
166 // Now traverse the path, re-creating if necessary. in internPath()
169 auto CalleeIt = find_if(Node->Callees, [NodeFuncID](TrieNode *N) { in internPath()
170 return N->Func == NodeFuncID; in internPath()
172 if (CalleeIt == Node->Callees.end()) { in internPath()
175 NewNode->Func = NodeFuncID; in internPath()
176 NewNode->Caller = Node; in internPath()
177 Node->Callees.push_back(NewNode); in internPath()
185 assert(Node->Func == P.front()); in internPath()
186 if (Node->ID == 0) { in internPath()
187 Node->ID = NextID++; in internPath()
188 PathIDMap.insert({Node->ID, Node}); in internPath()
190 return Node->ID; in internPath()
194 Profile Merged; in mergeProfilesByThread() local
210 Merged.internPath(cantFail(P.get().expandPath(PathID))); in mergeProfilesByThread()
213 std::tie(PathDataIt, Inserted) = It->second->insert({NewPathID, Data}); in mergeProfilesByThread()
215 auto &ExistingData = PathDataIt->second; in mergeProfilesByThread()
224 PathAndData.reserve(IndexedThreadBlock.second->size()); in mergeProfilesByThread()
227 Merged.addBlock({IndexedThreadBlock.first, std::move(PathAndData)})); in mergeProfilesByThread()
229 return Merged; in mergeProfilesByThread()
233 Profile Merged; in mergeProfilesByStack() local
243 Merged.internPath(cantFail(P.get().expandPath(PathId))); in mergeProfilesByStack()
248 auto &ExistingData = PathDataIt->second; in mergeProfilesByStack()
254 // In the end there's a single Block, for thread 0. in mergeProfilesByStack()
258 cantFail(Merged.addBlock({0, std::move(Block)})); in mergeProfilesByStack()
259 return Merged; in mergeProfilesByStack()
329 // The implementation of the algorithm re-creates the execution of in profileFromTrace()
337 // We then do a pass through the Trace to account data on a per-thread-basis. in profileFromTrace()