1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * tracefs.h - a pseudo file system for activating tracing 4 * 5 * Based on debugfs by: 2004 Greg Kroah-Hartman <[email protected]> 6 * 7 * Copyright (C) 2014 Red Hat Inc, author: Steven Rostedt <[email protected]> 8 * 9 * tracefs is the file system that is used by the tracing infrastructure. 10 */ 11 12 #ifndef _TRACEFS_H_ 13 #define _TRACEFS_H_ 14 15 #include <linux/fs.h> 16 #include <linux/seq_file.h> 17 18 #include <linux/types.h> 19 20 struct file_operations; 21 22 #ifdef CONFIG_TRACING 23 24 struct eventfs_file; 25 26 struct dentry *eventfs_create_events_dir(const char *name, 27 struct dentry *parent); 28 29 struct eventfs_file *eventfs_add_subsystem_dir(const char *name, 30 struct dentry *parent); 31 32 struct eventfs_file *eventfs_add_dir(const char *name, 33 struct eventfs_file *ef_parent); 34 35 struct dentry *tracefs_create_file(const char *name, umode_t mode, 36 struct dentry *parent, void *data, 37 const struct file_operations *fops); 38 39 struct dentry *tracefs_create_dir(const char *name, struct dentry *parent); 40 41 void tracefs_remove(struct dentry *dentry); 42 43 struct dentry *tracefs_create_instance_dir(const char *name, struct dentry *parent, 44 int (*mkdir)(const char *name), 45 int (*rmdir)(const char *name)); 46 47 bool tracefs_initialized(void); 48 49 #endif /* CONFIG_TRACING */ 50 51 #endif 52