1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #include <linux/mutex.h> 3 4 struct rv_interface { 5 struct dentry *root_dir; 6 struct dentry *monitors_dir; 7 }; 8 9 #include "../trace.h" 10 #include <linux/tracefs.h> 11 #include <linux/rv.h> 12 13 #define RV_MODE_WRITE TRACE_MODE_WRITE 14 #define RV_MODE_READ TRACE_MODE_READ 15 16 #define rv_create_dir tracefs_create_dir 17 #define rv_create_file tracefs_create_file 18 #define rv_remove tracefs_remove 19 20 DEFINE_FREE(rv_remove, struct dentry *, if (_T) rv_remove(_T)); 21 22 #define MAX_RV_MONITOR_NAME_SIZE 32 23 #define MAX_RV_REACTOR_NAME_SIZE 32 24 25 extern struct mutex rv_interface_lock; 26 extern struct list_head rv_monitors_list; 27 28 struct dentry *get_monitors_root(void); 29 int rv_disable_monitor(struct rv_monitor *mon); 30 int rv_enable_monitor(struct rv_monitor *mon); 31 bool rv_is_container_monitor(struct rv_monitor *mon); 32 bool rv_is_nested_monitor(struct rv_monitor *mon); 33 34 #ifdef CONFIG_RV_REACTORS 35 int reactor_populate_monitor(struct rv_monitor *mon, struct dentry *root); 36 int init_rv_reactors(struct dentry *root_dir); 37 #else reactor_populate_monitor(struct rv_monitor * mon,struct dentry * root)38static inline int reactor_populate_monitor(struct rv_monitor *mon, struct dentry *root) 39 { 40 return 0; 41 } 42 init_rv_reactors(struct dentry * root_dir)43static inline int init_rv_reactors(struct dentry *root_dir) 44 { 45 return 0; 46 } 47 #endif 48