seq_buf_hex_dump(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the seq_buf descriptor. 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 are DUMP_PREFIX_OFFSET, DUMP_PREFIX_ADDRESS, or DUMP_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 in buf (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:

  • linebuf size is the maximal length for one line πŸ’€
  • 32 * 3 β€” maximum bytes per line, each printed into 2 chars + 1 for separating space
  • 2 β€” spaces separating hex dump and ASCII representation
  • 32 β€” ASCII representation
  • 1 β€” terminating ' '

it's giving very "trust the process" but it does add up, fr fr 🧚


🌈 RETURN 🌈

  • zero on success πŸ’…
  • -1 on 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:


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