@@ -105,6 +105,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND AND TT_FONT_FILE)
KsTraceGraph.cpp
KsTraceViewer.cpp
KsMainWindow.cpp
+ KsPluginsGUI.cpp
KsCaptureDialog.cpp
KsQuickContextMenu.cpp
KsAdvFilteringDialog.cpp)
@@ -147,6 +148,10 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND AND TT_FONT_FILE)
DESTINATION ${_INSTALL_PREFIX}/bin/
COMPONENT kernelshark)
+ install(FILES "${KS_DIR}/src/KsPluginsGUI.hpp"
+ DESTINATION ${KS_INCLUDS_DESTINATION}
+ COMPONENT libkshark-devel)
+
add_subdirectory(plugins)
set(PLUGINS ${PLUGINS} PARENT_SCOPE)
new file mode 100644
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: LGPL-2.1
+
+/*
+ * Copyright 2022 VMware Inc, Yordan Karadzhov (VMware) <y.karadz@gmail.com>
+ */
+
+/**
+ * @file KsPluginsGUI.cpp
+ * @brief KernelShark C++ plugin declarations.
+ */
+
+// KernelShark
+#include "KsPluginsGUI.hpp"
+#include "KsMainWindow.hpp"
+#include "KsDualMarker.hpp"
+
+void markEntryA(void *ks_ptr, const kshark_entry *e)
+{
+ KsMainWindow *ks = static_cast<KsMainWindow *>(ks_ptr);
+ ks->markEntry(e, DualMarkerState::A);
+}
+
+void markEntryB(void *ks_ptr, const kshark_entry *e)
+{
+ KsMainWindow *ks = static_cast<KsMainWindow *>(ks_ptr);
+ ks->markEntry(e, DualMarkerState::B);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: LGPL-2.1 */
+
+/*
+ * Copyright 2022 VMware Inc, Yordan Karadzhov <y.karadz@gmail.com>
+ */
+
+/**
+ * @file KsPluginsGUI.hpp
+ * @brief KernelShark C++ plugin declarations.
+ */
+
+#ifndef _KS_PLUGINS_GUI_H
+#define _KS_PLUGINS_GUI_H
+
+// KernelShark
+#include "libkshark.h"
+
+void markEntryA(void *ks_ptr, const kshark_entry *e);
+
+void markEntryB(void *ks_ptr, const kshark_entry *e);
+
+#endif
Here we will place all GUI-related APIs that will be exposed to the external plugins. For the moment we add only two such APIs that will allow the plugins to manipulate the markers. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- src/CMakeLists.txt | 5 +++++ src/KsPluginsGUI.cpp | 27 +++++++++++++++++++++++++++ src/KsPluginsGUI.hpp | 22 ++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 src/KsPluginsGUI.cpp create mode 100644 src/KsPluginsGUI.hpp