1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/mutex.h>
5 struct dentry
*root_dir
;
6 struct dentry
*monitors_dir
;
10 #include <linux/tracefs.h>
13 #define RV_MODE_WRITE TRACE_MODE_WRITE
14 #define RV_MODE_READ TRACE_MODE_READ
16 #define rv_create_dir tracefs_create_dir
17 #define rv_create_file tracefs_create_file
18 #define rv_remove tracefs_remove
20 #define MAX_RV_MONITOR_NAME_SIZE 32
21 #define MAX_RV_REACTOR_NAME_SIZE 32
23 extern struct mutex rv_interface_lock
;
25 #ifdef CONFIG_RV_REACTORS
26 struct rv_reactor_def
{
27 struct list_head list
;
28 struct rv_reactor
*reactor
;
29 /* protected by the monitor interface lock */
34 struct rv_monitor_def
{
35 struct list_head list
;
36 struct rv_monitor
*monitor
;
37 struct dentry
*root_d
;
38 #ifdef CONFIG_RV_REACTORS
39 struct rv_reactor_def
*rdef
;
45 struct dentry
*get_monitors_root(void);
46 int rv_disable_monitor(struct rv_monitor_def
*mdef
);
47 int rv_enable_monitor(struct rv_monitor_def
*mdef
);
49 #ifdef CONFIG_RV_REACTORS
50 int reactor_populate_monitor(struct rv_monitor_def
*mdef
);
51 void reactor_cleanup_monitor(struct rv_monitor_def
*mdef
);
52 int init_rv_reactors(struct dentry
*root_dir
);
54 static inline int reactor_populate_monitor(struct rv_monitor_def
*mdef
)
59 static inline void reactor_cleanup_monitor(struct rv_monitor_def
*mdef
)
64 static inline int init_rv_reactors(struct dentry
*root_dir
)