perf: add default d3-flame-graph templates for flamegraph script (#198028)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
8f34adb80a
commit
a72fc0d5b9
1 changed files with 92 additions and 22 deletions
|
@ -1,11 +1,58 @@
|
||||||
{ lib, stdenv, fetchpatch, kernel, elfutils, python2, python3, python3Packages, perl, newt, slang, asciidoc, xmlto, makeWrapper
|
{ lib
|
||||||
, docbook_xsl, docbook_xml_dtd_45, libxslt, flex, bison, pkg-config, libunwind, binutils-unwrapped
|
, stdenv
|
||||||
, libiberty, audit, libbfd, libbfd_2_38, libopcodes, libopcodes_2_38, openssl, systemtap, numactl
|
, fetchpatch
|
||||||
|
, fetchurl
|
||||||
|
, kernel
|
||||||
|
, elfutils
|
||||||
|
, python2
|
||||||
|
, python3
|
||||||
|
, python3Packages
|
||||||
|
, perl
|
||||||
|
, newt
|
||||||
|
, slang
|
||||||
|
, asciidoc
|
||||||
|
, xmlto
|
||||||
|
, makeWrapper
|
||||||
|
, docbook_xsl
|
||||||
|
, docbook_xml_dtd_45
|
||||||
|
, libxslt
|
||||||
|
, flex
|
||||||
|
, bison
|
||||||
|
, pkg-config
|
||||||
|
, libunwind
|
||||||
|
, binutils-unwrapped
|
||||||
|
, libiberty
|
||||||
|
, audit
|
||||||
|
, libbfd
|
||||||
|
, libbfd_2_38
|
||||||
|
, libopcodes
|
||||||
|
, libopcodes_2_38
|
||||||
|
, openssl
|
||||||
|
, systemtap
|
||||||
|
, numactl
|
||||||
, zlib
|
, zlib
|
||||||
, withGtk ? false, gtk2
|
, withGtk ? false
|
||||||
, withZstd ? true, zstd
|
, gtk2
|
||||||
, withLibcap ? true, libcap
|
, withZstd ? true
|
||||||
|
, zstd
|
||||||
|
, withLibcap ? true
|
||||||
|
, libcap
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
d3-flame-graph-templates = stdenv.mkDerivation rec {
|
||||||
|
pname = "d3-flame-graph-templates";
|
||||||
|
version = "4.1.3";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://registry.npmjs.org/d3-flame-graph/-/d3-flame-graph-${version}.tgz";
|
||||||
|
sha256 = "sha256-W5/Vh5jarXUV224aIiTB2TnBFYT3naEIcG2945QjY8Q=";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
install -D -m 0755 -t $out/share/d3-flame-graph/ ./dist/templates/*
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "perf-linux";
|
pname = "perf-linux";
|
||||||
|
@ -20,6 +67,14 @@ stdenv.mkDerivation {
|
||||||
./5.19-binutils-2.39-support.patch
|
./5.19-binutils-2.39-support.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs scripts tools/perf/pmu-events/jevents.py
|
||||||
|
|
||||||
|
substituteInPlace tools/perf/scripts/python/flamegraph.py \
|
||||||
|
--replace "/usr/share/d3-flame-graph/d3-flamegraph-base.html" \
|
||||||
|
"${d3-flame-graph-templates}/share/d3-flame-graph/d3-flamegraph-base.html"
|
||||||
|
'';
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cd tools/perf
|
cd tools/perf
|
||||||
|
|
||||||
|
@ -41,12 +96,31 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
# perf refers both to newt and slang
|
# perf refers both to newt and slang
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt
|
asciidoc
|
||||||
flex bison libiberty audit makeWrapper pkg-config python3
|
xmlto
|
||||||
|
docbook_xsl
|
||||||
|
docbook_xml_dtd_45
|
||||||
|
libxslt
|
||||||
|
flex
|
||||||
|
bison
|
||||||
|
libiberty
|
||||||
|
audit
|
||||||
|
makeWrapper
|
||||||
|
pkg-config
|
||||||
|
python3
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
elfutils newt slang libunwind zlib openssl systemtap.stapBuild numactl
|
elfutils
|
||||||
python3 perl
|
newt
|
||||||
|
slang
|
||||||
|
libunwind
|
||||||
|
zlib
|
||||||
|
openssl
|
||||||
|
systemtap.stapBuild
|
||||||
|
numactl
|
||||||
|
python3
|
||||||
|
perl
|
||||||
] ++ (if (lib.versionAtLeast kernel.version "5.19")
|
] ++ (if (lib.versionAtLeast kernel.version "5.19")
|
||||||
then [ libbfd libopcodes ]
|
then [ libbfd libopcodes ]
|
||||||
else [ libbfd_2_38 libopcodes_2_38 ])
|
else [ libbfd_2_38 libopcodes_2_38 ])
|
||||||
|
@ -63,10 +137,6 @@ stdenv.mkDerivation {
|
||||||
"-Wno-error=stringop-truncation"
|
"-Wno-error=stringop-truncation"
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
patchShebangs scripts tools/perf/pmu-events/jevents.py
|
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = false; # requires "sparse"
|
doCheck = false; # requires "sparse"
|
||||||
doInstallCheck = false; # same
|
doInstallCheck = false; # same
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue