Skip to content

Commit 365d160

Browse files
committedDec 27, 2016
(GUI) Fixed wrong hierarchy tree building in "Plain mode" (not all blocks were added)
1 parent bf7bf10 commit 365d160

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed
 

‎profiler_gui/tree_widget_loader.cpp

+20-8
Original file line numberDiff line numberDiff line change
@@ -777,20 +777,32 @@ size_t EasyTreeWidgetLoader::setTreeInternalPlain(const ::profiler::BlocksTreeRo
777777
{
778778
++total_items;
779779

780+
size_t children_items_number = 0;
781+
::profiler::timestamp_t children_duration = 0;
782+
if (!child.children.empty())
783+
{
784+
children_items_number = setTreeInternalPlain(_threadRoot, _firstCswitch, _beginTime, child.children, _frame, _frame, _left, _right, _strict, children_duration, _colorizeRows, _addZeroBlocks, _units);
785+
if (interrupted())
786+
break;
787+
}
788+
780789
if (it->second != nullptr && child.per_frame_stats != nullptr)
781790
{
782791
auto item = it->second;
783792

784-
auto children_duration = calculateChildrenDurationRecursive(child.children, it->first);
785-
auto self_duration = item->data(COL_SELF_DURATION, Qt::UserRole).toULongLong() - children_duration;
793+
//auto children_duration = calculateChildrenDurationRecursive(child.children, it->first);
794+
if (children_duration != 0)
795+
{
796+
auto self_duration = item->data(COL_SELF_DURATION, Qt::UserRole).toULongLong() - children_duration;
786797

787-
int percentage = 100;
788-
if (child.per_frame_stats->total_duration > 0)
789-
percentage = ::profiler_gui::percent(self_duration, child.per_frame_stats->total_duration);
798+
int percentage = 100;
799+
if (child.per_frame_stats->total_duration > 0)
800+
percentage = ::profiler_gui::percent(self_duration, child.per_frame_stats->total_duration);
790801

791-
item->setTimeSmart(COL_SELF_DURATION, _units, self_duration);
792-
item->setData(COL_SELF_DURATION_PERCENT, Qt::UserRole, percentage);
793-
item->setText(COL_SELF_DURATION_PERCENT, QString::number(percentage));
802+
item->setTimeSmart(COL_SELF_DURATION, _units, self_duration);
803+
item->setData(COL_SELF_DURATION_PERCENT, Qt::UserRole, percentage);
804+
item->setText(COL_SELF_DURATION_PERCENT, QString::number(percentage));
805+
}
794806

795807
bool hasContextSwitch = false;
796808
::profiler::timestamp_t idleTime = 0;

0 commit comments

Comments
 (0)
Please sign in to comment.