From patchwork Wed Jan 19 12:02:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12717496 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48C7DC433F5 for ; Wed, 19 Jan 2022 12:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345778AbiASMCn (ORCPT ); Wed, 19 Jan 2022 07:02:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240915AbiASMCn (ORCPT ); Wed, 19 Jan 2022 07:02:43 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F03F4C061574 for ; Wed, 19 Jan 2022 04:02:42 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id c24so7725067edy.4 for ; Wed, 19 Jan 2022 04:02:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R64BNmNwR/3RwuC6cXtolfCwzSJi0QnIOjrCeXNU4Ho=; b=KjLA7UXu/jWtk0hKDHFDsJ8++1qcSsTtQ69+UaeUHE3rnY5g7CmKy3NAKtSGBQCWBo GlWYPgyM2iX2NEmG4MCdaX6MN6Vz3EVLYfu1AXJgQs+bfs1RRuLEMCTE4B7VIuI73r/j s6eQwG7ypUoGCqeMQ9hLQXY0hcOaqYv+MeVU+cC+xfeZmL/IlS2VFqUKwzvwYgr64QnD 6T8qfOKVwiVGyBQBVyKX1zI6qKWV7p9nslOhhnvjZrSVwbigMdEg4idgJ+qDve/tIHzv qqugMpBsv39Yu4i1bZ/pDqKQJ5w9kx+Az5Fflv8HVRL5XlBwUJ1h+icBxVnNhnFCC4rq 3zxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R64BNmNwR/3RwuC6cXtolfCwzSJi0QnIOjrCeXNU4Ho=; b=Ts3OmmmXimCFDwJlS2Lyh/fD4WRUDeP5FOtZPs5O01WxXnlcDuyK6QfpqsNoxeKbfZ /cmCpANfK9u0O/OpU2/zxVmHtxTxOolxMenS16FvRh7YNc5mA6Tc9+ogFAhF7o5N9X14 E+yWqneNyREJ88IIBj06YjUI3PVXijmnGj0JLMKMXHnfPQWIjMdXTZrk9cylHVp0AZ31 oXaBD5ZeZWeSyNiIAwIjvxaK8E8oH2HR2sJUN/lO8HbF95DEA9ZDHF88dgfXaC12iujl UJRgsH9W0PDz+Y2J02iHrTldiNQJv6EsVi/1HEZXFim34lgAuPS45D/oIBfb152u9Q5W ibcw== X-Gm-Message-State: AOAM530ywP46TLCIHl6IRhZQV2NX/F071PBBiNoz/RqX+/gpCjFC9c2N fz70DaSj98N0af1pWhBNiC8oMB05EWE= X-Google-Smtp-Source: ABdhPJwN8ONrDHVMZVRh1lzD1ab6zOd7dEEmVt/AzA6Sqmy6AqO6jYBMHc9gm20Q/GyttanfNt53rg== X-Received: by 2002:a17:907:72c5:: with SMTP id du5mr12953149ejc.210.1642593761378; Wed, 19 Jan 2022 04:02:41 -0800 (PST) Received: from crow.vmware.com ([95.87.219.163]) by smtp.gmail.com with ESMTPSA id d10sm569491ejt.55.2022.01.19.04.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 04:02:41 -0800 (PST) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org, hongzhan.chen@intel.com, jan.kiszka@siemens.com Cc: "Yordan Karadzhov (VMware)" Subject: [RFC PATCH 1/2] kernel-shark: Add KsPluginsGUI.hpp/.cpp Date: Wed, 19 Jan 2022 14:02:28 +0200 Message-Id: <20220119120229.68627-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220119120229.68627-1-y.karadz@gmail.com> References: <20220119120229.68627-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org 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) --- 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) + */ + +/** + * @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(ks_ptr); + ks->markEntry(e, DualMarkerState::A); +} + +void markEntryB(void *ks_ptr, const kshark_entry *e) +{ + KsMainWindow *ks = static_cast(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 + */ + +/** + * @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 From patchwork Wed Jan 19 12:02:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12717497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0736DC433FE for ; Wed, 19 Jan 2022 12:02:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345795AbiASMCo (ORCPT ); Wed, 19 Jan 2022 07:02:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240915AbiASMCo (ORCPT ); Wed, 19 Jan 2022 07:02:44 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9B8FC061574 for ; Wed, 19 Jan 2022 04:02:43 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id b13so10362403edn.0 for ; Wed, 19 Jan 2022 04:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2MsgEH8UOmmaXq9hlueW8ERSGTyNihYMhDAX3WFLX0Q=; b=pp6DVF8V+k08UbOhlrZm07Af68rplaDU6r/tmodSx+9s9TdAslk9KXNouj22THU0Bb I4B42scxrGZYmVuJjJPRt/C0K2SMcKFcsq2Dm7d0Z0US9t7V4gF8i0XdmVGF+dg/+6Jg HFlANSUSHum/PaxrCffclYWYwaoSoxzAEEo6twq4Rxs9J4AZoxVzjhjE+mBCq/WXbNNo fkSNwxsqFI4ToNhgeN5KMK1I9/7eKpWEL0vgQgrrx8eTxIygglqGC8FdyWa1R++CxcMY FTAm+Cyc6E5H3Pxh9r5ZhKNzB8kOGgGHBfdpHh4sOl6YvFKjKKrPmmGiX8l459ktwa7A 4DOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2MsgEH8UOmmaXq9hlueW8ERSGTyNihYMhDAX3WFLX0Q=; b=07QoX3SpDlxXpunbX72NQUcZvNm+7HJtYtf8eXVV0K5PblWrUIAIfYCuAElprd3KwM IkaMDw6Dh18Tdp/qM3/fvU8w9BYI0SWK0WRjVzKPXwG7aY9Wv3SDs3PiHEa/iTNGdssY 4zWJva6vVFQE7avkgu74iefC4dWf/29jDvU4mAh32RkjTmheEvLE+u6S7sXmSTZ9ENjR 5BFmO/L1VNY0y0FgMwuLnus+h/WD+odXTHiuR/jkWWTIYOsfjA12V/npxdmqZg08cahu HZv8uFwGaoAg3iGsozA1kpFWXdlApcyCsgYN5SSEhC+MGbFbbJnrXY1rkCV9KhMQK+p6 yOxw== X-Gm-Message-State: AOAM531oJSacQ5+sUKIru9jkNY19Q1Y5bOF3SB+/YoKq4DcxHwpZMYyp 8QnnOpwYYoYU9wR/Gyy2b5Pfc75PcTA= X-Google-Smtp-Source: ABdhPJxIxmzfq2dlrl1fy6rsp8pBD0ly1xV5cpnJP49Xi/KvPLKDN95+4HVbus0fR1kNOUKYl4LUtA== X-Received: by 2002:a50:ff0e:: with SMTP id a14mr30538359edu.369.1642593762295; Wed, 19 Jan 2022 04:02:42 -0800 (PST) Received: from crow.vmware.com ([95.87.219.163]) by smtp.gmail.com with ESMTPSA id d10sm569491ejt.55.2022.01.19.04.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 04:02:42 -0800 (PST) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org, hongzhan.chen@intel.com, jan.kiszka@siemens.com Cc: "Yordan Karadzhov (VMware)" Subject: [RFC PATCH 2/2] kernel-shark: Install missing headers Date: Wed, 19 Jan 2022 14:02:29 +0200 Message-Id: <20220119120229.68627-3-y.karadz@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220119120229.68627-1-y.karadz@gmail.com> References: <20220119120229.68627-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Building an external plugin that uses libkshark-plot and libkshark-gui libraries haven't been realy tested so far. It turns that headers that are required in order to do this are not installed. The installation of those headers is made part of the 'libkshark-devel' component. Signed-off-by: Yordan Karadzhov (VMware) --- src/CMakeLists.txt | 11 +++++++++++ src/plugins/CMakeLists.txt | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4c26122..3a20458 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -67,6 +67,14 @@ if (OPENGL_FOUND) LIBRARY DESTINATION ${_LIBDIR} COMPONENT kernelshark) + install(FILES "${KS_DIR}/src/stb_truetype.h" + "${KS_DIR}/src/libkshark-plot.h" + "${KS_DIR}/src/KsPlotTools.hpp" + "${KS_DIR}/src/KsPlugins.hpp" + "${KS_DIR}/src/KsCmakeDef.hpp" + DESTINATION ${KS_INCLUDS_DESTINATION} + COMPONENT libkshark-devel) + endif (OPENGL_FOUND) if (Qt5Widgets_FOUND AND Qt5Network_FOUND AND TT_FONT_FILE) @@ -139,6 +147,9 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND AND TT_FONT_FILE) install(PROGRAMS "${KS_DIR}/bin/kshark-su-record" 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) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 3e170fa..e9d9068 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -69,4 +69,8 @@ install(TARGETS ${PLUGIN_LIST} LIBRARY DESTINATION ${KS_PLUGIN_INSTALL_PREFIX} COMPONENT kernelshark) +install(FILES "${KS_DIR}/src/plugins/common_sched.h" + DESTINATION "${KS_INCLUDS_DESTINATION}/plugins" + COMPONENT libkshark-devel) + set(PLUGINS ${PLUGIN_LIST} PARENT_SCOPE)