Open darach opened 2 years ago
@darach you can instal the packages from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/ Something like
apt install -y libc6 debconf
wget -c http://mirrors.kernel.org/ubuntu/pool/main/o/openssl/libssl3_3.0.1-0ubuntu1_amd64.deb
dpkg -i libssl3_3.0.1-0ubuntu1_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/amd64/linux-headers-5.16.14-051614-generic_5.16.14-051614.202203111231_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/amd64/linux-headers-5.16.14-051614_5.16.14-051614.202203111231_all.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/amd64/linux-image-unsigned-5.16.14-051614-generic_5.16.14-051614.202203111231_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16.14/amd64/linux-modules-5.16.14-051614-generic_5.16.14-051614.202203111231_amd64.deb
dpkg -i linux*.deb
@aledbf Kudos for the quick response.
apt-get install linux-tools-generic --fix-missing
This gets one step closer:
sudo /usr/lib/linux-tools/5.4.0-100-generic/perf record ls
perf_event_open(..., PERF_FLAG_FD_CLOEXEC) failed with unexpected error 1 (Operation not permitted)
perf_event_open(..., 0) failed unexpectedly with error 1 (Operation not permitted)
Error:
No permission to enable cycles event.
You may not have permission to collect stats.
Consider tweaking /proc/sys/kernel/perf_event_paranoid,
which controls use of the performance events system by
unprivileged users (without CAP_SYS_ADMIN).
The current value is 2:
-1: Allow use of (almost) all events by all users
Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK
>= 0: Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN
Disallow raw tracepoint access by users without CAP_SYS_ADMIN
>= 1: Disallow CPU event access by users without CAP_SYS_ADMIN
>= 2: Disallow kernel profiling by users without CAP_SYS_ADMIN
To make this setting permanent, edit /etc/sysctl.conf too, e.g.:
kernel.perf_event_paranoid = -1
As /proc
is of course read only.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
There is still no direct option to install working perf tools (and the workaround above does not work; it would likely work to build and install the matching perf tools manually, allowing the installation of linux-tools-generic
to works, but that's of course "last resort").
As soon as that is available people could use it do do several things, including well timing with perf stat
; it would be even much more useful if the docker config is adjusted as outlined in #9687.
... and here's the last resort, put into a downloadable gist: https://gist.github.com/GitMensch/b0021e3cfd0957eeed6fbb9ce2973d7d
This also means you cannot install linux-headers
, making it virtually impossible to create virtual cameras in /dev
under gitpod. (As well as other tools that may depend on this.)
Is your feature request related to a problem? Please describe
First of all. We ❤️ GitPod at tremor. Tip of the hat to all involved!
One of the tools we use for performance analysis is the
perf
linux tool. It isn't obvious how to install this as usual incantations via apt-get fail, and identifying the correct variant viauname -r
doesn't help.Describe the behaviour you'd like
A minimal guide for how to get perf installed so
perf stat
,perf record
can be run. Our project happens to be primarily rust based, but we sometimes need to debug native libraries such aslibrdkafka
.Describe alternatives you've considered
Alternatives include using dedicated hardware ( which we use for lengthy benchmark runs and automated benchmarking via equinix metal ). However, having this within a gitpod workspace would be useful to show new contributors to the project how to get started with benchmarking and used to performance engineering tools.
Additional context
The following incantation may illustrate:
And, the result of
uname -r
The perf tool needs to target the correct kernel version so this was a good place to stop where auto discovering same wasn't successful.
Also - learning heaps from your Docker repo too 👍