From patchwork Thu May 30 13:15:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10968705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6928A14C0 for ; Thu, 30 May 2019 13:16:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BED3287E0 for ; Thu, 30 May 2019 13:16:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EF56287E6; Thu, 30 May 2019 13:16:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E046F289FA for ; Thu, 30 May 2019 13:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726328AbfE3NQZ (ORCPT ); Thu, 30 May 2019 09:16:25 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:50364 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbfE3NQZ (ORCPT ); Thu, 30 May 2019 09:16:25 -0400 Received: by mail-wm1-f65.google.com with SMTP id f204so3974050wme.0 for ; Thu, 30 May 2019 06:16:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RlPSX2f46myCSZN6xZyY1xUFxQFevAdG7+SpzfBhUK0=; b=q1LxMTYJpdhsIPFYUbGTNmG0b6sDIeKBTlH4bcw9MZwvuOn5TuOBnTHyFoW+k5xHOp 3i7hiCQqRh6aPl7iuZu0oCUh/VZ8te3X4wXe+ecAC1zb/YhSGLt3LFHxLAup32GP1scp lNC2U6A+Wd8NijDS9LrHJULJiGLZtu+tpnjSNolYOdb1VrVRog8McV78kEVTdQcdCnPG 5D1BTHrhejy8MPxriTqrk5ZKsaRiXJu75/BxfYX0xP30XOjJ8HGE+h34jo3fgmTojY/Z WO598R8uEiQDrKwzkDSUvuxbc0rXyUVjIbnF567mc7mGA67pp1rH9fLT2qey3Tsaru6A /zbg== X-Gm-Message-State: APjAAAWarP/v+LFJOEdVsMGwKknA4bhCBNWX97JkhulqAtDOI5w9f222 tc4INh9/bxEQ379fs+4za7Y= X-Google-Smtp-Source: APXvYqzO92KwYkah/TiQmlTTph1bYYnhCGfq/5rBNEopI1L/UIt12HX8IWajg1AVQcEEG5qajnkruQ== X-Received: by 2002:a1c:a7ca:: with SMTP id q193mr2418117wme.150.1559222183424; Thu, 30 May 2019 06:16:23 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id q15sm2334874wrr.19.2019.05.30.06.16.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 30 May 2019 06:16:23 -0700 (PDT) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, Yordan Karadzhov Subject: [PATCH 1/2] trace-cmd: Install public interface headers Date: Thu, 30 May 2019 16:15:55 +0300 Message-Id: <20190530131556.21832-2-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190530131556.21832-1-ykaradzhov@vmware.com> References: <20190530131556.21832-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Installing the header files included in the public interfaces of the trace-cmd libraries will make possible the libraries to be used for development. Signed-off-by: Yordan Karadzhov --- Makefile | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index cde45f8..ac514b1 100644 --- a/Makefile +++ b/Makefile @@ -49,10 +49,18 @@ html_install = $(prefix)/share/kernelshark/html html_install_SQ = '$(subst ','\'',$(html_install))' img_install = $(prefix)/share/kernelshark/html/images img_install_SQ = '$(subst ','\'',$(img_install))' -libdir ?= $(prefix)/lib -libdir_SQ = '$(subst ','\'',$(libdir))' -includedir = $(prefix)/include/trace-cmd -includedir_SQ = '$(subst ','\'',$(includedir))' + +tcmd_libdir ?= $(prefix)/lib/trace-cmd +tcmd_libdir_SQ = '$(subst ','\'',$(tcmd_libdir))' + +tevt_libdir ?= $(prefix)/lib/traceevent +tevt_libdir_SQ = '$(subst ','\'',$(tevt_libdir))' + +tcmd_includedir = $(prefix)/include/trace-cmd +tcmd_includedir_SQ = '$(subst ','\'',$(tcmd_includedir))' + +tevt_includedir = $(prefix)/include/traceevent +tevt_includedir_SQ = '$(subst ','\'',$(tevt_includedir))' export man_dir man_dir_SQ html_install html_install_SQ INSTALL export img_install img_install_SQ @@ -335,10 +343,12 @@ install_gui: install_cmd gui $(Q)$(MAKE) $(S) -C $(kshark-dir)/build install install_libs: libs - $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)) - $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)) - $(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(includedir_SQ)) - $(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)) + $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(tcmd_libdir_SQ)) + $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(tevt_libdir_SQ)) + $(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(tevt_includedir_SQ)) + $(Q)$(call do_install,$(src)/include/traceevent/trace-seq.h,$(tevt_includedir_SQ)) + $(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(tcmd_includedir_SQ)) + $(Q)$(call do_install,$(src)/include/trace-cmd/trace-filter-hash.h,$(tcmd_includedir_SQ)) doc: $(MAKE) -C $(src)/Documentation all From patchwork Thu May 30 13:15:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10968707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D9E814C0 for ; Thu, 30 May 2019 13:16:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FF3628672 for ; Thu, 30 May 2019 13:16:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 042E128739; Thu, 30 May 2019 13:16:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A5F3287E6 for ; Thu, 30 May 2019 13:16:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725919AbfE3NQ1 (ORCPT ); Thu, 30 May 2019 09:16:27 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36444 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbfE3NQ1 (ORCPT ); Thu, 30 May 2019 09:16:27 -0400 Received: by mail-wr1-f66.google.com with SMTP id n4so1145958wrs.3 for ; Thu, 30 May 2019 06:16:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ahYYgWHBx2oqLxCL5qOzCwcIs7KGU3jYSe5NcrYtC4o=; b=Suq4HTr9I5xwk/xFXrZNgl8GIydM4oDZTDucEMrOdQ1cB1H0JgBv2A1ws6iB7f22ZJ fPCiQ2Y2gVRyG1KK2DfAn8MRSJ7HmTGr22w1YiNjuSfIaDlzxuANn0+PHhh3i0zJWDc3 Qi7138m2pSQVTPZYzGS/768GNJKWL62unYWtuE4Dh40Gi9LCwQqXYsBN6zWeKtFzFpeA 9ICHBE7Vn6NwkzB6NDMvXntYFAJtkIynSEOaUA6wCfbenRX5pN3UJax+zF3MXNCGbVTi UrZAuXG3t8asJ73VyIyFM/Q/fD1+Wd040u0pFHPpzQ7wnv13vXmi6LeqEBax8xKR3RWe 7yiA== X-Gm-Message-State: APjAAAX2m7uHcjDCTYjiVtUovalwEKPfjiu+CWeRkNI37lHZD5W33hpF 2KiFVOM+mPTLaKlU4uUG9TTded7y X-Google-Smtp-Source: APXvYqwf5WTKSEykxz7Ro7ul6vVJZ4p5yGCD7Jfj6YkiT1IDnj4EHPt0o+Xh7bbBICovLApQkH3fFQ== X-Received: by 2002:adf:fbc7:: with SMTP id d7mr2449788wrs.224.1559222184766; Thu, 30 May 2019 06:16:24 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id q15sm2334874wrr.19.2019.05.30.06.16.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 30 May 2019 06:16:24 -0700 (PDT) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, Yordan Karadzhov Subject: [PATCH 2/2] kernel-shark: Install public interface headers Date: Thu, 30 May 2019 16:15:56 +0300 Message-Id: <20190530131556.21832-3-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190530131556.21832-1-ykaradzhov@vmware.com> References: <20190530131556.21832-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Installing the header files included in the public interfaces of the KernelShark libraries will make possible the libraries to be used for development. A symbolic link that points to the latest versions of the libraries is added to INSTALL_PREFIX/lib/kernelshark Signed-off-by: Yordan Karadzhov --- kernel-shark/README | 4 ++ kernel-shark/src/CMakeLists.txt | 56 ++++++++++++++++++++++--- kernel-shark/src/plugins/CMakeLists.txt | 3 +- 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/kernel-shark/README b/kernel-shark/README index 379c390..573e279 100644 --- a/kernel-shark/README +++ b/kernel-shark/README @@ -44,6 +44,10 @@ as a CMake Command-Line option. 2.1.3 By default, installation prefix is "/usr/local". It can be changed using -D_INSTALL_PREFIX= as a CMake Command-Line option. +2.1.4 In order to install a development version (including headers e.t.c) add +-D_DEVEL=1 as a CMake Command-Line option. + + Example: cmake -D_DOXYGEN_DOC=1 -D_DEBUG=1 -D_INSTALL_PREFIX=/usr ../ diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt index 6cbc00f..36ce884 100644 --- a/kernel-shark/src/CMakeLists.txt +++ b/kernel-shark/src/CMakeLists.txt @@ -1,5 +1,13 @@ message("\n src ...") +macro(install_symlink filepath sympath) + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${filepath} ${sympath})") + install(CODE "LIST(APPEND CMAKE_INSTALL_MANIFEST_FILES ${sympath})") + install(CODE "message(\"-- Created symlink: ${sympath} -> ${filepath}\")") +endmacro(install_symlink) + +set(KS_INCLUDS_DESTINATION "${_INSTALL_PREFIX}/include/${KS_APP_NAME}") + message(STATUS "libkshark") add_library(kshark SHARED libkshark.c libkshark-model.c @@ -14,6 +22,22 @@ target_link_libraries(kshark ${CMAKE_DL_LIBS} set_target_properties(kshark PROPERTIES SUFFIX ".so.${KS_VERSION_STRING}") +install(TARGETS kshark LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME} + COMPONENT core) + +if (_DEVEL) + + install_symlink("libkshark.so.${KS_VERSION_STRING}" + "${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/libkshark.so") + + install(FILES "${KS_DIR}/src/libkshark.h" + "${KS_DIR}/src/libkshark-plugin.h" + "${KS_DIR}/src/libkshark-model.h" + DESTINATION ${KS_INCLUDS_DESTINATION} + COMPONENT devel) + +endif (_DEVEL) + if (OPENGL_FOUND AND GLUT_FOUND) message(STATUS "libkshark-plot") @@ -26,6 +50,21 @@ if (OPENGL_FOUND AND GLUT_FOUND) set_target_properties(kshark-plot PROPERTIES SUFFIX ".so.${KS_VERSION_STRING}") + install(TARGETS kshark-plot LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME} + COMPONENT core) + + if (_DEVEL) + + install_symlink("libkshark-plot.so.${KS_VERSION_STRING}" + "${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/libkshark-plot.so") + + install(FILES "${KS_DIR}/src/KsPlotTools.hpp" + "${KS_DIR}/src/libkshark-plot.h" + DESTINATION ${KS_INCLUDS_DESTINATION} + COMPONENT devel) + + endif (_DEVEL) + endif (OPENGL_FOUND AND GLUT_FOUND) if (Qt5Widgets_FOUND AND Qt5Network_FOUND) @@ -77,21 +116,26 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND) add_executable(kshark-record kshark-record.cpp) target_link_libraries(kshark-record kshark-gui) - install(TARGETS ${KS_APP_NAME} kshark-record kshark kshark-plot kshark-gui + install(TARGETS ${KS_APP_NAME} kshark-record kshark-gui RUNTIME DESTINATION ${_INSTALL_PREFIX}/bin/ - LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/) + LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME} + COMPONENT core) install(FILES "${KS_DIR}/${KS_APP_NAME}.desktop" - DESTINATION ${_INSTALL_PREFIX}/share/applications/) + DESTINATION ${_INSTALL_PREFIX}/share/applications/ + COMPONENT core) install(FILES "${KS_DIR}/icons/${KS_ICON}" - DESTINATION ${_INSTALL_PREFIX}/share/icons/${KS_APP_NAME}) + DESTINATION ${_INSTALL_PREFIX}/share/icons/${KS_APP_NAME} + COMPONENT core) install(FILES "${KS_DIR}/org.freedesktop.kshark-record.policy" - DESTINATION ${_INSTALL_PREFIX}/share/polkit-1/actions/) + DESTINATION ${_INSTALL_PREFIX}/share/polkit-1/actions/ + COMPONENT core) install(PROGRAMS "${KS_DIR}/bin/kshark-su-record" - DESTINATION ${_INSTALL_PREFIX}/bin/) + DESTINATION ${_INSTALL_PREFIX}/bin/ + COMPONENT core) endif (Qt5Widgets_FOUND AND Qt5Network_FOUND) diff --git a/kernel-shark/src/plugins/CMakeLists.txt b/kernel-shark/src/plugins/CMakeLists.txt index 6c77179..51f6f65 100644 --- a/kernel-shark/src/plugins/CMakeLists.txt +++ b/kernel-shark/src/plugins/CMakeLists.txt @@ -28,6 +28,7 @@ BUILD_PLUGIN(NAME missed_events list(APPEND PLUGIN_LIST "missed_events default") # This plugin will be loaded by default install(TARGETS sched_events missed_events - LIBRARY DESTINATION ${KS_PLUGIN_INSTALL_PREFIX}) + LIBRARY DESTINATION ${KS_PLUGIN_INSTALL_PREFIX} + COMPONENT core) set(PLUGINS ${PLUGIN_LIST} PARENT_SCOPE)