atop icon indicating copy to clipboard operation
atop copied to clipboard

curscal column shows ?% with ryzen 3800x (linux 5.3)

Open perkinslr opened this issue 5 years ago • 4 comments

As the title says, the curscal column on CPU usage doesn't populate properly. Both with 2.4.0 and 2.5.0-r1. It works properly with 2.3.0-r1.

perkinslr avatar Apr 17 '20 04:04 perkinslr

Seeing a similar issue with Ryzen 4750G CPU (8 cores, 16 threads).

atop Version: 2.4.0 - 2019/01/12 20:37:57   <[email protected]>

Linux kernel & system:  5.8.0-45-generic #51~20.04.1-Ubuntu SMP

Seeing:

curscal ?%

in addition: ipc notavail and cycl unknown in green on same system.

CPU capabilities (from lshw) are:

capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp x86-64 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip rdpid overflow_recov succor smca cpufreq

And frequencies are available in /proc/cpuinfo:

% cat /proc/cpuinfo | grep MHz
cpu MHz         : 1382.703
cpu MHz         : 1429.332
cpu MHz         : 1397.321
cpu MHz         : 1321.542
cpu MHz         : 1395.713
cpu MHz         : 1319.187
cpu MHz         : 1305.508
cpu MHz         : 1294.872
cpu MHz         : 1397.196
cpu MHz         : 1396.838
cpu MHz         : 1396.308
cpu MHz         : 1354.228
cpu MHz         : 1303.168
cpu MHz         : 1260.635
cpu MHz         : 1308.292
cpu MHz         : 1381.180

arielf avatar Mar 25 '21 07:03 arielf

The ipc notavail and cycl unknown errors are permission related. Try running atop as root.

perkinslr avatar Mar 25 '21 08:03 perkinslr

Indeed, when running as root, ipc and cycl are displayed and this is also documented in man atop.

When PMC performance monitoring counters are supported by the  CPU and the kernel
(and atop runs with root privileges), the number of  instructions per CPU cycle (`ipc') is shown.

Thinking it would be nicer if atop was installed setgid so it could see these without running with full root permissions alternatively (better?) if the /proc files exposing these numbers were better documented, i could change their group ownership & permissions to minimize wholesale privileges but allow group atop to display them without full root permissions.

arielf avatar Apr 26 '21 08:04 arielf

setuid/setgid on process monitors is a poor choice for multi-user systems. It would be passable, if before calling set(u|g)id, it checks if /proc is mounted hidepid or hidepid2, but atop currently does not. That said, the Makefile tries making atop setuid root; if your installation is not set(u|g)id, it is because your distro package maintainer is making it not setuid.

perkinslr avatar May 01 '21 20:05 perkinslr