From patchwork Wed Nov 21 15:14:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10759847 Return-Path: Received: from mail-eopbgr790078.outbound.protection.outlook.com ([40.107.79.78]:23680 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731165AbeKVBu0 (ORCPT ); Wed, 21 Nov 2018 20:50:26 -0500 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH 09/11] kernel-shark-qt: Remove all system=ftrace events from Record dialog Date: Wed, 21 Nov 2018 15:14:27 +0000 Message-ID: <20181121151356.16901-11-ykaradzhov@vmware.com> References: <20181121151356.16901-1-ykaradzhov@vmware.com> In-Reply-To: <20181121151356.16901-1-ykaradzhov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: Content-Length: 2023 "ftrace" system events should not be passed as a command line option to trace-cmd. This patch remove these events from the checkbox tree of the Record dialog. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsCaptureDialog.cpp | 1 + kernel-shark-qt/src/KsWidgetsLib.cpp | 10 ++++++++++ kernel-shark-qt/src/KsWidgetsLib.hpp | 2 ++ 3 files changed, 13 insertions(+) diff --git a/kernel-shark-qt/src/KsCaptureDialog.cpp b/kernel-shark-qt/src/KsCaptureDialog.cpp index ee1abc3..5d5ca2f 100644 --- a/kernel-shark-qt/src/KsCaptureDialog.cpp +++ b/kernel-shark-qt/src/KsCaptureDialog.cpp @@ -81,6 +81,7 @@ KsCaptureControl::KsCaptureControl(QWidget *parent) _eventsWidget.setDefault(false); _eventsWidget.setMinimumHeight(25 * FONT_HEIGHT); + _eventsWidget.removeSystem("ftrace"); _topLayout.addWidget(&_eventsWidget); _pluginsLabel.adjustSize(); diff --git a/kernel-shark-qt/src/KsWidgetsLib.cpp b/kernel-shark-qt/src/KsWidgetsLib.cpp index dd6ab0f..191ea7d 100644 --- a/kernel-shark-qt/src/KsWidgetsLib.cpp +++ b/kernel-shark-qt/src/KsWidgetsLib.cpp @@ -706,6 +706,16 @@ KsEventsCheckBoxWidget::KsEventsCheckBoxWidget(struct tep_handle *tep, _adjustSize(); } +/** Remove a System from the Checkbox tree. */ +void KsEventsCheckBoxWidget::removeSystem(QString name) { + QTreeWidgetItem *item = + _tree.findItems(name, Qt::MatchFixedString, 0)[0]; + + int index = _tree.indexOfTopLevelItem(item); + if (index >= 0) + _tree.takeTopLevelItem(index); +} + /** * @brief Create KsTasksCheckBoxWidget. * diff --git a/kernel-shark-qt/src/KsWidgetsLib.hpp b/kernel-shark-qt/src/KsWidgetsLib.hpp index 89c196a..c09bcd5 100644 --- a/kernel-shark-qt/src/KsWidgetsLib.hpp +++ b/kernel-shark-qt/src/KsWidgetsLib.hpp @@ -332,6 +332,8 @@ struct KsEventsCheckBoxWidget : public KsCheckBoxTreeWidget KsEventsCheckBoxWidget(struct tep_handle *pe, QWidget *parent = nullptr); + + void removeSystem(QString name); }; /**