34 #include <QStringList> 66 qWarning(
"Re-initializing a valid profile (%d,%s) with (%d,%s). " 67 "Something is probably horribly wrong.",
69 profile_key, qPrintable(name));
78 qWarning(
"Attempt to add %zu elements to an invalid profile.", data.size());
82 if (data.size() == 0) {
86 std::set<uint64_t> modified_times;
88 bool nodes_added =
false;
89 for (
auto const &item : data) {
94 modified_times.insert(item.wall_stamp_sec);
105 qWarning(
"Failed to touch node for %s. Data will be dropped. This should never happend.",
125 for (
auto const &t : modified_times) {
160 std::deque<ProfileEntry> &data = it.second.data_;
163 initial_value = data.back();
166 data.insert(data.end(), count, initial_value);
172 std::deque<ProfileEntry> &data = it.second.data_;
173 data.insert(data.begin(), count, initial_value);
187 QStringList all_parts = path.split(
'/');
188 if (all_parts.isEmpty()) {
189 qWarning(
"Node path (%s) does not have a root component. This should never happen.",
196 if (all_parts.front() !=
"") {
197 qWarning(
"Split of node path '%s' did not yield root as first element. This should never happend.",
200 all_parts.removeFirst();
203 QString this_path =
"";
207 while (!all_parts.isEmpty()) {
208 QString this_name = all_parts.takeFirst();
209 this_path = this_path +
"/" + this_name;
218 int this_key =
nodes_.size();
219 while (
nodes_.count(this_key)) { this_key++; }
225 this_node.
name_ = this_name;
226 this_node.
path_ = this_path;
233 this_node.
depth_ = this_depth;
234 this_node.
parent_ = parent_key;
235 parent_key = this_key;
258 node.
data_[index].projected =
false;
267 for (
size_t i = index+1; i < node.
data_.size(); i++) {
268 if (node.
data_[i].projected ==
false) {
272 node.
data_[i].projected =
true;
286 for (
auto const &it :
nodes_) {
287 paths.append(it.second.path());
293 for (
int i = 0; i < paths.size(); i++) {
295 qWarning(
"Path is missing from node_key_from_path_. This should never happen.");
304 const QStringList &list1,
305 const QStringList &list2)
307 int size = std::min(list1.size(), list2.size());
315 for (
int i = size; i > 0; i--) {
316 if (list1[i-1] != list2[i-1]) {
342 it.second.children_.clear();
346 if (nodes_.count(key) == 0) {
347 qWarning(
"Key (%d) in flat index was not found in nodes_ map. This should never happen.", key);
354 qWarning(
"Profile node %d does not have a valid parent. This should never happen.", key);
359 if (nodes_.count(node.
parentKey()) == 0) {
360 qWarning(
"Profile node %d's parent (%d) was not found in nodes_. This should never happen.",
372 if (
nodes_.count(0) == 0) {
373 qWarning(
"Profile is missing root node.");
382 uint64_t children_cum_call_count = 0;
383 uint64_t children_cum_incl_duration = 0;
384 uint64_t children_inc_incl_duration = 0;
385 uint64_t children_inc_max_duration = 0;
387 for (
auto &child_key : node.
childKeys()) {
388 if (
nodes_.count(child_key) == 0) {
389 qWarning(
"Invalid child key in updateDerivedDataInternal");
412 qWarning(
"Node's (%s) cumulative inclusive duration is less than it's combined" 413 " children (%zu < %zu). I have not seen this before, so it may or may" 414 " not be a big issue.",
415 qPrintable(node.
name()),
417 children_cum_incl_duration);
437 qWarning(
"Node's (%s) incremental inclusive timing is less than it's combined " 438 "children (%zu < %zu). If this happens frequently, something is wrong.",
439 qPrintable(node.
name()),
441 children_inc_incl_duration);
459 if (
nodes_.count(node_key) == 0) {
460 qWarning(
"Someone requested an invalid node (%d) from profile (%d)",
464 return nodes_.at(node_key);
uint64_t cumulative_exclusive_duration_ns
uint64_t incremental_exclusive_duration_ns
uint64_t cumulative_inclusive_duration_ns
uint64_t incremental_max_duration_ns
uint64_t incremental_inclusive_duration_ns
uint64_t cumulative_call_count