STRUCT THREAD_STACK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct thread_stack(9) β€” Kernel API Manual πŸ’…

🌸 NAME 🌸

okay so bestie, this is the Kernel API Manual page for struct thread_stack β€” it's literally the thread stack constructed from 'call' and 'return' branch samples. no cap, that's the whole NAME vibe. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

       struct thread_stack {
           struct thread_stack_entry *stack;
           size_t cnt;
           size_t sz;
           u64 trace_nr;
           u64 branch_count;
           u64 insn_count;
           u64 cyc_count;
           u64 kernel_start;
           u64 last_time;
           struct call_return_processor *crp;
           struct comm *comm;
           unsigned int arr_sz;
           enum retpoline_state_t rstate;
           struct branch_stack *br_stack_rb;
           unsigned int br_stack_sz;
           unsigned int br_stack_pos;
           bool mispred_all;
        };

πŸŽ€ Members πŸŽ€

bestie, here's the member-by-member tour, and every single one is staying in the group chat:

  • stack β€” array that holds the stack. the icon. πŸ’…
  • cnt β€” number of entries in the stack. count 'em. πŸ”₯
  • sz β€” current maximum stack size. πŸ’–
  • trace_nr β€” current trace number. πŸŽ€
  • branch_count β€” running branch count. πŸ¦‹
  • insn_count β€” running instruction count. 🌸
  • cyc_count β€” running cycle count. ⭐
  • kernel_start β€” kernel start address. πŸ‘‘
  • last_time β€” last timestamp. πŸ•°οΈ
  • crp β€” call/return processor. πŸ’œ
  • comm β€” current comm. 🫢
  • arr_sz β€” size of array if this is the first element of an array. 😭
  • rstate β€” used to detect retpolines. πŸ’€
  • br_stack_rb β€” branch stack (ring buffer). 🌈
  • br_stack_sz β€” maximum branch stack size. πŸ“
  • br_stack_pos β€” current position in br_stack_rb. 🧚
  • mispred_all β€” mark all branches as mispredicted. yeah, all of them. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./tools/perf/util/thread-stack.c and struct thread_stack_entry(9) β€” go peek, iykyk. 🫢

mwah πŸ’‹ source/version is ./tools/perf/util, the date is October 2026, and this whole page is struct thread_stack(9). byeee πŸ¦‹πŸ’–

πŸ“¦ where this page comes from