debugfs_create_atomic_t(9)
π debugfs_create_atomic_t β the Kernel API Manual said let me introduce you π
okay bestie, buckle up, because this one is genuinely so useful. debugfs_create_atomic_t is the function that creates a debugfs file that is used to read and write an atomic_t value β¨ that's it, that's the whole vibe β you get a cute lil file up in debugfs, and when somebody reads it or writes to it, it's talking directly to your atomic_t. no cap, it's giving "magic window into a kernel variable" energy π
β¨ SYNOPSIS β¨
void debugfs_create_atomic_t (const char *name , umode_t mode , struct
dentry *parent , atomic_t *value );
literally just call it with those four things and you're done, iykyk π«Ά
πΈ ARGUMENTS πΈ
nameβ a pointer to a string containing the name of the file to create. yes it's just the filename bestie, pick something cute-ish but like, at least a little descriptive πmodeβ the permission that the file should have. like, who's allowed to read and write it, you know the drill πparentβ a pointer to the parent dentry for this file. this should be a directory dentry if it's set. and if this parameter isNULL?? then the file will be created in the root of the debugfs filesystem β main character energy, no parent, just vibing at the top level πvalueβ a pointer to the variable that the file should read to and write from. this is the whole point, this is the icon, this is theatomic_twe're all here for π
ngl the NULL parent thing is genuinely handy but do try not to unleash a million files into the debugfs root, it's a whole aesthetic π
π¦ SEE ALSO π¦
the kernel file is ./fs/debugfs/file.c and honestly it's the friend group, here's the whole crew:
debugfs_file_get(9)debugfs_file_put(9)debugfs_enter_cancellation(9)debugfs_leave_cancellation(9)debugfs_create_u8(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_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)
and that's the whole page, bestie π§ oh and before i forget β the footer energy: this one lives in ./fs/debugfs, it's dated October 2026, and the title is debugfs_create_atomic_t(9) from the Kernel API Manual. slay, go forth and debug ππ₯
π¦ 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