Seminar Abstract:

gem5 is a widely used modular architectural simulator, central to the design and evaluation of modern computer systems. However, its flexibility and feature richness come with challenges that hinder development and debugging. Two persistent pain points are: (1) understanding gem5’s own runtime behavior—such as function call flow and component interactions—and (2) gaining insight into what the simulated system is doing, particularly during full-system (FS) simulations. In this seminar, we present two lightweight, complementary tools designed to address these challenges. First, we introduce a profiling framework that instruments gem5 directly, combining a Bash-based launcher, a C++-based in-simulator profiler, and Python scripts for post-run analysis. This toolchain enables developers to trace internal execution, identify simulation phases, and quickly pin-point system bottlenecks or stalls. Second, we tackle the long-standing difficulty of sampling call stacks in FS mode, where gem5 runs complete operating systems and real workloads. Traditional stack tracing techniques often fail in this context due to user/kernel transitions, dynamically loaded shared libraries, etc. These limitations obscure what the simulated program is doing, whether time is spent in user-level code or kernel routines, which are crucial for diagnosing program correctness and performance issues. Our lightweight stack sampling solution overcomes these obstacles, offering visibility into simulated workload behavior and complementing our internal profiler to significantly enhance gem5’s transparency and debuggability.

About the Speaker:

Dr. Yuan Yao is an Assistant Professor at Uppsala University, research group UART, Sweden, specializing in computer architecture and system-level simulation. His research focuses on improving architectural simulation frameworks, designing energy-efficient hardware, and exploring novel interconnection and accelerator systems. Dr. Yao was a Postdoc at UART, and received his PhD and MSc from KTH Royal Institute of Technology, Sweden.