Skip to content
Snippets Groups Projects
Select Git revision
  • 4df297129f622bdc18935c856f42b9ddd18f9f28
  • linus-master default
  • kunit_is_love
  • kunit_drm
  • tonyk/futex_waitv
  • hidraw_rwlock
  • futex_waitv
  • futex2-dev
  • idle_sleep
  • futex2-proton
  • futex-tests
  • futex2
  • futex2-numa
  • fwm-5.11
  • cf-fix
  • tmpfs-ic
  • futex2-stable-5.11
  • futex2-stable
  • futex2-lpc
  • gaming
  • futex-fixes
21 results

trace_stack.c

  • Steven Rostedt (Red Hat)'s avatar
    4df29712
    tracing: Remove most or all of stack tracer stack size from stack_max_size · 4df29712
    Steven Rostedt (Red Hat) authored
    
    Currently, the depth reported in the stack tracer stack_trace file
    does not match the stack_max_size file. This is because the stack_max_size
    includes the overhead of stack tracer itself while the depth does not.
    
    The first time a max is triggered, a calculation is not performed that
    figures out the overhead of the stack tracer and subtracts it from
    the stack_max_size variable. The overhead is stored and is subtracted
    from the reported stack size for comparing for a new max.
    
    Now the stack_max_size corresponds to the reported depth:
    
     # cat stack_max_size
    4640
    
     # cat stack_trace
            Depth    Size   Location    (48 entries)
            -----    ----   --------
      0)     4640      32   _raw_spin_lock+0x18/0x24
      1)     4608     112   ____cache_alloc+0xb7/0x22d
      2)     4496      80   kmem_cache_alloc+0x63/0x12f
      3)     4416      16   mempool_alloc_slab+0x15/0x17
    [...]
    
    While testing against and older gcc on x86 that uses mcount instead
    of fentry, I found that pasing in ip + MCOUNT_INSN_SIZE let the
    stack trace show one more function deep which was missing before.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    4df29712
    History
    tracing: Remove most or all of stack tracer stack size from stack_max_size
    Steven Rostedt (Red Hat) authored
    
    Currently, the depth reported in the stack tracer stack_trace file
    does not match the stack_max_size file. This is because the stack_max_size
    includes the overhead of stack tracer itself while the depth does not.
    
    The first time a max is triggered, a calculation is not performed that
    figures out the overhead of the stack tracer and subtracts it from
    the stack_max_size variable. The overhead is stored and is subtracted
    from the reported stack size for comparing for a new max.
    
    Now the stack_max_size corresponds to the reported depth:
    
     # cat stack_max_size
    4640
    
     # cat stack_trace
            Depth    Size   Location    (48 entries)
            -----    ----   --------
      0)     4640      32   _raw_spin_lock+0x18/0x24
      1)     4608     112   ____cache_alloc+0xb7/0x22d
      2)     4496      80   kmem_cache_alloc+0x63/0x12f
      3)     4416      16   mempool_alloc_slab+0x15/0x17
    [...]
    
    While testing against and older gcc on x86 that uses mcount instead
    of fentry, I found that pasing in ip + MCOUNT_INSN_SIZE let the
    stack trace show one more function deep which was missing before.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>