uftrace icon indicating copy to clipboard operation
uftrace copied to clipboard

configure: Check /proc/sys/kernel/perf_event_paranoid

Open kangtegong opened this issue 1 year ago • 5 comments

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

kangtegong avatar Nov 15 '23 01:11 kangtegong

If there's any better idea, please let me know.

kangtegong avatar Nov 15 '23 01:11 kangtegong

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

namhyung avatar Nov 18 '23 07:11 namhyung

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.

honggyukim avatar Nov 18 '23 11:11 honggyukim

Thank you for your detailed feedbacks, I will send you a revised PR reflecting your feedback shortly :)

kangtegong avatar Nov 19 '23 04:11 kangtegong

Maybe --features can be for compile time feature tests then. But I'm not sure how much difference it can get from uftrace --version.

namhyung avatar Nov 19 '23 18:11 namhyung