seq_buf_hex_dump(9)
β¨ seq_buf_hex_dump β¨
okay bestie, so this page is from the Kernel API Manual β it's seq_buf_hex_dump(9), and no cap, it's literally just a glow-up machine that prints a formatted hex dump straight into your sequence buffer π
πΈ NAME πΈ
seq_buf_hex_dump β print formatted hex dump into the sequence buffer π
π¦ SYNOPSIS π¦
int seq_buf_hex_dump (struct seq_buf *s , const char *prefix_str , int
prefix_type , int rowsize , int groupsize , const void *buf , size_t len
, bool ascii );
π ARGUMENTS π
sβ theseq_bufdescriptor. this is your main character, the buffer everything's getting dumped into π«Άprefix_strβ the string you want prefixed onto every single line. and bestie, you're the one responsible for adding trailing spaces if you want the lines to line up all pretty β it does not do that for you, periodt β¨prefix_typeβ this one controls whether a prefix of an offset, an address, or literally nothing gets printed. your options areDUMP_PREFIX_OFFSET,DUMP_PREFIX_ADDRESS, orDUMP_PREFIX_NONEπ₯rowsizeβ how many bytes get printed per line. heads up: must be 16 or 32, no in-between vibes πgroupsizeβ how many bytes get printed at a time. the valid ones are 1, 2, 4, 8, and the default is 1 βbufβ the data blob you're dumping. the moment itself πlenβ how many bytes are inbuf(like, the actual count, not vibes) πΈasciiβ whether to include the ASCII after the hex output. set it and you get the cute little ASCII column too π
π DESCRIPTION π
So this function is basically an analogue of print_hex_dump, which means it's got a similar interface β same energy, different buffer. iykyk π
now for the math part, stay with me:
linebufsize is the maximal length for one line π32 * 3β maximum bytes per line, each printed into 2 chars + 1 for separating space2β spaces separating hex dump and ASCII representation32β ASCII representation1β terminating' '
it's giving very "trust the process" but it does add up, fr fr π§
π RETURN π
- zero on success π
-1on overflow π
fr fr, check that return value β an overflow means your dump did not fully make it in, and that's not the slay you want π«Ά
β SEE ALSO β
Kernel file ./lib/seq_buf.c plus the whole seq_buf friend group β go say hi:
seq_buf_can_fit(9)seq_buf_print_seq(9)seq_buf_vprintf(9)seq_buf_printf(9)seq_buf_do_printk(9)seq_buf_bprintf(9)seq_buf_puts(9)seq_buf_putc(9)seq_buf_putmem(9)seq_buf_putmem_hex(9)seq_buf_path(9)seq_buf_to_user(9)
and that's the whole page, bestie π this one lives in ./lib, it's dated October 2026, and the source/version line says seq_buf_hex_dump(9) β so like, screenshot it, cite it, love it, 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