From patchwork Thu Jan 10 13:44:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760259 Return-Path: Received: from mail-wr1-f68.google.com ([209.85.221.68]:41772 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfAJNob (ORCPT ); Thu, 10 Jan 2019 08:44:31 -0500 Received: by mail-wr1-f68.google.com with SMTP id x10so11399579wrs.8 for ; Thu, 10 Jan 2019 05:44:29 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 1/5] kernel-shark-qt: Remove _deselectAction from KsQuickContextMenu Date: Thu, 10 Jan 2019 15:44:15 +0200 Message-Id: <20190110134419.20247-2-ykaradzhov@vmware.com> In-Reply-To: <20190110134419.20247-1-ykaradzhov@vmware.com> References: <20190110134419.20247-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 1349 The action used to deselect the active marker gets inherited from KsQuickMarkerMenu. This makes the declaration of an identical data member in class KsQuickContextMenu ambiguous. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsQuickContextMenu.cpp | 3 +-- kernel-shark-qt/src/KsQuickContextMenu.hpp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp index 6c9c9ef..b41adb9 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.cpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp @@ -61,8 +61,7 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, _addCPUPlotAction(this), _addTaskPlotAction(this), _removeCPUPlotAction(this), - _removeTaskPlotAction(this), - _deselectAction(this) + _removeTaskPlotAction(this) { typedef void (KsQuickContextMenu::*mfp)(); QString taskName, parentName, descr; diff --git a/kernel-shark-qt/src/KsQuickContextMenu.hpp b/kernel-shark-qt/src/KsQuickContextMenu.hpp index f5a2a78..670d010 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.hpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.hpp @@ -104,8 +104,6 @@ private: QAction _removeCPUPlotAction; QAction _removeTaskPlotAction; - - QAction _deselectAction; }; /** From patchwork Thu Jan 10 13:44:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760261 Return-Path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:45466 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729042AbfAJNoc (ORCPT ); Thu, 10 Jan 2019 08:44:32 -0500 Received: by mail-wr1-f67.google.com with SMTP id t6so11379522wrr.12 for ; Thu, 10 Jan 2019 05:44:30 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 2/5] kernel-shark-qt: Remove the "Apply to" checkboxes from KsQuickContextMenu Date: Thu, 10 Jan 2019 15:44:16 +0200 Message-Id: <20190110134419.20247-3-ykaradzhov@vmware.com> In-Reply-To: <20190110134419.20247-1-ykaradzhov@vmware.com> References: <20190110134419.20247-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 1623 "Apply to list/graph" checkboxes are available in the "Filter" top menu. Having the same checkboxes in the Context menu is a potential source of confusion for the user. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsQuickContextMenu.cpp | 30 ---------------------- 1 file changed, 30 deletions(-) diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp index b41adb9..4f922a2 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.cpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp @@ -88,36 +88,6 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, addSection("Pointer menu"); - if (parentName == "KsTraceViewer") { - _graphSyncCBox = - KsUtils::addCheckBoxToMenu(this, "Apply filters to Graph"); - - connect(_graphSyncCBox, &QCheckBox::stateChanged, - &KsUtils::graphFilterSync); - - /* - * By defauls the filters will be append to the List (Table) - * only. - */ - KsUtils::listFilterSync(true); - KsUtils::graphFilterSync(false); - _graphSyncCBox->setChecked(false); - } - - if (parentName == "KsTraceGraph" && - (graphs = dynamic_cast(parent))) { - _listSyncCBox = - KsUtils::addCheckBoxToMenu(this, "Apply filters to List"); - - connect(_listSyncCBox, &QCheckBox::stateChanged, - &KsUtils::listFilterSync); - - /* By defauls the filters will be append to the Graph only. */ - KsUtils::graphFilterSync(true); - KsUtils::listFilterSync(false); - _listSyncCBox->setChecked(false); - } - descr = "Hide task ["; descr += taskName; descr += "-"; From patchwork Thu Jan 10 13:44:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760263 Return-Path: Received: from mail-wr1-f66.google.com ([209.85.221.66]:41773 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfAJNoc (ORCPT ); Thu, 10 Jan 2019 08:44:32 -0500 Received: by mail-wr1-f66.google.com with SMTP id x10so11399662wrs.8 for ; Thu, 10 Jan 2019 05:44:31 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 3/5] kernel-shark-qt: Rearrange the KsQuickContextMenu menu Date: Thu, 10 Jan 2019 15:44:17 +0200 Message-Id: <20190110134419.20247-4-ykaradzhov@vmware.com> In-Reply-To: <20190110134419.20247-1-ykaradzhov@vmware.com> References: <20190110134419.20247-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2308 Swaps the position of the Show / Hide actions in the menu. This is done because we expect the "Show" actions to be used more often. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsQuickContextMenu.cpp | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp index 4f922a2..7ab5a5f 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.cpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp @@ -88,13 +88,6 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, addSection("Pointer menu"); - descr = "Hide task ["; - descr += taskName; - descr += "-"; - descr += QString("%1").arg(pid); - descr += "]"; - lamAddAction(&_hideTaskAction, &KsQuickContextMenu::_hideTask); - descr = "Show task ["; descr += taskName; descr += "-"; @@ -102,23 +95,32 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, descr += "] only"; lamAddAction(&_showTaskAction, &KsQuickContextMenu::_showTask); - descr = "Hide event ["; - descr += kshark_get_event_name_easy(_data->rows()[_row]); + descr = "Hide task ["; + descr += taskName; + descr += "-"; + descr += QString("%1").arg(pid); descr += "]"; - lamAddAction(&_hideEventAction, &KsQuickContextMenu::_hideEvent); + lamAddAction(&_hideTaskAction, &KsQuickContextMenu::_hideTask); descr = "Show event ["; descr += kshark_get_event_name_easy(_data->rows()[_row]); descr += "] only"; lamAddAction(&_showEventAction, &KsQuickContextMenu::_showEvent); - descr = QString("Hide CPU [%1]").arg(_data->rows()[_row]->cpu); - lamAddAction(&_hideCPUAction, &KsQuickContextMenu::_hideCPU); + descr = "Hide event ["; + descr += kshark_get_event_name_easy(_data->rows()[_row]); + descr += "]"; + lamAddAction(&_hideEventAction, &KsQuickContextMenu::_hideEvent); if (parentName == "KsTraceViewer") { descr = QString("Show CPU [%1] only").arg(cpu); lamAddAction(&_showCPUAction, &KsQuickContextMenu::_showCPU); + } + + descr = QString("Hide CPU [%1]").arg(_data->rows()[_row]->cpu); + lamAddAction(&_hideCPUAction, &KsQuickContextMenu::_hideCPU); + if (parentName == "KsTraceViewer") { descr = "Add ["; descr += taskName; descr += "-"; From patchwork Thu Jan 10 13:44:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760267 Return-Path: Received: from mail-wm1-f66.google.com ([209.85.128.66]:36304 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729044AbfAJNoe (ORCPT ); Thu, 10 Jan 2019 08:44:34 -0500 Received: by mail-wm1-f66.google.com with SMTP id p6so12074488wmc.1 for ; Thu, 10 Jan 2019 05:44:32 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 4/5] kernel-shark-qt: Add "clear all filters" action to KsQuickContextMenu Date: Thu, 10 Jan 2019 15:44:18 +0200 Message-Id: <20190110134419.20247-5-ykaradzhov@vmware.com> In-Reply-To: <20190110134419.20247-1-ykaradzhov@vmware.com> References: <20190110134419.20247-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 1844 A quick access to this action can save time and be very useful. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsQuickContextMenu.cpp | 6 +++++- kernel-shark-qt/src/KsQuickContextMenu.hpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp index 7ab5a5f..231ca38 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.cpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp @@ -61,7 +61,8 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, _addCPUPlotAction(this), _addTaskPlotAction(this), _removeCPUPlotAction(this), - _removeTaskPlotAction(this) + _removeTaskPlotAction(this), + _clearAllFilters(this) { typedef void (KsQuickContextMenu::*mfp)(); QString taskName, parentName, descr; @@ -120,6 +121,9 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, descr = QString("Hide CPU [%1]").arg(_data->rows()[_row]->cpu); lamAddAction(&_hideCPUAction, &KsQuickContextMenu::_hideCPU); + descr = "Clear all filters"; + lamAddAction(&_clearAllFilters, &KsQuickContextMenu::_clearFilters); + if (parentName == "KsTraceViewer") { descr = "Add ["; descr += taskName; diff --git a/kernel-shark-qt/src/KsQuickContextMenu.hpp b/kernel-shark-qt/src/KsQuickContextMenu.hpp index 670d010..df8a65b 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.hpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.hpp @@ -85,6 +85,8 @@ private: QVector _getFilterVector(tracecmd_filter_id *filter, int newId); + void _clearFilters() {_data->clearAllFilters();} + KsDataStore *_data; size_t _row; @@ -104,6 +106,8 @@ private: QAction _removeCPUPlotAction; QAction _removeTaskPlotAction; + + QAction _clearAllFilters; }; /** From patchwork Thu Jan 10 13:44:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760265 Return-Path: Received: from mail-wm1-f67.google.com ([209.85.128.67]:36306 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbfAJNod (ORCPT ); Thu, 10 Jan 2019 08:44:33 -0500 Received: by mail-wm1-f67.google.com with SMTP id p6so12074522wmc.1 for ; Thu, 10 Jan 2019 05:44:32 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 5/5] kernel-shark-qt: Add section separator in KsQuickContextMenu Date: Thu, 10 Jan 2019 15:44:19 +0200 Message-Id: <20190110134419.20247-6-ykaradzhov@vmware.com> In-Reply-To: <20190110134419.20247-1-ykaradzhov@vmware.com> References: <20190110134419.20247-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 1094 Adding a separator between the filter-related and the plot-related actions in the menu helps the user to get orientation. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsQuickContextMenu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp index 231ca38..728ecbd 100644 --- a/kernel-shark-qt/src/KsQuickContextMenu.cpp +++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp @@ -87,7 +87,7 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, parentName = parent->metaObject()->className(); - addSection("Pointer menu"); + addSection("Pointer filter menu"); descr = "Show task ["; descr += taskName; @@ -124,6 +124,8 @@ KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row, descr = "Clear all filters"; lamAddAction(&_clearAllFilters, &KsQuickContextMenu::_clearFilters); + addSection("Pointer plot menu"); + if (parentName == "KsTraceViewer") { descr = "Add ["; descr += taskName;