Skip to content

Commit

Permalink
Install linux-tools and set perf buildid.dir
Browse files Browse the repository at this point in the history
This commit adds new `make kernel-tools` recipe (dependency of `make
basic-tools`), which installs kernel version-specific tools such as
`perf`, and sets its `buildid.dir`.

This change is in an attempt to get rid of `~/.debug`. Note that the
config is currently set just for `--system`, so it's a question, whether
if invoked under current USER it's gonna work. The issue with using
`--user` option is that it creates `~/.perfconfig`, which defeats the
purpose here.
  • Loading branch information
matyama committed Mar 18, 2024
1 parent d51cbf4 commit 8d2bd51
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ links: \
@sudo ln -svf /usr/bin/lldb-vscode-15 /usr/bin/lldb-vscode
@echo "Finish Poetry setup by manually configuring auth tokens: https://bit.ly/3fdpMNR"

# Installed tools:
# - Kernel version locked tools (such as `perf` and `x86_energy_perf_policy`)
.PHONY: kernel-tools
kernel-tools: KERNEL_RELEASE := $(shell uname -r)
kernel-tools: PERF_BUILDID_DIR := /var/cache/perf-buildid
kernel-tools:
@echo ">>> Installing tools for kernel $(KERNEL_RELEASE)"
@sudo apt install -y linux-tools-$(KERNEL_RELEASE)
@echo ">>> Configuring perf 'buildid.dir=$(PERF_BUILDID_DIR)'"
@sudo perf config --system buildid.dir=$(PERF_BUILDID_DIR)

# Installed tools:
# - libssl-dev: secure sockets layer toolkit
# - pssh: asynchronous parallel SSH library (https://parallel-ssh.org)
Expand Down Expand Up @@ -323,6 +334,7 @@ neovim: $(XDG_STATE_HOME)/nvim/spell
# - wireguard: fast, modern, secure VPN tunnel (https://www.wireguard.com)
.PHONY: basic-tools
basic-tools: \
kernel-tools \
net-tools \
core-utils \
apt-utils \
Expand Down

0 comments on commit 8d2bd51

Please sign in to comment.