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>
Subject: [PATCH v2 5/6] kernel-shark: Remove unused methods from KsMainWindow class
Date: Mon, 30 Mar 2020 19:06:51 +0300	[thread overview]
Message-ID: <20200330160652.28424-6-y.karadz@gmail.com> (raw)
In-Reply-To: <20200330160652.28424-1-y.karadz@gmail.com>

We used to have menu actions for applying negative ID filters (do not
show) for PIDs and CPU IDs. At some point we decided to remove all menu
actions for negative filters in order to avoid users being confused by
the possible unexpected behavior in the case when both positive (show
only) and negative filters are set. However we kept the corresponding
private methods, just in case we want to restore the menu actions in
the future. We can now finally remove those methods, because in the
following patch the logic will be optimized to automatically decide
whether is more efficient to use positive or negative filter.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsMainWindow.cpp | 69 -------------------------------
 kernel-shark/src/KsMainWindow.hpp |  4 --
 2 files changed, 73 deletions(-)

diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index a5a399c..9b5fc2d 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -669,41 +669,6 @@ void KsMainWindow::_showTasks()
 	dialog->show();
 }
 
-void KsMainWindow::_hideTasks()
-{
-	kshark_context *kshark_ctx(nullptr);
-	KsCheckBoxWidget *tasks_cbd;
-	KsCheckBoxDialog *dialog;
-
-	if (!kshark_instance(&kshark_ctx))
-		return;
-
-	tasks_cbd = new KsTasksCheckBoxWidget(_data.tep(), false, this);
-	dialog = new KsCheckBoxDialog(tasks_cbd, this);
-
-	if (!kshark_ctx->hide_task_filter ||
-	    !kshark_ctx->hide_task_filter->count) {
-		tasks_cbd->setDefault(false);
-	} else {
-		QVector<int> pids = KsUtils::getPidList();
-		int nPids = pids.count();
-		QVector<bool> v(nPids, false);
-
-		for (int i = 0; i < nPids; ++i) {
-			if (tracecmd_filter_id_find(kshark_ctx->hide_task_filter,
-						    pids[i]))
-				v[i] = true;
-		}
-
-		tasks_cbd->set(v);
-	}
-
-	connect(dialog,		&KsCheckBoxDialog::apply,
-		&_data,		&KsDataStore::applyNegTaskFilter);
-
-	dialog->show();
-}
-
 void KsMainWindow::_showCPUs()
 {
 	kshark_context *kshark_ctx(nullptr);
@@ -737,40 +702,6 @@ void KsMainWindow::_showCPUs()
 	dialog->show();
 }
 
-void KsMainWindow::_hideCPUs()
-{
-	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->hide_cpu_filter ||
-	    !kshark_ctx->hide_cpu_filter->count) {
-		cpu_cbd->setDefault(false);
-	} 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->hide_cpu_filter,
-						    i))
-				v[i] = true;
-		}
-
-		cpu_cbd->set(v);
-	}
-
-	connect(dialog,		&KsCheckBoxDialog::apply,
-		&_data,		&KsDataStore::applyNegCPUFilter);
-
-	dialog->show();
-}
-
 void KsMainWindow::_advancedFiltering()
 {
 	KsAdvFilteringDialog *dialog;
diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp
index eef4f96..59030e4 100644
--- a/kernel-shark/src/KsMainWindow.hpp
+++ b/kernel-shark/src/KsMainWindow.hpp
@@ -181,12 +181,8 @@ private:
 
 	void _showTasks();
 
-	void _hideTasks();
-
 	void _showCPUs();
 
-	void _hideCPUs();
-
 	void _advancedFiltering();
 
 	void _clearFilters();
-- 
2.20.1


  parent reply	other threads:[~2020-03-30 16:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 16:06 [PATCH v2 0/6] kernel-shark: Optimize the logic of the filtering menus Yordan Karadzhov (VMware)
2020-03-30 16:06 ` [PATCH v2 1/6] kernel-shark: Add method for checking if a given ID filter is set Yordan Karadzhov (VMware)
2020-03-30 16:06 ` [PATCH v2 2/6] kernel-shark: Fix bug in bool kshark_export_all_cpu_filters() Yordan Karadzhov (VMware)
2020-03-30 16:06 ` [PATCH v2 3/6] kernel-shark: Add two helper methods to KsUtils Yordan Karadzhov (VMware)
2020-03-30 16:06 ` [PATCH v2 4/6] kernel-shark: Add getIds() to class KsCheckBoxWidget Yordan Karadzhov (VMware)
2020-03-30 16:06 ` Yordan Karadzhov (VMware) [this message]
2020-03-30 16:06 ` [PATCH v2 6/6] kernel-shark: Optimize the logic of the filtering menus 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=20200330160652.28424-6-y.karadz@gmail.com \
    --to=y.karadz@gmail.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).