All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: linux-trace-devel@vger.kernel.org, hongzhan.chen@intel.com,
	jan.kiszka@siemens.com
Cc: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [RFC PATCH 1/2] kernel-shark: Add KsPluginsGUI.hpp/.cpp
Date: Wed, 19 Jan 2022 14:02:28 +0200	[thread overview]
Message-ID: <20220119120229.68627-2-y.karadz@gmail.com> (raw)
In-Reply-To: <20220119120229.68627-1-y.karadz@gmail.com>

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   |  1 +
 src/KsPluginsGUI.cpp | 27 +++++++++++++++++++++++++++
 src/KsPluginsGUI.hpp | 22 ++++++++++++++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 src/KsPluginsGUI.cpp
 create mode 100644 src/KsPluginsGUI.hpp

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9e0b4ae..4c26122 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -97,6 +97,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)
diff --git a/src/KsPluginsGUI.cpp b/src/KsPluginsGUI.cpp
new file mode 100644
index 0000000..a964510
--- /dev/null
+++ b/src/KsPluginsGUI.cpp
@@ -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);
+}
diff --git a/src/KsPluginsGUI.hpp b/src/KsPluginsGUI.hpp
new file mode 100644
index 0000000..808a951
--- /dev/null
+++ b/src/KsPluginsGUI.hpp
@@ -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
-- 
2.32.0


  reply	other threads:[~2022-01-19 12:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 12:02 [RFC PATCH 0/2] Allow GUI plugins to build standalone Yordan Karadzhov (VMware)
2022-01-19 12:02 ` Yordan Karadzhov (VMware) [this message]
2022-01-19 12:02 ` [RFC PATCH 2/2] kernel-shark: Install missing headers Yordan Karadzhov (VMware)
2022-01-19 12:10 ` [RFC PATCH 0/2] Allow GUI plugins to build standalone Yordan Karadzhov
2022-02-11  5:03   ` Chen, Hongzhan
2022-02-11 12:30     ` Yordan Karadzhov
2022-02-14  1:19       ` Chen, Hongzhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220119120229.68627-2-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=hongzhan.chen@intel.com \
    --cc=jan.kiszka@siemens.com \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.