PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /proc/thread-self/root/bin/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : //proc/thread-self/root/bin/schedlat |
#!/usr/libexec/platform-python # Copyright 2020 Tanel Poder # Licensed under the Apache License, Version 2.0 (the "License") # # Name: schedlat.py (v0.2) # Purpose: display % of time a process spent in CPU runqueue # (scheduling latency) # Usage: ./schedlat.py PID # # %CPU shows % of time the task spent on CPU # %LAT shows % of time the task spent trying to get onto CPU (in runqueue) # %SLP shows the delta (not on CPU, not in runqueue, thus sleeping/waiting) # # Other: More info at https://0x.tools from __future__ import print_function from datetime import datetime import time, sys if len(sys.argv) != 2 or sys.argv[1] == '-h': print("usage: " + sys.argv[0] + " PID") exit(1) pid=sys.argv[1] with open('/proc/' + pid + '/comm', 'r') as f: print("SchedLat by Tanel Poder [https://0x.tools]\n\nPID=" + pid + " COMM=" + f.read()) print("%-20s %6s %6s %6s" % ("TIMESTAMP", "%CPU", "%LAT", "%SLP")) while True: with open('/proc/' + pid + '/schedstat' , 'r') as f: t1=time.time() (cpu_ns1, lat_ns1, dontcare) = f.read().split() time.sleep(1) f.seek(0) t2=time.time() (cpu_ns2, lat_ns2, dontcare) = f.read().split() cpu=(int(cpu_ns2)-int(cpu_ns1))/(t2-t1)/10000000 lat=(int(lat_ns2)-int(lat_ns1))/(t2-t1)/10000000 print("%-20s %6.1f %6.1f %6.1f" % (datetime.fromtimestamp(t2).strftime("%Y-%m-%d %H:%M:%S"), cpu, lat, 100-(cpu+lat)))