* Added scroll view around the activity chart.

* Set the displayed domain to 0.5 s for debugging purposes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30649 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-05-06 15:33:51 +00:00
parent a5c1cac5a8
commit 972c78f81a
@@ -8,6 +8,7 @@
#include <new> #include <new>
#include <GroupLayoutBuilder.h> #include <GroupLayoutBuilder.h>
#include <ScrollView.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
@@ -96,7 +97,7 @@ public:
previousEventTime = event->time; previousEventTime = event->time;
break; break;
} }
case B_SYSTEM_PROFILER_THREAD_ENQUEUED_IN_RUN_QUEUE: case B_SYSTEM_PROFILER_THREAD_ENQUEUED_IN_RUN_QUEUE:
{ {
system_profiler_thread_enqueued_in_run_queue* event system_profiler_thread_enqueued_in_run_queue* event
@@ -106,7 +107,7 @@ public:
previousEventTime = event->time; previousEventTime = event->time;
break; break;
} }
case B_SYSTEM_PROFILER_THREAD_REMOVED_FROM_RUN_QUEUE: case B_SYSTEM_PROFILER_THREAD_REMOVED_FROM_RUN_QUEUE:
{ {
system_profiler_thread_removed_from_run_queue* event system_profiler_thread_removed_from_run_queue* event
@@ -134,7 +135,7 @@ public:
system_profiler_thread_scheduled* event system_profiler_thread_scheduled* event
= (system_profiler_thread_scheduled*)(header + 1); = (system_profiler_thread_scheduled*)(header + 1);
eventTime = double(event->time - baseTime); eventTime = double(event->time - baseTime);
if (event->thread == threadID) { if (event->thread == threadID) {
// thread scheduled // thread scheduled
if (state == READY) { if (state == READY) {
@@ -145,7 +146,7 @@ public:
// before // before
timeType = PREEMPTION_TIME; timeType = PREEMPTION_TIME;
} }
if (state == STILL_RUNNING) { if (state == STILL_RUNNING) {
// Thread was running and continues to run. // Thread was running and continues to run.
state = RUNNING; state = RUNNING;
@@ -166,17 +167,17 @@ public:
timeType = RUN_TIME; timeType = RUN_TIME;
} }
} }
break; break;
} }
case B_SYSTEM_PROFILER_THREAD_ENQUEUED_IN_RUN_QUEUE: case B_SYSTEM_PROFILER_THREAD_ENQUEUED_IN_RUN_QUEUE:
{ {
system_profiler_thread_enqueued_in_run_queue* event system_profiler_thread_enqueued_in_run_queue* event
= (system_profiler_thread_enqueued_in_run_queue*) = (system_profiler_thread_enqueued_in_run_queue*)
(header + 1); (header + 1);
eventTime = double(event->time - baseTime); eventTime = double(event->time - baseTime);
if (state == RUNNING || state == STILL_RUNNING) { if (state == RUNNING || state == STILL_RUNNING) {
// Thread was running and is reentered into the run // Thread was running and is reentered into the run
// queue. This is done by the scheduler, if the // queue. This is done by the scheduler, if the
@@ -193,20 +194,20 @@ public:
state = READY; state = READY;
timeType = WAIT_TIME; timeType = WAIT_TIME;
} }
break; break;
} }
case B_SYSTEM_PROFILER_THREAD_REMOVED_FROM_RUN_QUEUE: case B_SYSTEM_PROFILER_THREAD_REMOVED_FROM_RUN_QUEUE:
{ {
system_profiler_thread_removed_from_run_queue* event system_profiler_thread_removed_from_run_queue* event
= (system_profiler_thread_removed_from_run_queue*) = (system_profiler_thread_removed_from_run_queue*)
(header + 1); (header + 1);
eventTime = double(event->time - baseTime); eventTime = double(event->time - baseTime);
// This really only happens when the thread priority is // This really only happens when the thread priority is
// changed while the thread is ready. // changed while the thread is ready.
if (state == RUNNING) { if (state == RUNNING) {
// This should never happen. // This should never happen.
state = READY; state = READY;
@@ -219,7 +220,7 @@ public:
timeType = PREEMPTION_TIME; timeType = PREEMPTION_TIME;
} else } else
state = READY; state = READY;
break; break;
} }
} }
@@ -315,7 +316,7 @@ ThreadWindow::ActivityPage::ActivityPage()
fActivityChart = new Chart(fActivityChartRenderer); fActivityChart = new Chart(fActivityChartRenderer);
BGroupLayoutBuilder(this) BGroupLayoutBuilder(this)
.Add(fActivityChart) .Add(new BScrollView("activity scroll", fActivityChart, 0, true, false))
.AddStrut(20) .AddStrut(20)
; ;
@@ -327,15 +328,15 @@ ThreadWindow::ActivityPage::ActivityPage()
fActivityChart->SetAxis(CHART_AXIS_BOTTOM, axis); fActivityChart->SetAxis(CHART_AXIS_BOTTOM, axis);
axis = new LegendChartAxis( axis = new LegendChartAxis(
new BigtimeChartAxisLegendSource, new StringChartLegendRenderer); new BigtimeChartAxisLegendSource, new StringChartLegendRenderer);
fActivityChart->SetAxis(CHART_AXIS_TOP, axis); fActivityChart->SetAxis(CHART_AXIS_TOP, axis);
axis = new LegendChartAxis( axis = new LegendChartAxis(
new DefaultChartAxisLegendSource, new StringChartLegendRenderer); new DefaultChartAxisLegendSource, new StringChartLegendRenderer);
fActivityChart->SetAxis(CHART_AXIS_LEFT, axis); fActivityChart->SetAxis(CHART_AXIS_LEFT, axis);
axis = new LegendChartAxis( axis = new LegendChartAxis(
new DefaultChartAxisLegendSource, new StringChartLegendRenderer); new DefaultChartAxisLegendSource, new StringChartLegendRenderer);
fActivityChart->SetAxis(CHART_AXIS_RIGHT, axis); fActivityChart->SetAxis(CHART_AXIS_RIGHT, axis);
} }
@@ -402,5 +403,6 @@ ThreadWindow::ActivityPage::SetModel(ThreadModel* model)
fPreemptionTimeData = new(std::nothrow) ThreadActivityData(fThreadModel, fPreemptionTimeData = new(std::nothrow) ThreadActivityData(fThreadModel,
LATENCY_TIME); LATENCY_TIME);
fActivityChart->AddDataSource(fPreemptionTimeData, &latencyConfig); fActivityChart->AddDataSource(fPreemptionTimeData, &latencyConfig);
fActivityChart->SetDisplayDomain(ChartDataRange(0, 500000));
} }
} }