tracefs_create_instance_dir(9)
β¨ NAME β¨
tracefs_create_instance_dir β bestie, this is the function that creates the tracing instances directory, and it's kind of a big deal π
(also hi, you're reading a page from the Kernel API Manual, welcome to the cool part of the docs)
πΈ SYNOPSIS πΈ
struct dentry * tracefs_create_instance_dir (const char *name , struct dentry *parent , int (*mkdir)(const char *name) , int (*rmdir)(const char *name) );
π ARGUMENTS π
nameβ the name of the instances directory you're creating. Name it something cute, or don't, it's your kernel.parentβ the parent directory where the instances directory is gonna live. Like, its home base.mkdirβ the function that gets called whenever amkdiris performed. You're handing over the keys, no cap.rmdirβ the function that gets called whenever armdiris performed. The cleanup crew, basically.
π¦ DESCRIPTION π¦
Okay so here's the tea: only ONE instances directory is allowed. That's it. One. Don't try to make more, it's not that kind of party.
The instances directory is lowkey special because it lets userspace do mkdir and rmdir on its own. And when one of those happens? The inode locks get released, and the methods you passed in (mkdir and rmdir) get called without locks, with the name of the directory being created within the instances directory. So no deadlock drama, we love to see it.
And the return value? It hands you back the dentry of the instances directory. That's the whole point, slay. π
π₯ SEE ALSO π₯
- Kernel file
./fs/tracefs/inode.cβ the source of truth, go read it bestie tracefs_create_file(9)tracefs_create_dir(9)tracefs_remove(9)tracefs_initialized(9)
And that's the vibe check, bestie! This iconic little page is brought to you by ./fs/tracefs, dated October 2026, and it's literally called tracefs_create_instance_dir(9). Go forth and create exactly one instance directory, ily π«Άπ
π¦ 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