adj_for_padding(9)
π adj_for_padding(9) β a Kernel API Manual moment
okay so this is adj_for_padding, from the Kernel API Manual, and bestie it's a tiny little function that does one specific thing and does it flawlessly. periodt.
β¨ NAME β¨
adj_for_padding β adjust overlap to account for padding. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
unsigned char * adj_for_padding (unsigned char *buf_b , unsigned char
*buf_a , size_t len_a );
like, she's a function, she takes three things, she gives you back a pointer. iconic behavior honestly π¦
π ARGUMENTS π
buf_bβ the second buffer. yes, b comes second. no, we don't make the rules, we just slay by them πbuf_aβ the first buffer. she's the main character here, lowkey πlen_aβ the size of the first buffer. know her measurements fr fr π
π§ DESCRIPTION π§
so here's the tea: buf_a might have up to 7 bytes of padding appended to it. yep, up to 7. not 8, not 6 β up to 7. and when that happens, the overlap needs adjusting accordingly, and that is literally this function's whole job. she adjusts the overlap. she accounts for the padding. no cap β¨
π₯ RETURN π₯
a pointer into buf_b β specifically, from where the non-overlapped data starts. that's the address, that's the answer, that's the whole point π«Ά
π SEE ALSO π
- the Kernel file
./tools/perf/util/intel-pt-decoder/intel-pt-decoder.cβ go read the source bestie, it's giving lore π intel_pt_next_psb(9)intel_pt_step_psb(9)intel_pt_last_psb(9)intel_pt_next_tsc(9)intel_pt_tsc_cmp(9)intel_pt_find_overlap_tsc(9)intel_pt_find_overlap(9)struct fast_forward_data(9)intel_pt_ff_cb(9)intel_pt_fast_forward(9)
like, that's a whole friend group right there and they're all connected. iykyk πΈ
ngl if you got here looking for something dramatic, this page is not that. it's a small utility doing honest work in the intel-pt decoder and honestly? we love her for it. π
alright bestie that's the whole page!! π this cutie came from ./tools/perf/util/intel-pt-dec... (that's the source/version, slightly truncated by the man page gods) and she's dated October 2026 β catch you in the next release, mwah ππ¦β¨
π¦ 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