1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 24282d606SSteven Rostedt (Red Hat) /* 34282d606SSteven Rostedt (Red Hat) * tracefs.h - a pseudo file system for activating tracing 44282d606SSteven Rostedt (Red Hat) * 54282d606SSteven Rostedt (Red Hat) * Based on debugfs by: 2004 Greg Kroah-Hartman <greg@kroah.com> 64282d606SSteven Rostedt (Red Hat) * 74282d606SSteven Rostedt (Red Hat) * Copyright (C) 2014 Red Hat Inc, author: Steven Rostedt <srostedt@redhat.com> 84282d606SSteven Rostedt (Red Hat) * 94282d606SSteven Rostedt (Red Hat) * tracefs is the file system that is used by the tracing infrastructure. 104282d606SSteven Rostedt (Red Hat) */ 114282d606SSteven Rostedt (Red Hat) 124282d606SSteven Rostedt (Red Hat) #ifndef _TRACEFS_H_ 134282d606SSteven Rostedt (Red Hat) #define _TRACEFS_H_ 144282d606SSteven Rostedt (Red Hat) 154282d606SSteven Rostedt (Red Hat) #include <linux/fs.h> 164282d606SSteven Rostedt (Red Hat) #include <linux/seq_file.h> 174282d606SSteven Rostedt (Red Hat) 184282d606SSteven Rostedt (Red Hat) #include <linux/types.h> 194282d606SSteven Rostedt (Red Hat) 204282d606SSteven Rostedt (Red Hat) struct file_operations; 214282d606SSteven Rostedt (Red Hat) 224282d606SSteven Rostedt (Red Hat) #ifdef CONFIG_TRACING 234282d606SSteven Rostedt (Red Hat) 24c1504e51SAjay Kaher struct eventfs_file; 25c1504e51SAjay Kaher 26c1504e51SAjay Kaher struct dentry *eventfs_create_events_dir(const char *name, 27c1504e51SAjay Kaher struct dentry *parent); 28c1504e51SAjay Kaher 29c1504e51SAjay Kaher struct eventfs_file *eventfs_add_subsystem_dir(const char *name, 30c1504e51SAjay Kaher struct dentry *parent); 31c1504e51SAjay Kaher 32c1504e51SAjay Kaher struct eventfs_file *eventfs_add_dir(const char *name, 33c1504e51SAjay Kaher struct eventfs_file *ef_parent); 34c1504e51SAjay Kaher 3588f349b4SAjay Kaher int eventfs_add_file(const char *name, umode_t mode, 3688f349b4SAjay Kaher struct eventfs_file *ef_parent, void *data, 3788f349b4SAjay Kaher const struct file_operations *fops); 3888f349b4SAjay Kaher 3988f349b4SAjay Kaher int eventfs_add_events_file(const char *name, umode_t mode, 4088f349b4SAjay Kaher struct dentry *parent, void *data, 4188f349b4SAjay Kaher const struct file_operations *fops); 4288f349b4SAjay Kaher 43*5bdcd5f5SAjay Kaher void eventfs_remove(struct eventfs_file *ef); 44*5bdcd5f5SAjay Kaher 45*5bdcd5f5SAjay Kaher void eventfs_remove_events_dir(struct dentry *dentry); 46*5bdcd5f5SAjay Kaher 474282d606SSteven Rostedt (Red Hat) struct dentry *tracefs_create_file(const char *name, umode_t mode, 484282d606SSteven Rostedt (Red Hat) struct dentry *parent, void *data, 494282d606SSteven Rostedt (Red Hat) const struct file_operations *fops); 504282d606SSteven Rostedt (Red Hat) 514282d606SSteven Rostedt (Red Hat) struct dentry *tracefs_create_dir(const char *name, struct dentry *parent); 524282d606SSteven Rostedt (Red Hat) 534282d606SSteven Rostedt (Red Hat) void tracefs_remove(struct dentry *dentry); 544282d606SSteven Rostedt (Red Hat) 55eae47358SSteven Rostedt (Red Hat) struct dentry *tracefs_create_instance_dir(const char *name, struct dentry *parent, 56eae47358SSteven Rostedt (Red Hat) int (*mkdir)(const char *name), 57eae47358SSteven Rostedt (Red Hat) int (*rmdir)(const char *name)); 58eae47358SSteven Rostedt (Red Hat) 594282d606SSteven Rostedt (Red Hat) bool tracefs_initialized(void); 604282d606SSteven Rostedt (Red Hat) 614282d606SSteven Rostedt (Red Hat) #endif /* CONFIG_TRACING */ 624282d606SSteven Rostedt (Red Hat) 634282d606SSteven Rostedt (Red Hat) #endif 64