tracefs_create_dir(9)
πΈ tracefs_create_dir β it's giving "make a folder in tracefs" β¨
okay so real talk: you're in the Kernel API Manual (section 9, kernel devs only, iykyk) and the vibe today is tracefs_create_dir. she makes directories. in tracefs. that's the whole thing, and she does it beautifully π
π¦ SYNOPSIS
struct dentry * tracefs_create_dir (const char *name , struct dentry *parent );
like, look at her. two args, one dentry pointer back. main character energy fr π
π ARGUMENTS
nameβ a pointer to a string containing the name of the directory to create. literally the name. the folder's name. that's it bestie π«Άparentβ a pointer to the parent dentry for this file. this should be a directory dentry if set. if this parameter isNULL, then the directory will be created in the root of the tracefs filesystem. so like,<italic>parent</italic>=NULLmeans "no thoughts, head empty, put me at the root" π
ngl the wording says "for this file" in the original and we're keeping it exactly as-is, no notes, don't come for me π
π DESCRIPTION
this function creates a directory in tracefs with the given name. iconic behaviour. no cap β¨
this function will return a pointer to a dentry if it succeeds. that pointer must be passed to the tracefs_remove function when the file is to be removed. like β you do NOT just leave her there, bestie, you clean up after yourself, that's the rule π
if an error occurs, NULL will be returned. so always check, okay? don't be out here dereferencing vibes π
if tracing is not enabled in the kernel, the value -ENODEV will be returned. so if you get that, it's not you, it's the kernel config π§
π SEE ALSO
- Kernel file
./fs/tracefs/inode.c tracefs_create_file(9)tracefs_create_instance_dir(9)tracefs_remove(9)tracefs_initialized(9)
go read the whole squad, they're all linked up, it's a whole friend group π
and that's the page!! π¦ written by the folks over in ./fs/tracefs β the source/version line, dated October 2026, and yeah she's still tracefs_create_dir(9) at the bottom, slay π
β¨
π¦ 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