dendibakh / perf-book

The book "Performance Analysis and Tuning on Modern CPU"
https://book.easyperf.net/perf_book
Creative Commons Zero v1.0 Universal
2k stars 144 forks source link

Perf Stat Topdown Not Available #42

Closed FabianSchuetze closed 5 months ago

FabianSchuetze commented 5 months ago

Thanks for this wonderful book. It's a pleasure to read it and there's a lot to learn from it.

Section 6.1.1 paragraph "Step1: Identify the Bottleneck" mentions:

As of Linux kernel 4.8, perf has an option --topdown used in perf stat command that prints TMA Level 1 metrics.

and that the benchmark was run with:

We ran the experiments on the machine equipped with Intel Core i5-8259U CPU (Skylake based) and 16GB of DRAM (DDR4 2400 MT/s), running 64-bit Ubuntu 20.04 (kernel version 5.13.0-27).

Is this correct or could further clarification be helpful?

I cannot run the example because I receive the error System does not support topdown. I have the following configuration:

There's also a stackoverflow post mentioning that topdown is only available for Alderlake on Linux 6.5

dendibakh commented 5 months ago

Thank you for the kind words, @FabianSchuetze. Yeah, I think you're right. Alderlake and newer gens require a more recent kernel and perf tool. I have i7-1260P with kernel 6.2.0-37-generic and it seems to work. And now it prints L1 and L2 metrics. I guess I need to add a comment about that in the book.

dendibakh commented 5 months ago

Added a TODO in the text: https://github.com/dendibakh/perf-book/commit/d101edf87beb5f7ce6eac679930ebd08396f1aaa

FabianSchuetze commented 5 months ago

Thanks for the clarification and adding the TODO. Keep up the great work.