diff options
author | Yordan Karadzhov <ykaradzhov@vmware.com> | 2019-02-13 18:12:11 +0200 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-02-13 14:53:52 -0500 |
commit | e3abfdf7cb50ef50fab4fa3aa70af16af543cd77 (patch) | |
tree | 79f5ee817defbb900f6ab1f525a484bbcdebba07 | |
parent | e54616484e3403c005f92d3ddfaaa3e7829ddfa8 (diff) | |
download | trace-cmd-e3abfdf7cb50ef50fab4fa3aa70af16af543cd77.tar.gz |
kernel-shark: Check bin 0 for sched_switch event when plotting task graphs
Handle the case when task is active in the Lower Overflow bin and the
sched_switch event that close the task graph happens to be in bin 0.
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-4-ykaradzhov@vmware.com
Fixes: ba206aaa45 ("kernel-shark-qt: Add C++ API for drawing of Graphs")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | kernel-shark/src/KsPlotTools.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/kernel-shark/src/KsPlotTools.cpp b/kernel-shark/src/KsPlotTools.cpp index 816fa56f..f97c6e4d 100644 --- a/kernel-shark/src/KsPlotTools.cpp +++ b/kernel-shark/src/KsPlotTools.cpp @@ -1020,16 +1020,26 @@ void Graph::fillTaskGraph(int pid) if (cpuFront >= 0) { /* * The Lower Overflow Bin contains data from this Task. - * Now look again in the Lower Overflow Bin and find - * the Pid of the last active task on the same CPU. + * Now look again in the Lower Overflow Bin and Bim 0 + * and find the Pid of the last active task on the same + * CPU. */ - int pidCpu = ksmodel_get_pid_back(_histoPtr, - LOWER_OVERFLOW_BIN, - cpuFront, - false, - _collectionPtr, - nullptr); - if (pidCpu == pid) { + int pidCpu0, pidCpuLOB; + + pidCpu0 = ksmodel_get_pid_back(_histoPtr, + 0, + cpuFront, + false, + _collectionPtr, + nullptr); + + pidCpuLOB = ksmodel_get_pid_back(_histoPtr, + LOWER_OVERFLOW_BIN, + cpuFront, + false, + _collectionPtr, + nullptr); + if (pidCpu0 < 0 && pidCpuLOB == pid) { /* * The Task is the last one running on this * CPU. Set the Pid of the bin. In this case |