Merge pull request #296072 from hzeller/feature-20240312-add-perf-to-profile

perf_data_converter: init at unstable-2024-03-12
This commit is contained in:
Nick Cao 2024-03-16 21:05:26 -07:00 committed by GitHub
commit 6a4db7015c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,63 @@
{
lib,
stdenv,
buildBazelPackage,
fetchFromGitHub,
fetchpatch,
bazel_6,
jdk,
elfutils,
libcap,
}:
buildBazelPackage rec {
pname = "perf_data_converter";
version = "0-unstable-2024-03-12";
src = fetchFromGitHub {
owner = "google";
repo = "perf_data_converter";
rev = "e1cfe1e7e5d8cf3b728a166bf02d4227c82801eb";
hash = "sha256-Y3tBLH2jf1f28o6RK2inq9FulKc66qcqwKmxYdFC5tA=";
};
bazel = bazel_6;
bazelFlags = [
"--java_runtime_version=local_jdk"
"--tool_java_runtime_version=local_jdk"
];
fetchAttrs = {
sha256 = "sha256-IauQ4zEn9YHppLgW+4XjPv4N5IZlEkp//tE/Dy7k28s=";
};
nativeBuildInputs = [ jdk ];
buildInputs = [
elfutils
libcap
];
removeRulesCC = false;
bazelBuildFlags = [ "-c opt" ];
bazelTargets = [ "src:perf_to_profile" ];
bazelTestTargets = [ "src:all" ];
buildAttrs = {
installPhase = ''
runHook preInstall
install -Dm555 -t "$out/bin" bazel-bin/src/perf_to_profile
runHook postInstall
'';
};
meta = with lib; {
description = "Tool to convert Linux perf files to the profile.proto format used by pprof";
homepage = "https://github.com/google/perf_data_converter";
license = licenses.bsd3;
maintainers = with maintainers; [ hzeller ];
platforms = platforms.linux;
};
}