PCsuggest

  • Quick tip
  • SECURITY
  • NETWORKING
  • OpenWrt
  • HARDWARE

How to find Linux CPU usage with CoreFreq

Updated - October 10, 2017 by Arnab Satapathi

There's many Linux CPU usage monitoring tools there, lets try this relatively new CoreFreq tool.

It's the successor of previous XFreq tool from the same developer, but now it also supports CPU usage monitoring of AMD CPUs too.

CoreFreq is a quite complete CPU monitoring tool, few features of CoreFreq below.

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

Anyway, these features list is just a copy paste from the developer's github page.

https://github.com/cyring/CoreFreq check that for more details.

Contents

  • Install CoreFreq in GNU/Linux
  • Using CoreFreq to monitor CPU usage in Linux
  • Conclusion

Install CoreFreq in GNU/Linux

There's a AUR package for Arch Linux, here's the AUR link. But there's no way to install it in other distros without compiling it from source.

In this tutorial I'll show you how to compile and install CoreFreq in Debian based distros.

First you've to install proper compilers, development libraries and development header files, quite straightforward though.

sudo apt-get install linux-headers-`uname -r`
sudo apt-get install git dkms build-essential libc6-dev libpthread-stubs0-dev

Now copy the source code from the git repository,

cd ~/
git clone https://github.com/cyring/CoreFreq.git
cd ~/CoreFreq/

Lets compile,

amazon prime logo
Try AmazonPrime for free
Enjoy free shipping and One-Day delivery, cancel any time.
make -j4

If everything is fine, it should generate 3 main files without any error message, the kernel module corefreqk.ko , CoreFreq daemon corefreqd, and corefreq-cli, it's the the CLI client tool.

Using CoreFreq to monitor CPU usage in Linux

The first step is to insert the kernel module, use sudo insmod corefreqk.ko  to insert it.

This will create a new device file under /dev directory, /dev/corefreqk . Now start the CoreFreq daemon as super user, and don't kill the process.

sudo ./corefreqd

Now you can get the detailed CPU usage statics with the corefreq-cli application, just run ./corefreq-cli .

Screenshots below,

CoreFreq Linux CPU usage monitor tool

The image is a bit larger, you may want to open it in a new browser tab.

Use the Enter key to toggle various settings of corefreq-cli.

Conclusion

So that's all for CoreFreq, again special thanks to the developer for creating such a nice Linux CPU usage monitoring tool.

Here's the developers Google+ link, https://plus.google.com/116215143685999462002 , there you can track.

Here's the developer's blog, http://blog.cyring.free.fr/ .

Filed Under: hardware, how to Tagged With: CPU, cpu usage monitor, microcode

Your comments
  1. sayan says

    March 2, 2017

    Very helpful trick

    Reply
  2. CyrIng says

    February 13, 2017

    Thanks a lot Arnab 😉

    I don't maintain the blog, you can however folow CoreFreq progress on the GitHub (github.com/cyring/CoreFreq) and G+ (plus.google.com/116215143685999462002)

    Btw you will cross UI glitch, bugs and unexpected values, if you let nmi_watchdog runs in parallel of CoreFreq driver.
    Warmly recommend to disable nmi_watchdog.

    Best regards
    CyrIng

    Reply
    • Arnab says

      February 13, 2017

      I'll update the article and add your G+ profile link.
      Surely I'll try it after diasbling nmi_watchdog, and will compair both the results.

      Reply

Leave a Reply Cancel reply

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

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

Copyright © PCsuggest.com · All rights reserved.

  • Home
  • About
  • Contact
  • Privacy Policy
  • Sitemap