aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYordan Karadzhov (VMware) <y.karadz@gmail.com>2019-07-15 16:20:40 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-07-18 17:04:56 -0400
commit8b4bd284b975fdfe4539e00a17a181ec8af1c4e1 (patch)
tree9a3279ca8d00d1d5fa598e04394ddbabdb680b13
parent4ff3880c7f63c176ef1fcfeb97f5e3a103890bab (diff)
downloadtrace-cmd-8b4bd284b975fdfe4539e00a17a181ec8af1c4e1.tar.gz
kernel-shark: The graph widget must follow the active marker
The "Graph follows" checkbox controls if the Graph widget follows or not the change of the Active marker made from the View widget (the text data table). In the same time, when the user clicks on the checkbox switching it from Unchecked to Checked, a signal is send to the Graph widget to make sure that it will visualize the current position of the Active marker. When sending this signal, we currently use the iterator of the search results list, which is wrong because of two reasons. First, the search results list can be empty, which will trigger a segmentation fault, as reported by Valentin Schneider. But even more important is that nothing guarantees that when the checkbox is checked, the marker and the iterator both point to the same trace entry. Note that the iteration over the search results is only one of the possible ways to change the marker. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204139 Link: http://lore.kernel.org/linux-trace-devel/20190715132042.5154-2-y.karadz@gmail.com Reported-By: Valentin Schneider <valentin.schneider@arm.com> Tested-by: Valentin Schneider <valentin.schneider@arm.com> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--kernel-shark/src/KsTraceViewer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp
index 05977c3d..89e5dba2 100644
--- a/kernel-shark/src/KsTraceViewer.cpp
+++ b/kernel-shark/src/KsTraceViewer.cpp
@@ -285,10 +285,11 @@ void KsTraceViewer::_searchEditText(const QString &text)
void KsTraceViewer::_graphFollowsChanged(int state)
{
- _graphFollows = (bool) state;
+ int row = selectedRow();
- if (_graphFollows && _searchDone())
- emit select(*_it); // Send a signal to the Graph widget.
+ _graphFollows = (bool) state;
+ if (_graphFollows && row != KS_NO_ROW_SELECTED)
+ emit select(row); // Send a signal to the Graph widget.
}
void KsTraceViewer::_search()