From febe4e27cc6dc54aaa30f015a283bdf8d6f5569d Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Tue, 20 Oct 2020 07:17:33 -0700 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/kernelshark#88e47722badce39d0ac907633b6455047a29cf95 --- .gitignore | 2 + ...race-cmd-when-only-building-kernelsh.patch | 26 +++++ ...ix-dependency-symbol-resolving-issue.patch | 32 ++++++ ...orary-move-libtraceevent-back-to-_li.patch | 49 ++++++++++ ...cc34f992e87500e96d8f692ce8b6b339cc9a.patch | 98 +++++++++++++++++++ README.md | 3 + kernelshark.appdata.xml | 16 +++ kernelshark.spec | 90 +++++++++++++++++ sources | 1 + 9 files changed, 317 insertions(+) create mode 100644 0001-Do-not-install-trace-cmd-when-only-building-kernelsh.patch create mode 100644 0001-kernel-shark-Fix-dependency-symbol-resolving-issue.patch create mode 100644 0001-kernelshark-Temporary-move-libtraceevent-back-to-_li.patch create mode 100644 64adcc34f992e87500e96d8f692ce8b6b339cc9a.patch create mode 100644 README.md create mode 100644 kernelshark.appdata.xml create mode 100644 kernelshark.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..9b5c093 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/trace-cmd-kernelshark-v1.1.tar.gz +/trace-cmd-kernelshark-v1.2.tar.gz diff --git a/0001-Do-not-install-trace-cmd-when-only-building-kernelsh.patch b/0001-Do-not-install-trace-cmd-when-only-building-kernelsh.patch new file mode 100644 index 0000000..fc67a3b --- /dev/null +++ b/0001-Do-not-install-trace-cmd-when-only-building-kernelsh.patch @@ -0,0 +1,26 @@ +From a0a28e0b5161203c7576a430ca12d11a16a88e74 Mon Sep 17 00:00:00 2001 +From: Zamir SUN +Date: Thu, 24 Sep 2020 21:19:00 +0800 +Subject: [PATCH] Do not install trace-cmd when only building kernelshark + +Signed-off-by: Zamir SUN +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index bbdf15e..a489fe8 100644 +--- a/Makefile ++++ b/Makefile +@@ -338,7 +338,7 @@ install: install_cmd + @echo "Note: to install the gui, type \"make install_gui\"" + @echo " to install man pages, type \"make install_doc\"" + +-install_gui: install_cmd gui ++install_gui: gui + $(Q)$(MAKE) $(S) -C $(kshark-dir)/build install + + install_libs: libs +-- +2.26.2 + diff --git a/0001-kernel-shark-Fix-dependency-symbol-resolving-issue.patch b/0001-kernel-shark-Fix-dependency-symbol-resolving-issue.patch new file mode 100644 index 0000000..5250f0e --- /dev/null +++ b/0001-kernel-shark-Fix-dependency-symbol-resolving-issue.patch @@ -0,0 +1,32 @@ +From afa8362e1b11a892a27e436d13616c7851f6e6d5 Mon Sep 17 00:00:00 2001 +From: Zamir SUN +Date: Thu, 24 Sep 2020 21:13:12 +0800 +Subject: [PATCH] kernel-shark: Fix dependency (symbol resolving) issue + +Backport of +https://lore.kernel.org/linux-trace-devel/20200916065007.9755-4-y.karadz@gmail.com/raw + +Signed-off-by: Zamir SUN +--- + kernel-shark/src/CMakeLists.txt | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt +index e20a030..7b47b92 100644 +--- a/kernel-shark/src/CMakeLists.txt ++++ b/kernel-shark/src/CMakeLists.txt +@@ -7,8 +7,9 @@ add_library(kshark SHARED libkshark.c + libkshark-configio.c + libkshark-collection.c) + +-target_link_libraries(kshark ${TRACEEVENT_LIBRARY} +- ${TRACECMD_LIBRARY} ++target_link_libraries(kshark ${TRACECMD_LIBRARY} ++ ${TRACEFS_LIBRARY} ++ ${TRACEEVENT_LIBRARY} + ${JSONC_LIBRARY} + ${CMAKE_DL_LIBS}) + +-- +2.26.2 + diff --git a/0001-kernelshark-Temporary-move-libtraceevent-back-to-_li.patch b/0001-kernelshark-Temporary-move-libtraceevent-back-to-_li.patch new file mode 100644 index 0000000..dc38f02 --- /dev/null +++ b/0001-kernelshark-Temporary-move-libtraceevent-back-to-_li.patch @@ -0,0 +1,49 @@ +From b90d567d467778eb7d9142788cc7061b9cdff7fa Mon Sep 17 00:00:00 2001 +From: Zamir SUN +Date: Mon, 12 Oct 2020 21:52:09 +0800 +Subject: [PATCH] kernelshark: Temporary move libtraceevent back to + %{_libdir}/trace-cmd + +Signed-off-by: Zamir SUN +--- + Makefile | 4 ++-- + kernel-shark/CMakeLists.txt | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index b034042..a02d1c2 100644 +--- a/Makefile ++++ b/Makefile +@@ -68,7 +68,7 @@ plugin_tracecmd_dir = $(libdir)/trace-cmd/plugins + python_dir ?= $(libdir)/traceevent/python + var_dir = $(HOME)/.trace-cmd/ + else +-plugin_traceevent_dir = $(libdir)/traceevent/plugins ++plugin_traceevent_dir = $(libdir)/trace-cmd/plugins + python_dir ?= $(libdir)/trace-cmd/python + PLUGIN_DIR_TRACEEVENT = -DPLUGIN_TRACEEVENT_DIR="$(plugin_traceevent_dir)" + PLUGIN_DIR_TRACECMD = -DPLUGIN_TRACECMD_DIR="$(plugin_tracecmd_dir)" +@@ -407,7 +407,7 @@ install: install_cmd + @echo "Note: to install the gui, type \"make install_gui\"" + @echo " to install man pages, type \"make install_doc\"" + +-install_gui: install_cmd gui ++install_gui: gui + $(Q)$(MAKE) $(S) -C $(kshark-dir)/build install + + install_libs: libs +diff --git a/kernel-shark/CMakeLists.txt b/kernel-shark/CMakeLists.txt +index c95249e..213f777 100644 +--- a/kernel-shark/CMakeLists.txt ++++ b/kernel-shark/CMakeLists.txt +@@ -79,6 +79,7 @@ endif (CMAKE_BUILD_TYPE MATCHES Package) + + include_directories(${KS_DIR}/src/ + ${KS_DIR}/build/src/ ++ ${TRACEEVENT_LIBRARY} + ${JSONC_INCLUDE_DIR} + ${TRACECMD_INCLUDE_DIR} + ${TRACEFS_INCLUDE_DIR}) +-- +2.26.2 + diff --git a/64adcc34f992e87500e96d8f692ce8b6b339cc9a.patch b/64adcc34f992e87500e96d8f692ce8b6b339cc9a.patch new file mode 100644 index 0000000..0b81177 --- /dev/null +++ b/64adcc34f992e87500e96d8f692ce8b6b339cc9a.patch @@ -0,0 +1,98 @@ +From 64adcc34f992e87500e96d8f692ce8b6b339cc9a Mon Sep 17 00:00:00 2001 +From: "Ziqian SUN (Zamir)" +Date: Fri, 21 Feb 2020 21:57:13 +0800 +Subject: KernelShark: Inherit libdir from Makefile + +The trace-cmd makefile supports install lib into a different name like +lib64. Now this patch implemented the same in kernel-shark. + +Link: http://lore.kernel.org/linux-trace-devel/20200221135713.323958-1-sztsian@gmail.com + +Reviewed-by: Yordan Karadzhov (VMware) +Signed-off-by: Ziqian SUN (Zamir) +Signed-off-by: Steven Rostedt (VMware) +--- + Makefile | 2 +- + kernel-shark/CMakeLists.txt | 8 ++++++-- + kernel-shark/src/CMakeLists.txt | 6 +++--- + 3 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index a3facaa..2f9620e 100644 +--- a/Makefile ++++ b/Makefile +@@ -297,7 +297,7 @@ CMAKE_COMMAND = /usr/bin/cmake + BUILD_TYPE ?= RelWithDebInfo + + $(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt +- $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -D_INSTALL_PREFIX=$(prefix) .. ++ $(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -D_INSTALL_PREFIX=$(prefix) -D_LIBDIR=$(libdir) .. + + gui: force $(CMD_TARGETS) $(kshark-dir)/build/Makefile + $(Q)$(MAKE) $(S) -C $(kshark-dir)/build +diff --git a/kernel-shark/CMakeLists.txt b/kernel-shark/CMakeLists.txt +index 8786b83..1c9ac2e 100644 +--- a/kernel-shark/CMakeLists.txt ++++ b/kernel-shark/CMakeLists.txt +@@ -17,6 +17,10 @@ if (NOT _INSTALL_PREFIX) + set(_INSTALL_PREFIX "/usr/local") + endif (NOT _INSTALL_PREFIX) + ++if (NOT _LIBDIR) ++ set(_LIBDIR "${_INSTALL_PREFIX}/lib") ++endif (NOT _LIBDIR) ++ + include(${KS_DIR}/build/FindTraceCmd.cmake) + include(${KS_DIR}/build/FindJSONC.cmake) + +@@ -54,14 +58,14 @@ if (NOT CMAKE_CXX_FLAGS_PACKAGE) + set(CMAKE_CXX_FLAGS_PACKAGE "-O3") + endif (NOT CMAKE_CXX_FLAGS_PACKAGE) + +-set(KS_PLUGIN_INSTALL_PREFIX ${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/plugins/) ++set(KS_PLUGIN_INSTALL_PREFIX ${_LIBDIR}/${KS_APP_NAME}/plugins/) + + set(KS_ICON KS_icon_shark.svg) + set(KS_ICON_FIN KS_icon_fin.svg) + set(KS_LOGO KS_logo_symbol.svg) + set(KS_LOGO_LABEL KS_logo_horizontal.svg) + +-set(CMAKE_INSTALL_RPATH "${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/") ++set(CMAKE_INSTALL_RPATH "${_LIBDIR}/${KS_APP_NAME}/") + + if (CMAKE_BUILD_TYPE MATCHES Package) + +diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt +index 33b5db8..9666b18 100644 +--- a/kernel-shark/src/CMakeLists.txt ++++ b/kernel-shark/src/CMakeLists.txt +@@ -15,7 +15,7 @@ target_link_libraries(kshark ${TRACEEVENT_LIBRARY} + + set_target_properties(kshark PROPERTIES SUFFIX ".so.${KS_VERSION_STRING}") + +-install(TARGETS kshark LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME}) ++install(TARGETS kshark LIBRARY DESTINATION ${_LIBDIR}/${KS_APP_NAME}) + + if (OPENGL_FOUND AND GLUT_FOUND) + +@@ -29,7 +29,7 @@ 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}) ++ install(TARGETS kshark-plot LIBRARY DESTINATION ${_LIBDIR}/${KS_APP_NAME}) + + endif (OPENGL_FOUND AND GLUT_FOUND) + +@@ -85,7 +85,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND) + + install(TARGETS ${KS_APP_NAME} kshark-record kshark-gui + RUNTIME DESTINATION ${_INSTALL_PREFIX}/bin/ +- LIBRARY DESTINATION ${_INSTALL_PREFIX}/lib/${KS_APP_NAME}/) ++ LIBRARY DESTINATION ${_LIBDIR}/${KS_APP_NAME}/) + + install(FILES "${KS_DIR}/${KS_APP_NAME}.desktop" + DESTINATION ${_INSTALL_PREFIX}/share/applications/) +-- +cgit 1.2.3-1.el7 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..0945edf --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# kernelshark + +The kernelshark package diff --git a/kernelshark.appdata.xml b/kernelshark.appdata.xml new file mode 100644 index 0000000..2180ef7 --- /dev/null +++ b/kernelshark.appdata.xml @@ -0,0 +1,16 @@ + + + kernelshark.desktop + GPL-2.0+ + GPL-2.0 and LGPL-2.0 + kernelsharl + GUI analysis for Ftrace data captured by trace-cmd + +

+KernelShark is a front end reader of trace-cmd output. "trace-cmd record" and "trace-cmd extract" create a trace.dat (trace-cmd.dat) file. kernelshark can read this file and produce a graph and list view of its data. +

+
+ https://kernelshark.org/ +
+ + diff --git a/kernelshark.spec b/kernelshark.spec new file mode 100644 index 0000000..a5485e5 --- /dev/null +++ b/kernelshark.spec @@ -0,0 +1,90 @@ +Name: kernelshark +Version: 1.2 +Release: 1%{?dist} + +# As of 1.1, only kernelshark.cpp, kshark-record.cpp and examples are GPL-2.0. The rest of kernel-shark is LGPL-2.1. +# See SPDX identifier for most accurate info +License: GPLv2 and LGPLv2 +Summary: GUI analysis for Ftrace data captured by trace-cmd + +URL: https://kernelshark.org +Source0: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/trace-cmd-kernelshark-v%{version}.tar.gz +Source1: %{name}.appdata.xml + +Patch0: 0001-kernelshark-Temporary-move-libtraceevent-back-to-_li.patch +BuildRequires: cmake +BuildRequires: desktop-file-utils +BuildRequires: doxygen +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: graphviz +BuildRequires: libappstream-glib +BuildRequires: pkgconf +BuildRequires: pkgconfig(glut) +BuildRequires: pkgconfig(json-c) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(Qt5Core) +# Force dependency release < 20 so that when libtraceevent is out we can force an update by bumping trace-cmd version. +BuildRequires: trace-cmd-devel >= 2.9.1-3 +BuildRequires: trace-cmd-devel < 2.9.1-20 +BuildRequires: trace-cmd-libs >= 2.9.1-3 +BuildRequires: trace-cmd-libs < 2.9.1-20 +BuildRequires: xmlto +Requires: polkit + + +%description +KernelShark is a front end reader of trace-cmd output. "trace-cmd +record" and "trace-cmd extract" create a trace.dat (trace-cmd.dat) +file. kernelshark can read this file and produce a graph and list +view of its data. + +%prep +%setup -q -n trace-cmd-%{name}-v%{version} +%patch0 -p1 +#%patch1 -p1 +#%patch2 -p1 +#%patch3 -p1 + +%build +# MANPAGE_DOCBOOK_XSL define is hack to avoid using locate +# -z muldefs to workaround the enforcing multi definition check of gcc10. +# and it need to be removed once upstream fixed the variable name +# Do not use parallel compile because it makes compiling fail +MANPAGE_DOCBOOK_XSL=`rpm -ql docbook-style-xsl | grep manpages/docbook.xsl` +CFLAGS="%{optflags} -D_GNU_SOURCE" LDFLAGS="%{build_ldflags} -z muldefs" BUILD_TYPE=Release \ + make -p V=9999999999 MANPAGE_DOCBOOK_XSL=$MANPAGE_DOCBOOK_XSL \ + prefix=%{_prefix} libdir=%{_libdir} gui + +%install +make libdir=%{_libdir} prefix=%{_prefix} V=1 DESTDIR=%{buildroot}/ CFLAGS="%{optflags} -D_GNU_SOURCE" LDFLAGS="%{build_ldflags} -z muldefs " BUILD_TYPE=Release install_gui +find %{buildroot}%{_datadir} -type f | xargs chmod u-x,g-x,o-x +find %{buildroot}%{_libdir} -type f -iname "*.so" | xargs chmod 0755 +sed -i '/Version/d' %{buildroot}/%{_datadir}/applications/kernelshark.desktop +desktop-file-validate %{buildroot}/%{_datadir}/applications/kernelshark.desktop +mkdir -p %{buildroot}%{_metainfodir}/ +cp %{SOURCE1} %{buildroot}%{_metainfodir}/ +appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml + +%files +%license COPYING +%doc COPYING.LIB README +%{_bindir}/kernelshark +%{_bindir}/kshark-record +%{_bindir}/kshark-su-record +%dir %{_libdir}/kernelshark +%{_libdir}/kernelshark/* +%{_datadir}/applications/kernelshark.desktop +%dir %{_datadir}/icons/kernelshark +%{_datadir}/icons/kernelshark/* +%{_datadir}/polkit-1/actions/org.freedesktop.kshark-record.policy +%{_metainfodir}/%{name}.appdata.xml + +%changelog +* Mon Oct 12 2020 Zamir SUN - 1.2-1 +- Update to 1.2 +- Uses trace event plugins from old trace-cmd dir + +* Thu Sep 24 2020 Zamir SUN - 1.1-1 +- Package kernelshark in a standalone package with 1.1 + diff --git a/sources b/sources new file mode 100644 index 0000000..4ff05fc --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (trace-cmd-kernelshark-v1.2.tar.gz) = 059ac0ced71fa00de34c30ece433430f1e2fc36acb1b3a3f15cb84ce74d7a4f115e4ee8fbf9a256d5a731050aee02823a90a024dca4b4f6a17061652b871b935