STRUCT ETR_BUF(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 a bool and it says "yep we spilled" πŸ’€
  • size β€” the size of the buffer. iconic, self-explanatory, no notes.
  • hwaddr β€” the address to be programmed in the TMC: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 the refcount field 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 this etr_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