@@ -59,6 +59,7 @@ KsMainWindow::KsMainWindow(QWidget *parent)
_cpuSelectAction("CPUs", this),
_taskSelectAction("Tasks", this),
_pluginsAction("Plugins", this),
+ _addPluginAction("Add plugin", this),
_captureAction("Record", this),
_colorAction(this),
_colSlider(this),
@@ -233,6 +234,11 @@ void KsMainWindow::_createActions()
connect(&_pluginsAction, &QAction::triggered,
this, &KsMainWindow::_pluginSelect);
+ _addPluginAction.setStatusTip("Add plugin");
+
+ connect(&_addPluginAction, &QAction::triggered,
+ this, &KsMainWindow::_pluginAdd);
+
_captureAction.setIcon(QIcon::fromTheme("media-record"));
_captureAction.setShortcut(tr("Ctrl+R"));
_captureAction.setStatusTip("Capture trace data");
@@ -336,6 +342,7 @@ void KsMainWindow::_createMenus()
/* Tools menu */
tools = menuBar()->addMenu("Tools");
tools->addAction(&_pluginsAction);
+ tools->addAction(&_addPluginAction);
tools->addAction(&_captureAction);
tools->addSeparator();
tools->addAction(&_colorAction);
@@ -796,6 +803,19 @@ void KsMainWindow::_pluginSelect()
dialog->show();
}
+void KsMainWindow::_pluginAdd()
+{
+ QString fileName;
+
+ fileName = QFileDialog::getOpenFileName(this, "Add KernelShark plugin", KS_DIR,
+ "KernelShark Plugins (*.so);;");
+
+ if (fileName.isEmpty())
+ return;
+
+ _plugins.addPlugin(fileName);
+}
+
void KsMainWindow::_record()
{
#ifndef DO_AS_ROOT
@@ -132,6 +132,8 @@ private:
// Tools menu.
QAction _pluginsAction;
+ QAction _addPluginAction;
+
QAction _captureAction;
QWidgetAction _colorAction;
@@ -185,6 +187,8 @@ private:
void _pluginSelect();
+ void _pluginAdd();
+
void _record();
void _setColorPhase(int);
The dialog allows the user to find and load the plugin's lobrary (.so file). Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> --- kernel-shark/src/KsMainWindow.cpp | 20 ++++++++++++++++++++ kernel-shark/src/KsMainWindow.hpp | 4 ++++ 2 files changed, 24 insertions(+)