uftrace
uftrace copied to clipboard
configure: Check /proc/sys/kernel/perf_event_paranoid
In order to get kernel information with uftrace without any problem, I think /proc/sys/kernel/perf_event_paranoid should be 2 or less. But many distros nowadays set this value to more than 3 as default.
I wanted to inform users about this in the docs, but it's so general that it's unclear which docs to leave this information in.
So this commit suggests checking this information when configuring uftrace.
Closes: #1424
If there's any better idea, please let me know.
Showing the value when configure
runs is not ideal because it may be far from users actually run uftrace.
I think it'd be better if uftrace info
could show such information. Maybe we can have --system
option to display various system information related to uftrace like this one. Additionally it can display the same thing in the "system information" section in the uftrace info
output. Something like this?
$ uftrace info --system
cpu info : 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
number of cpus : 8 / 8 (online / possible)
memory info : 4.3 / 31.0 GB (free / total)
kernel version : Linux 6.1.25-1rodete1-amd64
hostname : bangji
distro : "Debian GNU/Linux rodete"
perf_event_paranoid : 3
kptr_restrict : 1
I think uftrace info --features
might be better and we can show all the feature info in this option as follows.
I would like it to have compile time and run time feature tests separately.
Thank you for your detailed feedbacks, I will send you a revised PR reflecting your feedback shortly :)
Maybe --features
can be for compile time feature tests then. But I'm not sure how much difference it can get from uftrace --version
.