xeon08: Add lttng module and tools
This commit is contained in:
parent
24fb1846d2
commit
a4c254fcd6
@ -46,5 +46,8 @@ let
|
|||||||
latest = pkgs.linuxPackages_latest;
|
latest = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
./lttng.nix
|
||||||
|
];
|
||||||
boot.kernelPackages = lib.mkForce kernel;
|
boot.kernelPackages = lib.mkForce kernel;
|
||||||
}
|
}
|
||||||
|
36
xeon08/kernel/lttng.nix
Normal file
36
xeon08/kernel/lttng.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
# the lttng btrfs probe crashes at compile time because of an undefined
|
||||||
|
# function. This disables the btrfs tracepoints to avoid the issue.
|
||||||
|
lttng-modules-fixed = config.boot.kernelPackages.lttng-modules.overrideAttrs (finalAttrs: previousAttrs: {
|
||||||
|
patchPhase = (lib.optionalString (previousAttrs ? patchPhase) previousAttrs.patchPhase) + ''
|
||||||
|
substituteInPlace src/probes/Kbuild \
|
||||||
|
--replace " obj-\$(CONFIG_LTTNG) += lttng-probe-btrfs.o" " #obj-\$(CONFIG_LTTNG) += lttng-probe-btrfs.o"
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
in {
|
||||||
|
|
||||||
|
# add the lttng tools and modules to the system environment
|
||||||
|
boot.extraModulePackages = [ lttng-modules-fixed ];
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
lttng-tools lttng-ust babeltrace
|
||||||
|
];
|
||||||
|
|
||||||
|
# start the lttng root daemon to manage kernel events
|
||||||
|
systemd.services.lttng-sessiond = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
description = "LTTng session daemon for the root user";
|
||||||
|
serviceConfig = {
|
||||||
|
User = "root";
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.lttng-tools}/bin/lttng-sessiond
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# members of the tracing group can use the lttng-provided kernel events
|
||||||
|
# without root permissions
|
||||||
|
users.groups.tracing.members = [ "arocanon" ];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user