Skip to content

Commit

Permalink
configure: Check /proc/sys/kernel/perf_event_paranoid
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kangtegong committed Nov 15, 2023
1 parent 567648d commit 7e16413
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

Expand Down

0 comments on commit 7e16413

Please sign in to comment.