Linux CPU Profiling

Ryan
May 7, 2021

Linux — System Performance Analysis — CPU Profiling: https://compassinbabel.org/post/e77e475f-f465-413f-bbbe-69ef434fec33

Table of Content

  • Introduction
  • Related Readings
  • A Template for CPU Profiling
  1. Get the number of CPUs on a machine
  2. Check the CPU utilization
  3. Check ongoing hot processes
  4. Check cumulative CPU utilization of processes
  • Linux perf tool
  • Process Profiling
  • Collect process performance stats 20 times/second in the 10 seconds period.
  • Generate process performance reports
  • Get the time line of events of a process
  • CPU Scheduler Profiling
  • Record a scheduler profile for 10 seconds
  • Show per-process scheduler latency from a scheduler profile:
  • List per-event scheduler latency from a scheduler profile
  • Other Recipes
  • How to check the CPU run-queue length?

--

--