diff mbox series

[09/11] kernel-shark-qt: Remove all system=ftrace events from Record dialog

Message ID 20181121151356.16901-11-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Headers show
Series Small modifications and bug fixes toward KS 1.0 | expand

Commit Message

Yordan Karadzhov Nov. 21, 2018, 3:14 p.m. UTC
"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 <ykaradzhov@vmware.com>
---
 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 mbox series

Patch

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);
 };
 
 /**