STRUCT ETR_BUF(9)
π struct etr_buf(9) π
okay so bestie, welcome to the kernel API manual β this page is literally all about struct etr_buf, which is the details of the buffer used by ETR. and there's a second bit glued onto the NAME line too: it's also the refcount β the number of sources currently using this etr_buf. two-for-one deal, we love that for us π
β¨ SYNOPSIS β¨
like, here's the whole vibe of the struct, character for character, don't @ me:
struct etr_buf {
refcount_t refcount;
enum etr_mode mode;
bool full;
ssize_t size;
dma_addr_t hwaddr;
unsigned long offset;
s64 len;
const struct etr_buf_operations *ops;
void *private;
};
πΈ Members πΈ
so these are the fields, and yes they all have main character energy in their own way:
modeβ the mode of the ETR buffer. contiguous, Scatter Gather, etc. it's giving "which flavor of buffer are we today" πfullβ trace data overflow. that's it, that's the whole thing. it's abooland it says "yep we spilled" πsizeβ the size of the buffer. iconic, self-explanatory, no notes.hwaddrβ the address to be programmed in theTMC:DBA{LO,HI}. hardware address, we're talking to the actual silicon π¦offsetβ the offset of the trace data in the buffer for consumption. like where you start reading, iykyk.lenβ available trace data buf (may round up to the beginning). yes it might wrap around to the start, lowkey unhinged but that's the deal πopsβ ETR buffer operations for the mode. the function table bestie, this is where the behavior lives β¨privateβ backend specific information for the buf. the mystery box, the lore, the "don't touch unless you know" π«Ά
ngl therefcountfield lives up there in the struct but the member list doesn't spell it out separately β it's the one from the NAME line, the number of sources currently using thisetr_buf. just so you're not confused, queen π
π¦ SEE ALSO π¦
- Kernel file
./drivers/hwtracing/coresight/coresight-tmc.h struct tmc_drvdata(9)struct tmc_pages(9)
like go read those next, they're the supporting cast and they absolutely ate π
and that's the whole page, periodt. this little icon dropped from ./drivers/hwtracing/coresight, dated October 2026 β mwah, look at her go πβπ
π¦ 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