linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>,
	Valentin Schneider <valentin.schneider@arm.com>
Subject: [PATCH 1/3] kernel-shark: The graph widget must follow the active marker
Date: Mon, 15 Jul 2019 16:20:40 +0300	[thread overview]
Message-ID: <20190715132042.5154-2-y.karadz@gmail.com> (raw)
In-Reply-To: <20190715132042.5154-1-y.karadz@gmail.com>

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 clacked, 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.

Reported-By: Valentin Schneider <valentin.schneider@arm.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204139
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsTraceViewer.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp
index 05977c3..89e5dba 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()
-- 
2.20.1


  reply	other threads:[~2019-07-15 13:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 13:20 [PATCH 0/3] Fixes needed befor KS 1.0 Yordan Karadzhov (VMware)
2019-07-15 13:20 ` Yordan Karadzhov (VMware) [this message]
2019-07-15 13:20 ` [PATCH 2/3] kernel-shark: Always clear the marker after resizing the table Yordan Karadzhov (VMware)
2019-07-15 13:20 ` [PATCH 3/3] kernel-shark: Don't try to update the markers if no data is loaded Yordan Karadzhov (VMware)
2019-07-17 19:30   ` Steven Rostedt
2019-07-18 13:51     ` Yordan Karadzhov (VMware)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715132042.5154-2-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=valentin.schneider@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).