Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #include <linux/mutex.h>
0003 
0004 struct rv_interface {
0005     struct dentry       *root_dir;
0006     struct dentry       *monitors_dir;
0007 };
0008 
0009 #include "../trace.h"
0010 #include <linux/tracefs.h>
0011 #include <linux/rv.h>
0012 
0013 #define RV_MODE_WRITE           TRACE_MODE_WRITE
0014 #define RV_MODE_READ            TRACE_MODE_READ
0015 
0016 #define rv_create_dir           tracefs_create_dir
0017 #define rv_create_file          tracefs_create_file
0018 #define rv_remove           tracefs_remove
0019 
0020 #define MAX_RV_MONITOR_NAME_SIZE    32
0021 #define MAX_RV_REACTOR_NAME_SIZE    32
0022 
0023 extern struct mutex rv_interface_lock;
0024 
0025 #ifdef CONFIG_RV_REACTORS
0026 struct rv_reactor_def {
0027     struct list_head    list;
0028     struct rv_reactor   *reactor;
0029     /* protected by the monitor interface lock */
0030     int         counter;
0031 };
0032 #endif
0033 
0034 struct rv_monitor_def {
0035     struct list_head    list;
0036     struct rv_monitor   *monitor;
0037     struct dentry       *root_d;
0038 #ifdef CONFIG_RV_REACTORS
0039     struct rv_reactor_def   *rdef;
0040     bool            reacting;
0041 #endif
0042     bool            task_monitor;
0043 };
0044 
0045 struct dentry *get_monitors_root(void);
0046 int rv_disable_monitor(struct rv_monitor_def *mdef);
0047 int rv_enable_monitor(struct rv_monitor_def *mdef);
0048 
0049 #ifdef CONFIG_RV_REACTORS
0050 int reactor_populate_monitor(struct rv_monitor_def *mdef);
0051 void reactor_cleanup_monitor(struct rv_monitor_def *mdef);
0052 int init_rv_reactors(struct dentry *root_dir);
0053 #else
0054 static inline int reactor_populate_monitor(struct rv_monitor_def *mdef)
0055 {
0056     return 0;
0057 }
0058 
0059 static inline void reactor_cleanup_monitor(struct rv_monitor_def *mdef)
0060 {
0061     return;
0062 }
0063 
0064 static inline int init_rv_reactors(struct dentry *root_dir)
0065 {
0066     return 0;
0067 }
0068 #endif