KKloud TarusKKloud Tarus
  • Blog
  • Series
  • Team
  • About

Blog

Thoughts on engineering, design, and building great products.

SeriesAll postsperf_eventAPFAPIARPAWSAdmissionAffinityAggregationAnsibleAppArmorArchitectureAuthenticationAuthorizationAutomationAutoscaling
CPU Profiling Bằng perf_event: Lấy Mẫu S...
LinuxPerformance

CPU Profiling Bằng perf_event: Lấy Mẫu Stack, Nền Của Flame Graph

Muốn biết CPU đang bận làm gì, ta lấy mẫu: vài chục lần mỗi giây, đóng băng mỗi CPU và ghi lại stack đang chạy. eBPF làm việc này qua loại chương trình perf_event — gắn vào một bộ đếm lấy mẫu của nhân, mỗi lần nổ thì chụp stack rồi gộp ngay trong nhân. Bài này profile một node thật ở 99Hz, thấy dd ngốn CPU qua đường đọc /dev/zero còn lõi rảnh thì nằm trong vòng idle, gộp theo tiến trình ra dd 479 mẫu — và đây chính là dữ liệu mà flame graph vẽ lên.

K
KaiMay 24, 2026
KKloud TarusKKloud Tarus

Explore. Build. Share.

  • Blog
  • Team
  • About
© 2026 KKloud Tarus. All rights reserved.