From 7e164139b5c6dfc88c8ff05a2c684fdfeef5f242 Mon Sep 17 00:00:00 2001 From: Kang Minchul Date: Wed, 15 Nov 2023 10:23:46 +0900 Subject: [PATCH] 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 Signed-off-by: Kang Minchul --- configure | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure b/configure index 3385de121..87491999c 100755 --- a/configure +++ b/configure @@ -230,6 +230,15 @@ print_feature() onoff="OFF" fi fi + + if [ "$item" == "perf_event" ]; then + if [ "$(cat /proc/sys/kernel/perf_event_paranoid)" -le 2 ]; then + onoff="\033[32mon \033[0m" + else + onoff="\033[91mOFF\033[0m" + fi + fi + printf "...%15s: [ ${onoff} ] - %s\n" "${item}" "${description}" }