Administration toolsMonitoring

How to install and use CoreFreq – CPU monitoring tool for linux

CoreFreq is a CPU monitoring software designed for 64-bits Processors w/ architectures Intel Atom, Core2, Nehalem, SandyBridge and superior, AMD Family 0F.
CoreFreq provides a framework for retrieving 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

To reach this goal, 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 the kernel from the user-space part of the software;
  • atomic synchronization of threads to avoid mutexes and deadlock.

How to install CoreFreq

First, install the prerequisite packages:

## On Debian/Ubuntu distributions
$ sudo apt-get install dkms git libpthread-stubs0-dev
## On CentOS/RHEL
sudo yum group install 'Development Tools'
## On Fedora 22+
$ sudo dnf  group install 'Development Tools'>

Now, clone and build CoreFreq source code from github:

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


As root, change to the build directory then start the module followed by the daemon:

$ sudo insmod corefreqk.ko
$ sudo ./corefreqd

Then start the client, as user:

$ ./corefreq-cli
CoreFreq CPU Monitoring program
CoreFreq CPU Monitoring program

To see all usage options, type the command below:

$ ./corefreq-cli --help
./corefreq-cli --help
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
CoreFreq CPU monitor for linux
CoreFreq CPU monitor for linux

For more information and usage, visit the CoreFreq Github repository: https://github.com/cyring/CoreFreq

5 Comments

  1. Thanks for your article.
    In screenshot I noticed that the max ratio of the P7250 queried by CoreFreq is 71 !

    Do you confirm it matches your hardware ?

    If not, (and you are sure that nmi_watchdog is deactivated, and not running in a VM) please fill me a bug in the GitHub

    Regards
    CyrIng

      1. Indeed, but CoreFreq aims to monitor any 64-bits Core processors, even “old” Core 2.
        Thus I care about data queried by driver facing the hardware.

Leave a Reply to Charles Wells Cancel reply

Your email address will not be published. Required fields are marked *

CAPTCHA


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button