Naveen N. Rao
unread,Jun 2, 2024, 11:55:13 AMJun 2Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Kernel Meetup Bangalore, Santosh Shukla
Title:
ftrace: An instruction one too many
Abstract:
ftrace, short for the function tracer, is the defacto Linux kernel tracing technology enabling advanced observability on Linux. At its core, ftrace works by hooking into the entry of kernel functions. It does so by having the compiler generate a suitable instruction sequence at the beginning of each kernel function. On powerpc, this translates to a two instruction sequence:
mflr r0; /* save return address */
bl _mcount; /* call into ftrace */
For such a simple two instruction sequence though, there were a surprising number of performance issues reported. In this talk, I intend to describe the issues identified and how we went about solving them. While the session is specific to powerpc architecture, the challenges discussed apply to most RISC architectures.
Outline:
- Intro to ftrace
- Short primer on powerpc ISA/ABI
- Challenge #1: Races with runtime instruction patching
- Challenge #2: Aligning with the branch predictor
- Challenge #3: Minimizing impact on icache
Talk preference:
Lightning talk
Regards,
Naveen