diff options
| author | zy <[email protected]> | 2023-12-14 02:22:17 -0500 |
|---|---|---|
| committer | zy <[email protected]> | 2023-12-14 02:22:17 -0500 |
| commit | a7e4c1e4fa85714a9e062afe5529218871bb959f (patch) | |
| tree | 967065ff95c1a718a9044d8f4d4bb0b26c1b628d /source/module/monitor_proc.c | |
| parent | 5d9fd19ddb02326e3d6d9534b899376afe8d9049 (diff) | |
ucli perf software irq
Diffstat (limited to 'source/module/monitor_proc.c')
| -rw-r--r-- | source/module/monitor_proc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/module/monitor_proc.c b/source/module/monitor_proc.c index 9603d5b..f7960f8 100644 --- a/source/module/monitor_proc.c +++ b/source/module/monitor_proc.c @@ -8,6 +8,7 @@ const char* proc_dir = "variable_monitor"; int def_interval_ns = DEFAULT_INTERVAL_NS; int dump_reset_sec = DEFAULT_DUMP_RESET_SEC; +int sample_all = DEFAULT_SAMPLE_ALL; static ssize_t read_proc(struct file *file, char __user *buf, size_t count, loff_t *offset, int *var) { @@ -54,6 +55,16 @@ static ssize_t write_proc_dump_reset_sec(struct file *file, return write_proc(file, buf, count, offset, &dump_reset_sec); } +static ssize_t read_proc_sample_all(struct file *file, char __user *buf, + size_t count, loff_t *offset) { + return read_proc(file, buf, count, offset, &sample_all); +} +static ssize_t write_proc_sample_all(struct file *file, + const char __user *buf, size_t count, + loff_t *offset) { + return write_proc(file, buf, count, offset, &sample_all); +} + static const struct proc_ops proc_def_interval_ns_ops = { .proc_read = read_proc_def_interval_ns, .proc_write = write_proc_def_interval_ns, @@ -64,6 +75,11 @@ static const struct proc_ops proc_dump_reset_sec_ops = { .proc_write = write_proc_dump_reset_sec, }; +static const struct proc_ops proc_sample_all_ops = { + .proc_read = read_proc_sample_all, + .proc_write = write_proc_sample_all, +}; + int monitor_proc_init(void) { struct proc_dir_entry *dir; @@ -75,6 +91,7 @@ int monitor_proc_init(void) { proc_create("def_interval_ns", 0666, dir, &proc_def_interval_ns_ops); proc_create("dump_reset_sec", 0666, dir, &proc_dump_reset_sec_ops); + proc_create("sample_all", 0666, dir, &proc_sample_all_ops); return 0; } |
