diff mbox series

[v2,3/3] kernel-shark: Make the "stop search" button always visible

Message ID 20200504174342.24615-4-y.karadz@gmail.com (mailing list archive)
State Accepted
Commit e36f7f66ad3dd51ea5a5e3dd18c8f63f33155bc1
Delegated to: Steven Rostedt
Headers show
Series kernel-shark: Have "stop" button for multi-threaded searches | expand

Commit Message

Yordan Karadzhov May 4, 2020, 5:43 p.m. UTC
So far the button was showing up only when we do a single-threaded
search in the data. Stopping the multi-threaded searches became
possible after the modification of the parallel search introduced
in the previous commit. When the multi-threaded search is restarted
(after being stopped) the label showing the number of matches found
is reset to show nothing. It will show the count again when the
search finishes or is stopped.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsSearchFSM.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Steven Rostedt May 4, 2020, 6:58 p.m. UTC | #1
On Mon,  4 May 2020 20:43:42 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> So far the button was showing up only when we do a single-threaded
> search in the data. Stopping the multi-threaded searches became
> possible after the modification of the parallel search introduced
> in the previous commit. When the multi-threaded search is restarted
> (after being stopped) the label showing the number of matches found
> is reset to show nothing. It will show the count again when the
> search finishes or is stopped.
>

I'm pulling in this series. But more of an FYI, it's best to avoid
statements like "previous commit" because when developing with git, it may
not be a previous commit, when it goes into a tree. Especially if a commit
gets cherry-picked. 

Instead, use phrases like "With the parallel search changes that
were made, it is now possible to stop the multi-threaded searches and still
be at the correct percentage of the search that is displayed to the user".

It is frowned upon to mention "this commit" or "last commit" in change
logs. I catch myself doing it once in a while, and try to conform as
well ;-)

-- Steve
diff mbox series

Patch

diff --git a/kernel-shark/src/KsSearchFSM.cpp b/kernel-shark/src/KsSearchFSM.cpp
index 4f01cc8..6a93ca7 100644
--- a/kernel-shark/src/KsSearchFSM.cpp
+++ b/kernel-shark/src/KsSearchFSM.cpp
@@ -142,11 +142,7 @@  void NotDone::handleInput(KsSearchFSM* sm, sm_input_t input)
 		sm->lockSearchPanel();
 		sm->updateCondition();
 		sm->progressBarVisible(true);
-
-		if (sm->column() == KsViewModel::TRACE_VIEW_COL_INFO ||
-		    sm->column() == KsViewModel::TRACE_VIEW_COL_LAT)
-			sm->searchStopVisible(true);
-
+		sm->searchStopVisible(true);
 		sm->changeState(std::shared_ptr<InProgress>(new InProgress));
 		break;
 
@@ -168,6 +164,11 @@  void Paused::handleInput(KsSearchFSM* sm, sm_input_t input)
 		sm->lockSearchPanel();
 		sm->searchStopVisible(true);
 		sm->searchRestartVisible(false);
+
+		if (sm->column() != KsViewModel::TRACE_VIEW_COL_INFO &&
+		    sm->column() != KsViewModel::TRACE_VIEW_COL_LAT)
+			sm->_searchCountLabel.setText("");
+
 		sm->changeState(std::shared_ptr<InProgress>(new InProgress));
 		break;