STRUCT ANNOTATED_OP_LOC(9)
β¨ 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 (typeu8, very compact, very demure π)mem_refβ aboolthat answers the question "does the operand access memory?" π§ either it does or it doesn't, no in-betweenmulti_regsβ abooltelling you whether the second register is actually used π so like,reg2might be sitting there existing but not being used. relatable honestlyimmβ aboolfor whether the operand is an immediate value β and the important detail: it lives inoffsetπ so like, the offset field is doing double duty, iykyk
π¦ reminder:immmeans the immediate value is stored inoffset. 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms