Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Yordan Karadzhov <ykaradzhov@vmware.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH v2 1/6] kernel-shark-qt: Rearrange the "Filter" top menu
Date: Wed,  9 Jan 2019 15:09:40 +0200
Message-ID: <20190109130945.28519-2-ykaradzhov@vmware.com> (raw)
In-Reply-To: <20190109130945.28519-1-ykaradzhov@vmware.com>

Now the "Filter" top menu contains only "Show Task" and "Show CPU"
menu actions ("Hide" versions are removed).

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/KsMainWindow.cpp | 46 ++++++++++++++++++++++------
 kernel-shark-qt/src/KsMainWindow.hpp |  6 ++--
 2 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/kernel-shark-qt/src/KsMainWindow.cpp b/kernel-shark-qt/src/KsMainWindow.cpp
index a375126..8bb51a3 100644
--- a/kernel-shark-qt/src/KsMainWindow.cpp
+++ b/kernel-shark-qt/src/KsMainWindow.cpp
@@ -53,8 +53,7 @@ KsMainWindow::KsMainWindow(QWidget *parent)
   _listFilterSyncCBox(nullptr),
   _showEventsAction("Show events", this),
   _showTasksAction("Show tasks", this),
-  _hideTasksAction("Hide tasks", this),
-  _hideCPUsAction("Hide CPUs", this),
+  _showCPUsAction("Show CPUs", this),
   _advanceFilterAction("Advance Filtering", this),
   _clearAllFilters("Clear all filters", this),
   _cpuSelectAction("CPUs", this),
@@ -205,11 +204,8 @@ void KsMainWindow::_createActions()
 	connect(&_showTasksAction,	&QAction::triggered,
 		this,			&KsMainWindow::_showTasks);
 
-	connect(&_hideTasksAction,	&QAction::triggered,
-		this,			&KsMainWindow::_hideTasks);
-
-	connect(&_hideCPUsAction,	&QAction::triggered,
-		this,			&KsMainWindow::_hideCPUs);
+	connect(&_showCPUsAction,	&QAction::triggered,
+		this,			&KsMainWindow::_showCPUs);
 
 	connect(&_advanceFilterAction,	&QAction::triggered,
 		this,			&KsMainWindow::_advancedFiltering);
@@ -322,8 +318,7 @@ void KsMainWindow::_createMenus()
 
 	filter->addAction(&_showEventsAction);
 	filter->addAction(&_showTasksAction);
-	filter->addAction(&_hideTasksAction);
-	filter->addAction(&_hideCPUsAction);
+	filter->addAction(&_showCPUsAction);
 	filter->addAction(&_advanceFilterAction);
 	filter->addAction(&_clearAllFilters);
 
@@ -621,6 +616,39 @@ void KsMainWindow::_hideTasks()
 	dialog->show();
 }
 
+void KsMainWindow::_showCPUs()
+{
+	kshark_context *kshark_ctx(nullptr);
+	KsCheckBoxWidget *cpu_cbd;
+	KsCheckBoxDialog *dialog;
+
+	if (!kshark_instance(&kshark_ctx))
+		return;
+
+	cpu_cbd = new KsCPUCheckBoxWidget(_data.tep(), this);
+	dialog = new KsCheckBoxDialog(cpu_cbd, this);
+
+	if (!kshark_ctx->show_cpu_filter ||
+	    !kshark_ctx->show_cpu_filter->count) {
+		cpu_cbd->setDefault(true);
+	} else {
+		int nCPUs = tep_get_cpus(_data.tep());
+		QVector<bool> v(nCPUs, false);
+
+		for (int i = 0; i < nCPUs; ++i) {
+			if (tracecmd_filter_id_find(kshark_ctx->show_cpu_filter, i))
+				v[i] = true;
+		}
+
+		cpu_cbd->set(v);
+	}
+
+	connect(dialog,		&KsCheckBoxDialog::apply,
+		&_data,		&KsDataStore::applyPosCPUFilter);
+
+	dialog->show();
+}
+
 void KsMainWindow::_hideCPUs()
 {
 	kshark_context *kshark_ctx(nullptr);
diff --git a/kernel-shark-qt/src/KsMainWindow.hpp b/kernel-shark-qt/src/KsMainWindow.hpp
index 301acc9..44f7dd7 100644
--- a/kernel-shark-qt/src/KsMainWindow.hpp
+++ b/kernel-shark-qt/src/KsMainWindow.hpp
@@ -118,9 +118,7 @@ private:
 
 	QAction		_showTasksAction;
 
-	QAction		_hideTasksAction;
-
-	QAction		_hideCPUsAction;
+	QAction		_showCPUsAction;
 
 	QAction		_advanceFilterAction;
 
@@ -173,6 +171,8 @@ private:
 
 	void _hideTasks();
 
+	void _showCPUs();
+
 	void _hideCPUs();
 
 	void _advancedFiltering();
-- 
2.17.1

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 13:09 [PATCH v2 0/6] Modifications toward KS 1.0 Yordan Karadzhov
2019-01-09 13:09 ` Yordan Karadzhov [this message]
2019-01-09 13:09 ` [PATCH v2 2/6] kernel-shark-qt: Cosmetic modifications in KsQuickContextMenu Yordan Karadzhov
2019-01-09 16:33   ` Steven Rostedt
2019-01-09 16:38     ` Yordan Karadzhov
2019-01-09 16:47       ` Steven Rostedt
2019-01-09 13:09 ` [PATCH v2 3/6] kernel-shark-qt: Make the selection in the Table less touchy Yordan Karadzhov
2019-01-09 13:09 ` [PATCH v2 4/6] kernel-shark-qt: Do not auto-scrolling when the marker switches Yordan Karadzhov
2019-01-09 13:09 ` [PATCH v2 5/6] kernel-shark-qt: Add the CPU filters to the filter clearing method Yordan Karadzhov
2019-01-09 13:09 ` [PATCH v2 6/6] kernel-shark-qt: Fix bug in plugin actions execution Yordan Karadzhov
2019-01-09 16:52   ` Steven Rostedt
2019-03-15  0:01     ` Steven Rostedt
2019-03-15  0:05       ` Steven Rostedt
2019-03-15  6:20         ` Yordan Karadzhov

Reply instructions:

You may reply publically 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=20190109130945.28519-2-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

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git