RomanMeR
Posts: 6
Joined: Fri Jan 06, 2017 3:00 pm

Exact moment in the past when throttling occured

Fri Oct 27, 2017 5:33 pm

Hello! It is said in this post that using the

Code: Select all

vcgencmd get_throttled
command it's possible to know that under-voltage condition, ARM frequency capping or throttling has occured since RPi boot. Is it possible to find by some (built-in in Raspbian) means the exact moment in the past when such situation took place?

User avatar
DougieLawson
Posts: 35793
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Exact moment in the past when throttling occured

Fri Oct 27, 2017 8:05 pm

I tried running four copies of

Code: Select all

#include <stdlib.h>
#include <stdio.h>

void main(int argv, char * argc[]){

        int loop = 1;
        long cnt = 0;;
        while (loop) {
                cnt++;
        }
}
as an ugly CPU soaker to get my RPi3B running hot and throttled. There's no external information in /var/log/messages or /var/log/syslog or dmesg output when throttling happens. So all you can do is, crudely, run a vgcencmd get_throttled command periodically and log the time when the throttled bit changes.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

sora03
Posts: 193
Joined: Mon Dec 29, 2014 4:11 pm
Contact: Website

Re: Exact moment in the past when throttling occured

Thu Nov 02, 2017 11:15 am

you can write a python or bash script to execute the vgencmd get_throttled command with date so you will know what time/date it occured. you can run the script it crontab for about 1 minute.

example bash script: checkthr.sh

Code: Select all

#!/bin/bash
date >> /home/pi/THROTTLED.log
vcgencmd get_throttled >> /home/p/THROTTLED.log
do not forget to write exec permission:

Code: Select all

 chmod +x ./checkthr.sh'
Edit crontab: $ crontab -e
add:

Code: Select all

*/1 * * * * /home/pi/checkthr.sh
that script will run everyminute. you can also use the rpiburn tha will test your PSU
$git clone https://github.com/ronny-nilsson/rpiburn
$ cd rpiburn && make && sudo make install
to test PSU
$ sudo rpiburn
FLOSS enthusiast, Debian user (linux-libre)

jahboater
Posts: 4598
Joined: Wed Feb 04, 2015 6:38 pm

Re: Exact moment in the past when throttling occured

Thu Nov 02, 2017 11:36 am

For testing, use this to very quickly guarantee throttling:-

Code: Select all

wget https://raw.githubusercontent.com/ssvb/cpuburn-arm/master/cpuburn-a53.S
gcc -o cpuburn-a53 cpuburn-a53.S
./cpuburn-a53

itsmedoofer
Posts: 356
Joined: Wed Sep 25, 2013 8:43 am

Re: Exact moment in the past when throttling occured

Wed Nov 08, 2017 12:33 pm

Hi,

If you just want to get things nice and hot simply put this into bash:

Code: Select all

for i in 1 2 3 4; do while : ; do : ; done &  done

jahboater
Posts: 4598
Joined: Wed Feb 04, 2015 6:38 pm

Re: Exact moment in the past when throttling occured

Wed Nov 08, 2017 5:19 pm

itsmedoofer wrote:
Wed Nov 08, 2017 12:33 pm
Hi,

If you just want to get things nice and hot simply put this into bash:

Code: Select all

for i in 1 2 3 4; do while : ; do : ; done &  done
Thats pretty clever! And it uses all four cores.
But it only got my Pi3 to about 70C after a couple hours and it didn't throttle.

Cpuburn-a53 uses the NEON SIMD unit instead which is very powerful.
I believe it is quad issue (unlike the ARM stuff), so I suspect that with some clever coding it can potentially do:-

4 cores x quad issue (4 insns) x 4 lanes = 64 float operations per cycle.

It does get my Pi3 above 80C within a minute or so (and starting to throttle).

Return to “Advanced users”