CoreFreq – A Powerful CPU monitoring Tool for Linux Systems

We have wrote many articles about CPU monitoring Tool in past. Today we are going to teach you about CoreFreq, is a powerful CPU monitoring software designed for the 64-bits Processors which i came to know recently.

CoreFreq is a CPU monitoring software designed for Intel 64-bits Processors and supported architectures are Atom, Core2, Nehalem, SandyBridge and superior, AMD Family 0F.

CoreFreq provides a framework to retrieve CPU data with a high degree of precision.

  • Core frequencies & ratios; SpeedStep (EIST), Turbo Boost, Hyper-Threading (HTT) and Base Clock
  • Performance counters including Time Stamp Counter (TSC), Unhalted Core Cycles (UCC), Unhalted Reference Cycles (URC)
  • Number of instructions per cycle or second, IPS, IPC, or CPI
  • CPU C-States C0 C1 C3 C6 C7 – C1E – Auto/UnDemotion of C1 C3
  • DTS Temperature and Tjunction Max, Thermal Monitoring TM1 TM2 state
  • Topology map including Caches for boostrap & application CPU
  • Processor features, brand & architecture strings

Suggested Read : Check Available Monitoring Tools for Linux

CoreFreq implements a Linux Kernel module which employs the followings.

  • asm code to keep as near as possible the readings of the performance counters;
  • per-CPU, implements slab data memory and high-resolution timer;
  • compliant with suspend / resume and CPU Hot-Plug;
  • a shared memory to protect kernel from the user-space part of the software;
  • atomic synchronization of threads to avoid mutexes and deadlock.

How to Install CoreFreq in Linux

Linux distributions doesn’t ship with CoreFreq packages by default and there is no official distribution packages too. So the only option to build from source.

Arch Linux users can install from AUR repository with help of yaourt or packer command.

$ yaourt -S corefreq-git

or

$ packer -S corefreq-git

First you have to install the prerequisite packages, in order to compile the program from source.

For CentOS/RHEL systems.

$ sudo yum groupinstall 'Development Tools'

For Fedora system.

$ sudo dnf groupinstall 'Development Tools'

For openSUSE system.

zypper install -t pattern devel_C_C++

For Debian based system.

$ sudo apt-get install build-essential dkms git libpthread-stubs0-dev

Clone the github repository then compile it by navigating to CoreFreq directory.

$ git clone https://github.com/cyring/CoreFreq.git
$ cd CoreFreq
$ make

Run the following command to load Linux kernel module from local directory

$ sudo insmod ./corefreqk.ko

Now, start the daemon in background.

sudo ./corefreqd &

Finally, start the client

$ ./corefreq-cli

Press F2 to display a usage menu for CoreFreq. Use Right & Left arrows to move over the menu tabs. Use Up & Down arrows to select a menu item, then hit Enter to bring the corresponding information.

Open a quick reference by hitting h and Hit F4 to close the utility.

Add -s option followed by corefreq command to print the system information.

$ ./corefreq-cli -s

Processor                            [Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz]
|- Vendor ID                                                      [GenuineIntel]
|- Signature                                                             [06_5E]
|- Stepping                                                                [  3]
|- Architecture                                                      [Skylake/S]
|- Online CPU                                                              [2/2]
|- Base Clock                                                              [ 98]
|- Ratio Boost:                                                                 
|                      Min Max  8C  7C  6C  5C  4C  3C  2C  1C                  
|                       26  26   -   -   -   -  42  42  42  42                  
Instruction set:                                                                
|- 3DNow!/Ext [N,N]           AES [Y]      AVX/AVX2 [Y/N]        BMI1/BMI2 [N/N]
|- CLFSH        [Y]          CMOV [Y]       CMPXCH8   [Y]         CMPXCH16   [Y]
|- F16C         [N]           FPU [Y]          FXSR   [Y]        LAHF/SAHF   [Y]
|- MMX/Ext    [Y/N]       MONITOR [N]         MOVBE   [Y]         PCLMULDQ   [Y]
|- POPCNT       [Y]        RDRAND [Y]        RDTSCP   [Y]              SEP   [Y]
|- SSE          [Y]          SSE2 [Y]          SSE3   [Y]            SSSE3   [Y]
|- SSE4.1/4A  [Y/N]        SSE4.2 [Y]       SYSCALL   [Y]                       
                                                                                
Features:                                                                       
|- 1 GB Pages Support                                      1GB-PAGES   [Missing]
|- 100 MHz multiplier Control                            100MHzSteps   [Missing]
|- Advanced Configuration & Power Interface                     ACPI   [Missing]
|- Advanced Programmable Interrupt Controller                   APIC   [Present]
|- Core Multi-Processing                                  CMP Legacy   [Missing]
|- L1 Data Cache Context ID                                  CNXT-ID   [Missing]
|- Direct Cache Access                                           DCA   [Missing]
|- Debugging Extension                                            DE   [Present]
|- Debug Store & Precise Event Based Sampling               DS, PEBS   [Missing]
|- CPL Qualified Debug Store                                  DS-CPL   [Missing]
|- 64-Bit Debug Store                                         DTES64   [Missing]
|- Fast-String Operation                                Fast-Strings   [Missing]
|- Fused Multiply Add                                       FMA|FMA4   [Missing]
|- Hardware Lock Elision                                         HLE   [Missing]
|- Long Mode 64 bits                                         IA64|LM   [Present]

Add -h option followed by corefreq command to print the available option in CoreFreq.

$ ./corefreq-cli -h

CoreFreq.  Copyright (C) 2015-2017 CYRIL INGENIERIE

usage:	corefreq-cli [-option ]
	-t	Show Top (default)
	-d	Show Dashboard
		  arguments:    
	-c	Monitor Counters
	-i	Monitor Instructions
	-s	Print System Information
	-M	Print Memory Controller
	-m	Print Topology
	-u	Print CPUID
	-k	Print Kernel
	-h	Print out this message

Exit status:
0	if OK,
1	if problems,
>1	if serious trouble.

Report bugs to labs[at]cyring.fr

Enable client traces counters by adding -c option with corefreq.

$ ./corefreq-cli -c

CPU Freq(MHz) Ratio  Turbo  C0(%)  C1(%)  C3(%)  C6(%)  C7(%)  Min TMP:TS  Max
#00    0.00 ( 0.00)   0.00   0.00 100.00   0.00   0.00   0.00  100/100:0  /100
#01    0.00 ( 0.00)   0.00   0.00 100.00   0.00   0.00   0.00  100/100:0  /100

    Averages:        Turbo  C0(%)  C1(%)  C3(%)  C6(%)  C7(%)       TjMax:
                      0.00   0.00 100.00   0.00   0.00   0.00        100 C

CPU Freq(MHz) Ratio  Turbo  C0(%)  C1(%)  C3(%)  C6(%)  C7(%)  Min TMP:TS  Max
#00    0.00 ( 0.00)   0.00   0.00 100.00   0.00   0.00   0.00  100/100:0  /100
#01    0.00 ( 0.00)   0.00   0.00 100.00   0.00   0.00   0.00  100/100:0  /100

    Averages:        Turbo  C0(%)  C1(%)  C3(%)  C6(%)  C7(%)       TjMax:
                      0.00   0.00 100.00   0.00   0.00   0.00        100 C

CPU Freq(MHz) Ratio  Turbo  C0(%)  C1(%)  C3(%)  C6(%)  C7(%)  Min TMP:TS  Max
#00    0.00 ( 0.00)   0.00   0.00 100.00   0.00   0.00   0.00  100/100:0  /100
#01    0.00 ( 0.00)   0.00   0.00 100.00   0.00   0.00   0.00  100/100:0  /100

    Averages:        Turbo  C0(%)  C1(%)  C3(%)  C6(%)  C7(%)       TjMax:
                      0.00   0.00 100.00   0.00   0.00   0.00        100 C

Print CPU topology by adding -m option with corefreq.

$ ./corefreq-cli -m

CPU    Apic   Core  Thread  Caches      (w)rite-Back (i)nclusive              
 #      ID     ID     ID   L1-Inst Way  L1-Data Way      L2  Way      L3  Way 
00:BSP     0      0      0   32768  8     32768  8    262144  4   6291456 12 i
01:AP      1      1      0   32768  8     32768  8    262144  4   6291456 12 i

Traces the number of instructions per second / cycle by adding -i option with corefreq.

$ ./corefreq-cli -i

CPU     IPS            IPC            CPI
#00     0.000000/s     0.000000/c     0.000000/i
#01     0.000000/s     0.000000/c     0.000000/i

CPU     IPS            IPC            CPI
#00     0.000000/s     0.000000/c     0.000000/i
#01     0.000000/s     0.000000/c     0.000000/i

CPU     IPS            IPC            CPI
#00     0.000000/s     0.000000/c     0.000000/i
#01     0.000000/s     0.000000/c     0.000000/i

CPU     IPS            IPC            CPI
#00     0.000000/s     0.000000/c     0.000000/i
#01     0.000000/s     0.000000/c     0.000000/i

Print CPU identification information by adding -u option with corefreq.

$ ./corefreq-cli -u

CPU #0  function          EAX          EBX          ECX          EDX            
|- 00000000:00000000    00000016     756e6547     6c65746e     49656e69         
   |- Largest Standard Function=00000016                                        
|- 80000000:00000000    80000008     00000000     00000000     00000000         
   |- Largest Extended Function=80000008                                        
|- 00000001:00000000    000506e3     00020800     def82203     178bfbff         
|- 00000002:00000000    76036301     00f0b5ff     00000000     00c30000         
|- 00000003:00000000    00000000     00000000     00000000     00000000         
|- 00000004:00000000    04000121     01c0003f     0000003f     00000000         
|- 00000004:00000001    04000122     01c0003f     0000003f     00000000         
|- 00000004:00000002    04000143     00c0003f     000003ff     00000000         
|- 00000004:00000003    04000163     02c0003f     00001fff     00000006         
|- 00000005:00000000    00000000     00000000     00000000     00000000         
|- 00000006:00000000    00000000     00000000     00000000     00000000         
|- 00000007:00000000    00000000     00842000     00000000     00000000         
|- 00000009:00000000    00000000     00000000     00000000     00000000         
|- 0000000a:00000000    00000000     00000000     00000000     00000000         
|- 0000000b:00000000    00000000     00000001     00000100     00000000         
|- 0000000d:00000000    00000007     00000440     00000440     00000000         
|- 0000000d:00000001    00000000     000003c0     00000000     00000000         
|- 0000000f:00000000    00000000     00000000     00000000     00000000         
|- 0000000f:00000001    00000000     00000000     00000000     00000000         
|- 00000010:00000000    00000000     00000000     00000000     00000000         
|- 00000010:00000001    00000000     00000000     00000000     00000000         
|- 00000014:00000000    00000000     00000000     00000000     00000000         
|- 00000014:00000001    00000000     00000000     00000000     00000000         
|- 00000015:00000000    00000000     00000000     00000000     00000000         
|- 00000016:00000000    00000000     00000000     00000000     00000000         
|- 80000001:00000000    00000000     00000000     00000121     28100800         
|- 80000006:00000000    00000000     00000000     01006040     00000000         
|- 80000007:00000000    00000000     00000000     00000000     00000100         
|- 80000008:00000000    00003027     00000000     00000000     00000000         
.
.

Print Kernel informaton by adding -k option with corefreq.

$ ./corefreq-cli -k

Linux:                                                                          
|- Release                                                    [4.8.0-39-generic]
|- Version                         [#42-Ubuntu SMP Mon Feb 20 11:47:27 UTC 2017]
|- Machine                                                              [x86_64]
Memory:                                                                         
|- Total RAM                                                          2047752 KB
|- Shared RAM                                                           79204 KB
|- Free RAM                                                             85828 KB
|- Buffer RAM                                                            5200 KB
|- Total High                                                               0 KB
|- Free High                                                                0 KB

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...

Shares
Close
Please support the site
By clicking any of these buttons you help our site to get better