From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: "rostedt@goodmis.org" <rostedt@goodmis.org>
Cc: "linux-trace-devel@vger.kernel.org" <linux-trace-devel@vger.kernel.org>
Subject: [PATCH 05/11] kernel-shark-qt: Add iterator index to the search panel
Date: Wed, 21 Nov 2018 15:14:23 +0000 [thread overview]
Message-ID: <20181121151356.16901-7-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20181121151356.16901-1-ykaradzhov@vmware.com>
The search panel displays the index inside the list of search
matching entries.
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
kernel-shark-qt/src/KsTraceViewer.cpp | 17 +++++++++++++++--
kernel-shark-qt/src/KsTraceViewer.hpp | 2 ++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/kernel-shark-qt/src/KsTraceViewer.cpp b/kernel-shark-qt/src/KsTraceViewer.cpp
index e92dd83..3df4a5d 100644
--- a/kernel-shark-qt/src/KsTraceViewer.cpp
+++ b/kernel-shark-qt/src/KsTraceViewer.cpp
@@ -362,6 +362,8 @@ void KsTraceViewer::_next()
if (_graphFollows)
emit select(*_it); // Send a signal to the Graph widget.
}
+
+ _updateSearchCount();
}
void KsTraceViewer::_prev()
@@ -385,6 +387,16 @@ void KsTraceViewer::_prev()
if (_graphFollows)
emit select(*_it); // Send a signal to the Graph widget.
}
+
+ _updateSearchCount();
+}
+
+void KsTraceViewer::_updateSearchCount()
+{
+ int index(_it - _matchList.begin());
+ int total(_matchList.count());
+
+ _searchCountLabel.setText(QString(" %1 / %2").arg(index).arg(total));
}
void KsTraceViewer::_searchStop()
@@ -571,7 +583,6 @@ size_t KsTraceViewer::_searchItems(int column,
count = _matchList.count();
_pbAction->setVisible(false);
- _searchCountLabel.setText(QString(" %1").arg(count));
_searchDone = true;
if (count == 0) // No items have been found. Do nothing.
@@ -605,6 +616,8 @@ size_t KsTraceViewer::_searchItems(int column,
_it = _matchList.begin();
}
+ _updateSearchCount();
+
return count;
}
@@ -645,7 +658,7 @@ void KsTraceViewer::_searchItemsMapReduce(int column,
for (int r = 1; r < nThreads; ++r)
maps.push_back(std::async(lamSearchMap, ranges[r], false));
- while (_proxyModel.searchProgress() < KS_PROGRESS_BAR_MAX- nThreads) {
+ while (_proxyModel.searchProgress() < KS_PROGRESS_BAR_MAX - nThreads) {
std::unique_lock<std::mutex> lk(_proxyModel._mutex);
_proxyModel._pbCond.wait(lk);
_searchProgBar.setValue(_proxyModel.searchProgress());
diff --git a/kernel-shark-qt/src/KsTraceViewer.hpp b/kernel-shark-qt/src/KsTraceViewer.hpp
index de8af97..19371de 100644
--- a/kernel-shark-qt/src/KsTraceViewer.hpp
+++ b/kernel-shark-qt/src/KsTraceViewer.hpp
@@ -132,6 +132,8 @@ private:
void _prev();
+ void _updateSearchCount();
+
void _searchStop();
void _clicked(const QModelIndex& i);
--
2.17.1
next prev parent reply other threads:[~2018-11-22 1:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 15:14 [PATCH 00/11] Small modifications and bug fixes toward KS 1.0 Yordan Karadzhov
2018-11-21 15:14 ` [PATCH 01/11] kernel-shark-qt: protect all calls of tep_read_number_field() Yordan Karadzhov
2018-11-21 15:14 ` [PATCH 01/11] kernel-shark-qt: Protect " Yordan Karadzhov
2018-11-27 20:34 ` Steven Rostedt
2018-11-21 15:14 ` [PATCH 02/11] kernel-shark-qt: Fix the returned error value of kshark_get_event_id_easy() Yordan Karadzhov
2018-11-21 15:14 ` [PATCH 03/11] kernel-shark-qt: Avoid race condition in kshark_get_event_name_easy() Yordan Karadzhov
2018-11-27 20:37 ` Steven Rostedt
2018-11-21 15:14 ` [PATCH 04/11] kernel-shark-qt: Optimize the search in the text data Yordan Karadzhov
2018-11-21 15:14 ` Yordan Karadzhov [this message]
2018-11-21 15:14 ` [PATCH 06/11] kernel-shark-qt: Update search iterator when marker is changed Yordan Karadzhov
2018-11-21 15:14 ` [PATCH 07/11] kernel-shark-qt: Optimize the search in a case of a small data-set Yordan Karadzhov
2018-11-21 15:14 ` [PATCH 08/11] kernel-shark qt: No error when Record authentication dialog is closed Yordan Karadzhov
2018-11-27 20:45 ` Steven Rostedt
2018-11-21 15:14 ` [PATCH 09/11] kernel-shark-qt: Remove all system=ftrace events from Record dialog Yordan Karadzhov
2018-11-27 23:02 ` [PATCH 00/11] Small modifications and bug fixes toward KS 1.0 Steven Rostedt
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=20181121151356.16901-7-ykaradzhov@vmware.com \
--to=ykaradzhov@vmware.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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).