git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #137584 from wentasah/kernelshark

kernelshark: 1.2 → 2.0.1 (and related updates: trace-cmd, ...)

commit477e740ce53ac35a1147ed8916fdba63280a8bb3 authorMaximilian Bosch <maximilian@mbosch.me> dateSat 23 Oct 2021, 23:23 (5 years ago) parent5d49910393fc1f
7 files changed+121−66
maintainers/maintainer-list.nix+6 pkgs/os-specific/linux/libtraceevent/default.nix+37 pkgs/os-specific/linux/libtracefs/default.nix+38 pkgs/os-specific/linux/trace-cmd/default.nix+21−7 pkgs/os-specific/linux/trace-cmd/fix-Makefiles.patch−35 pkgs/os-specific/linux/trace-cmd/kernelshark.nix+15−24 pkgs/top-level/all-packages.nix+4
maintainers/maintainer-list.nix+6
@@ -12077,6 +12077,12 @@
1207712077 fingerprint = "2145 955E 3F5E 0C95 3458 41B5 11F7 BAEA 8567 43FF";
1207812078 }];
1207912079 };
12080+ wentasah = {
12081+ name = "Michal Sojka";
12082+ email = "wsh@2x.cz";
12083+ github = "wentasah";
12084+ githubId = 140542;
12085+ };
1208012086 wheelsandmetal = {
1208112087 email = "jakob@schmutz.co.uk";
1208212088 github = "wheelsandmetal";
pkgs/os-specific/linux/libtraceevent/default.nixnew file+37
@@ -0,0 +1,37 @@
1+{ lib, stdenv, fetchgit, pkg-config, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "libtraceevent";
5+ version = "1.4.0";
6+
7+ src = fetchgit {
8+ url = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git";
9+ rev = "libtraceevent-${version}";
10+ sha256 = "1x36qsrcssjywjpwkgyp9hz6y878kivma9pz7zrhxdsrqv2d2zs1";
11+ };
12+
13+ # Don't build and install html documentation
14+ postPatch = ''
15+ sed -i -e '/^all:/ s/html//' -e '/^install:/ s/install-html//' Documentation/Makefile
16+ '';
17+
18+ outputs = [ "out" "dev" "devman" ];
19+ enableParallelBuilding = true;
20+ nativeBuildInputs = [ pkg-config asciidoc xmlto docbook_xml_dtd_45 docbook_xsl ];
21+ makeFlags = [
22+ "prefix=${placeholder "out"}"
23+ "doc" # build docs
24+ ];
25+ installFlags = [
26+ "pkgconfig_dir=${placeholder "out"}/lib/pkgconfig"
27+ "doc-install"
28+ ];
29+
30+ meta = with lib; {
31+ description = "Linux kernel trace event library";
32+ homepage = "https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/";
33+ license = licenses.lgpl21Only;
34+ platforms = platforms.linux;
35+ maintainers = with maintainers; [ wentasah ];
36+ };
37+}
pkgs/os-specific/linux/libtracefs/default.nixnew file+38
@@ -0,0 +1,38 @@
1+{ lib, stdenv, fetchgit, pkg-config, libtraceevent, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "libtracefs";
5+ version = "1.2.5";
6+
7+ src = fetchgit {
8+ url = "git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git";
9+ rev = "libtracefs-${version}";
10+ sha256 = "1rva9ysspf1wqd0zf52qwgpaasrn7jcbns4dwldc59ksk0n93qdb";
11+ };
12+
13+ # Don't build and install html documentation
14+ postPatch = ''
15+ sed -i -e '/^all:/ s/html//' -e '/^install:/ s/install-html//' Documentation/Makefile
16+ '';
17+
18+ outputs = [ "out" "dev" "devman" ];
19+ enableParallelBuilding = true;
20+ nativeBuildInputs = [ pkg-config asciidoc xmlto docbook_xml_dtd_45 docbook_xsl ];
21+ buildInputs = [ libtraceevent ];
22+ makeFlags = [
23+ "prefix=${placeholder "out"}"
24+ "doc" # build docs
25+ ];
26+ installFlags = [
27+ "pkgconfig_dir=${placeholder "out"}/lib/pkgconfig"
28+ "install_doc"
29+ ];
30+
31+ meta = with lib; {
32+ description = "Linux kernel trace file system library";
33+ homepage = "https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/";
34+ license = licenses.lgpl21Only;
35+ platforms = platforms.linux;
36+ maintainers = with maintainers; [ wentasah ];
37+ };
38+}
pkgs/os-specific/linux/trace-cmd/default.nix+21−7
@@ -1,17 +1,23 @@
1−{ lib, stdenv, fetchgit, asciidoc, docbook_xsl, libxslt }:
1+{ lib, stdenv, fetchgit, pkg-config, asciidoc, xmlto, docbook_xsl, libxslt, libtraceevent, libtracefs }:
22stdenv.mkDerivation rec {
33 pname = "trace-cmd";
4− version = "2.9.1";
4+ version = "2.9.5";
55
66 src = fetchgit {
77 url = "git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/";
88 rev = "trace-cmd-v${version}";
9− sha256 = "19c63a0qmcppm1456qf4k6a0d1agcvpa6jnbzrdcyc520yax6khw";
9+ sha256 = "0kc5cldk5i7q2zr2nyz3mvs5v7w0km6lpx7g39sy3pmhshp0wqlq";
1010 };
1111
12− patches = [ ./fix-Makefiles.patch ];
12+ # Don't build and install html documentation
13+ postPatch = ''
14+ sed -i -e '/^all:/ s/html//' -e '/^install:/ s/install-html//' \
15+ Documentation{,/trace-cmd,/libtracecmd}/Makefile
16+ '';
1317
14− nativeBuildInputs = [ asciidoc libxslt ];
18+ nativeBuildInputs = [ asciidoc libxslt pkg-config xmlto ];
19+
20+ buildInputs = [ libtraceevent libtracefs ];
1521
1622 outputs = [ "out" "lib" "dev" "man" ];
1723
@@ -19,20 +25,28 @@ stdenv.mkDerivation rec {
1925
2026 dontConfigure = true;
2127
22− buildPhase = "make trace-cmd libs doc";
28+ enableParallelBuilding = true;
29+ makeFlags = [
30+ "all" "libs" "doc"
31+ # The following values appear in the generated .pc file
32+ "prefix=${placeholder "lib"}"
33+ "libdir=${placeholder "lib"}/lib"
34+ "includedir=${placeholder "dev"}/include"
35+ ];
2336
2437 installTargets = [ "install_cmd" "install_libs" "install_doc" ];
2538 installFlags = [
2639 "bindir=${placeholder "out"}/bin"
2740 "man_dir=${placeholder "man"}/share/man"
2841 "libdir=${placeholder "lib"}/lib"
42+ "pkgconfig_dir=${placeholder "lib"}/lib/pkgconfig"
2943 "includedir=${placeholder "dev"}/include"
3044 "BASH_COMPLETE_DIR=${placeholder "out"}/share/bash-completion/completions"
3145 ];
3246
3347 meta = with lib; {
3448 description = "User-space tools for the Linux kernel ftrace subsystem";
35− homepage = "https://kernelshark.org/";
49+ homepage = "https://www.trace-cmd.org/";
3650 license = licenses.gpl2;
3751 platforms = platforms.linux;
3852 maintainers = with maintainers; [ thoughtpolice basvandijk ];
pkgs/os-specific/linux/trace-cmd/fix-Makefiles.patchdeleted−35
@@ -1,35 +0,0 @@
1−diff --git a/Makefile b/Makefile
2−index b034042..b8a06bc 100644
3−--- a/Makefile
4−+++ b/Makefile
5−@@ -338,6 +338,7 @@ libtracefs.a: $(LIBTRACEFS_STATIC)
6− libtracefs.so: $(LIBTRACEFS_SHARED)
7−
8− libs: $(LIBTRACECMD_SHARED) $(LIBTRACEEVENT_SHARED) $(LIBTRACEFS_SHARED)
9−+libs: $(LIBTRACECMD_STATIC) $(LIBTRACEEVENT_STATIC) $(LIBTRACEFS_STATIC)
10−
11− test: force $(LIBTRACEEVENT_STATIC) $(LIBTRACEFS_STATIC) $(LIBTRACECMD_STATIC)
12− ifneq ($(CUNIT_INSTALLED),1)
13−@@ -414,6 +415,9 @@ install_libs: libs
14− $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)/trace-cmd)
15− $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)/traceevent)
16− $(Q)$(call do_install,$(LIBTRACEFS_SHARED),$(libdir_SQ)/tracefs)
17−+ $(Q)$(call do_install,$(LIBTRACECMD_STATIC),$(libdir_SQ)/trace-cmd)
18−+ $(Q)$(call do_install,$(LIBTRACEEVENT_STATIC),$(libdir_SQ)/traceevent)
19−+ $(Q)$(call do_install,$(LIBTRACEFS_STATIC),$(libdir_SQ)/tracefs)
20− $(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(includedir_SQ)/traceevent)
21− $(Q)$(call do_install,$(src)/include/traceevent/trace-seq.h,$(includedir_SQ)/traceevent)
22− $(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)/trace-cmd)
23−diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt
24−index 457c100..687e150 100644
25−--- a/kernel-shark/src/CMakeLists.txt
26−+++ b/kernel-shark/src/CMakeLists.txt
27−@@ -92,7 +92,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
28− DESTINATION ${_INSTALL_PREFIX}/share/icons/${KS_APP_NAME})
29−
30− install(FILES "${KS_DIR}/org.freedesktop.kshark-record.policy"
31−- DESTINATION /usr/share/polkit-1/actions/)
32−+ DESTINATION ${_INSTALL_PREFIX}/share/polkit-1/actions/)
33−
34− install(PROGRAMS "${KS_DIR}/bin/kshark-su-record"
35− DESTINATION ${_INSTALL_PREFIX}/bin/)
pkgs/os-specific/linux/trace-cmd/kernelshark.nix+15−24
@@ -1,40 +1,31 @@
1−{ lib, mkDerivation, fetchgit, qtbase, cmake, asciidoc, docbook_xsl, json_c, mesa_glu, freeglut, trace-cmd, pkg-config }:
1+{ lib, mkDerivation, fetchgit, qtbase, cmake, asciidoc
2+, docbook_xsl, json_c, mesa_glu, freeglut, trace-cmd, pkg-config
3+, libtraceevent, libtracefs, freefont_ttf
4+}:
5+
26mkDerivation rec {
37 pname = "kernelshark";
4− version = "1.2";
8+ version = "2.0.2";
59
610 src = fetchgit {
7− url = "git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/";
8− rev = "kernelshark-v${version}";
9− sha256 = "0wzzm2imk9n94v96v6sbvbff6j47lz4qj0snhiyv3nj3slg0anvh";
11+ url = "https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/";
12+ rev = "kernelshark-v${version}";
13+ sha256 = "0vy5wa1kccrxr973l870jy5hl6lac7sk3zyg3hxrwmivin1yf0cv";
1014 };
1115
12− patches = [ ./fix-Makefiles.patch ];
13−
14− outputs = [ "out" "doc" ];
16+ outputs = [ "out" ];
1517
16− preConfigure = "pushd kernel-shark";
18+ nativeBuildInputs = [ pkg-config cmake ];
1719
18− nativeBuildInputs = [ pkg-config cmake asciidoc ];
19−
20− buildInputs = [ qtbase json_c mesa_glu freeglut ];
20+ buildInputs = [ qtbase json_c mesa_glu freeglut libtraceevent libtracefs trace-cmd ];
2121
2222 cmakeFlags = [
2323 "-D_INSTALL_PREFIX=${placeholder "out"}"
24− "-DTRACECMD_BIN_DIR=${trace-cmd}/bin"
25− "-DTRACECMD_INCLUDE_DIR=${trace-cmd.dev}/include"
26− "-DTRACECMD_LIBRARY=${trace-cmd.lib}/lib/trace-cmd/libtracecmd.a"
27− "-DTRACEEVENT_LIBRARY=${trace-cmd.lib}/lib/traceevent/libtraceevent.a"
28− "-DTRACEFS_LIBRARY=${trace-cmd.lib}/lib/tracefs/libtracefs.a"
24+ "-D_POLKIT_INSTALL_PREFIX=${placeholder "out"}"
25+ "-DPKG_CONGIG_DIR=${placeholder "out"}/lib/pkgconfig"
26+ "-DTT_FONT_FILE=${freefont_ttf}/share/fonts/truetype/FreeSans.ttf"
2927 ];
3028
31− preInstall = ''
32− popd
33− make install_doc_gui prefix=$doc \
34− FIND_MANPAGE_DOCBOOK_XSL=${docbook_xsl}/share/xml/docbook-xsl-nons/manpages/docbook.xsl
35− pushd kernel-shark/build
36− '';
37−
3829 meta = with lib; {
3930 description = "GUI for trace-cmd which is an interface for the Linux kernel ftrace subsystem";
4031 homepage = "https://kernelshark.org/";
pkgs/top-level/all-packages.nix+4
@@ -21867,6 +21867,10 @@ with pkgs;
2186721867
2186821868 libnl = callPackage ../os-specific/linux/libnl { };
2186921869
21870+ libtraceevent = callPackage ../os-specific/linux/libtraceevent {};
21871+
21872+ libtracefs = callPackage ../os-specific/linux/libtracefs {};
21873+
2187021874 lieer = callPackage ../applications/networking/lieer {};
2187121875
2187221876 linuxConsoleTools = callPackage ../os-specific/linux/consoletools { };