Error measing non-rt kernel latency.

Here is the following issue I am having. I have tried a couple of fixes but these throw the same error.
I have copied below exactly what I am doing.

debian@beaglebone:/var/lib/cloud9/BeagleBoard-exercises/linux/kernel/rt$ time sudo ./hist.gen > nort.hist
Unable to change scheduling policy!
Probably missing capabilities, either run as root or increase RLIMIT_RTPRIO limits.

real 0m0.128s
user 0m0.008s
sys 0m0.060s
debian@beaglebone:/var/lib/cloud9/BeagleBoard-exercises/linux/kernel/rt$ ./setup.sh
950000
950000
debian@beaglebone:/var/lib/cloud9/BeagleBoard-exercises/linux/kernel/rt$ time sudo ./hist.gen > nort.hist
Unable to change scheduling policy!
Probably missing capabilities, either run as root or increase RLIMIT_RTPRIO limits.

real 0m0.114s
user 0m0.014s
sys 0m0.051s
debian@beaglebone:/var/lib/cloud9/BeagleBoard-exercises/linux/kernel/rt$ sudo bash
root@beaglebone:/var/lib/cloud9/BeagleBoard-exercises/linux/kernel/rt# ulimit -r unlimited
root@beaglebone:/var/lib/cloud9/BeagleBoard-exercises/linux/kernel/rt# ./hist.gen > nort.hist
Unable to change scheduling policy!
Probably missing capabilities, either run as root or increase RLIMIT_RTPRIO limits.

Hi!
Not near a BBB to check, but I think the answer is in the debug in you message:

Unable to change scheduling policy!
Probably missing capabilities, either run as root or increase RLIMIT_RTPRIO limits.

you probably need to run as root.

Check out the FAQ here for that example

https://elinux.org/EBC_Exercise_36_PREEMPT_RT

Regards,