Linux perf Purpose Guide agents through for CPU profiling: sampling, hardware counter measurement, hotspot identification, and integration with flamegraph generation. Triggers - "Which function is consuming the most CPU?" - "How do I measure cache misses / IPC?" - "How do I use to find hotspots?" - "How do I generate a flamegraph from perf data?" - "perf shows or frames" Workflow 1. Prerequisites Compile the target with debug symbols for useful frame data: 2. perf stat — quick counters Interpret output: - IPC (instructions per cycle) < 1.0: memory-bound or stalled pipeline - cache-miss rate 5…