One Hat Cyber Team
Your IP :
216.73.216.14
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
systemtap
/
examples
/
general
/
Edit File:
cpu_throttle.stp
#!/usr/bin/stap # Copyright (C) 2018 Red Hat, Inc. # Written by William Cohen <wcohen@redhat.com> # # cpu_throttle.stp provides total milliseconds each Intel x86 # processor performance is restricted due to power or thermal # constraints formatted for consumption by prometheus. # The data is read from /proc/systemtap/*/cpu_throttle.stp # # Run the script with: # stap cpu_throttle.stp # # control-c to exit data collection global throttled_time, throttled_state probe begin { // Make sure there is an instance in the throttled_time throttled_time[0] = 0 } probe kprobe.function("therm_throt_process") { now = gettimeofday_ns() // just started throttling if (ulong_arg(1) && !(cpu() in throttled_state)) { throttled_state[cpu()] = now } // just ending throttling if (!ulong_arg(1) && cpu() in throttled_state) { throttled_time[cpu()] += now - throttled_state[cpu()] delete throttled_state[cpu()] } } probe prometheus { now = gettimeofday_ns() $value .= "# HELP cpu_throttle_time accumulated time process is performance limited in ms.\n" $value .= "# TYPE cpu_throttle_time counter\n" foreach (cpu in throttled_time){ k = throttled_time[cpu] // add in any existing throttled time if (cpu in throttled_state) k += now - throttled_state[cpu] k /= 1000000 // scale from ns to ms $value .= "cpu_throttle_time{cpu=\"".sprint(cpu)."\"} ".sprint(k)."\n" } }
Simpan