debugfs_create_u8(9)
β¨ debugfs_create_u8 β¨
okay so bestie, welcome to the Kernel API Manual π
this one's debugfs_create_u8(9) and it's honestly kind of iconic β it's the little helper that makes a debugfs file wired straight to an unsigned 8-bit value. no cap π«Ά
πΈ NAME πΈ
debugfs_create_u8 β create a debugfs file that is used to read and write an unsigned 8-bit value. literally that's the whole gig π
π SYNOPSIS π
void debugfs_create_u8 (const char *name , umode_t mode , struct dentry
*parent , u8 *value );
that's the signature fr β copy it exactly, don't be cute with it π
π¦ ARGUMENTS π¦
nameβ a pointer to a string containing the name of the file to create. yep, the name of the file, that's it β¨modeβ the permission that the file should have. this is the vibe check for who gets to read/write πparentβ a pointer to the parent dentry for this file. this should be a directory dentry if set. if this parameter isNULL, then the file will be created in the root of the debugfs filesystem πvalueβ a pointer to the variable that the file should read to and write from. so like, the actual variable living its best life in kernel memory π
π DESCRIPTION π
This function creates a file in debugfs with the given name that contains the value of the variable value. If the mode variable is so set, it can be read from, and written to. π
so yeah β name it, point it at your u8, and boom, the kernel's got a little file that mirrors that value. slay β
lowkey important: the read/write superpowers only happen if the mode is set that way. no mode, no writing. iykyk π₯
π«Ά SEE ALSO π«Ά
Kernel file ./fs/debugfs/file.c and all these besties:
debugfs_file_get(9)debugfs_file_put(9)debugfs_enter_cancellation(9)debugfs_leave_cancellation(9)debugfs_create_u16(9)debugfs_create_u32(9)debugfs_create_u64(9)debugfs_create_ulong(9)debugfs_create_x8(9)debugfs_create_x16(9)debugfs_create_x32(9)debugfs_create_x64(9)debugfs_create_size_t(9)debugfs_create_atomic_t(9)debugfs_create_bool(9)debugfs_create_str(9)debugfs_create_blob(9)debugfs_create_u32_array(9)debugfs_print_regs32(9)debugfs_create_regset32(9)debugfs_create_devm_seqfile(9)
like, the whole friend group π§π
okay that's the page!! sourced from ./fs/debugfs, dated October 2026, and it lives under the debugfs_create_u8(9) header in the Kernel API Manual π¦π
go forth and make your little 8-bit debugfs file, bestie β periodt β¨π
π¦ 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