Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • kernel
  • trace
  • fgraph.c
Find file BlameHistoryPermalink
  • Christophe Leroy's avatar
    ftrace: Make ftrace_graph_is_dead() a static branch · 18bfee32
    Christophe Leroy authored Mar 30, 2022
    ftrace_graph_is_dead() is used on hot paths, it just reads a variable
    in memory and is not worth suffering function call constraints.
    
    For instance, at entry of prepare_ftrace_return(), inlining it avoids
    saving prepare_ftrace_return() parameters to stack and restoring them
    after calling ftrace_graph_is_dead().
    
    While at it using a static branch is even more performant and is
    rather well adapted considering that the returned value will almost
    never change.
    
    Inline ftrace_graph_is_dead() and replace 'kill_ftrace_graph' bool
    by a static branch.
    
    The performance improvement is noticeable.
    
    Link: https://lkml.kernel.org/r/e0411a6a0ed3eafff0ad2bc9cd4b0e202b4617df.1648623570.git.christophe.leroy@csgroup.eu
    
    
    
    Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    18bfee32
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7