STRUCT ANNOTATED_OP_LOC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct annotated_op_loc(9) ✨

okay so bestie, welcome to struct annotated_op_loc(9) β€” straight out of the Kernel API Manual and honestly? it's giving "small struct, big responsibilities" πŸ’… this little cutie is your go-to for Location info of instruction operand πŸŽ€ like it literally exists to tell you where an operand lives and what it's doing. no cap.


🌸 SYNOPSIS 🌸

struct annotated_op_loc {
    int reg1;
    int reg2;
    int offset;
    u8 segment;
    bool mem_ref;
    bool multi_regs;
    bool imm;
 };

that's the whole vibe. seven fields, zero drama. let's meet them 🫢


πŸ’– Members πŸ’–

  • reg1 β€” the first register in the operand. the main character of registers, if you will πŸ‘‘
  • reg2 β€” the second register in the operand. yes bestie, sometimes there's a whole second one 😭
  • offset β€” the memory access offset in the operand. it's an offset. it offsets. we love that for it ✨
  • segment β€” the segment selector register (type u8, very compact, very demure πŸŽ€)
  • mem_ref β€” a bool that answers the question "does the operand access memory?" 🧚 either it does or it doesn't, no in-between
  • multi_regs β€” a bool telling you whether the second register is actually used πŸ‘€ so like, reg2 might be sitting there existing but not being used. relatable honestly
  • imm β€” a bool for whether the operand is an immediate value β€” and the important detail: it lives in offset πŸ“ so like, the offset field is doing double duty, iykyk
πŸ¦‹ reminder: imm means the immediate value is stored in offset. do not go looking in a separate field, bestie, it's not there, fr fr.

🌈 SEE ALSO 🌈

all the siblings in the family tree πŸ’œ:

  • struct sym_hist(9)
  • struct cyc_hist(9)
  • struct annotated_source(9)
  • struct annotated_branch(9)
  • struct annotated_insn_loc(9)
  • struct annotated_basic_block(9)

and if you wanna come stare at the source yourself, it's living its best life in the kernel file ./tools/perf/util/annotate.h πŸ”₯


and that's the whole page, bestie!! πŸ’• big slay to the folks at ./tools/perf/util β€” this doc dropped October 2026, so mark your calendar and stan accordingly ⭐ πŸ‘‘ ✨

πŸ“¦ where this page comes from