summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNam Cao <namcao@linutronix.de>2025-07-24 20:33:27 +0300
committerSteven Rostedt (Google) <rostedt@goodmis.org>2025-07-25 16:04:14 +0300
commit24cbfe18d55a6866bc2e27fda74306f4a1b5cb01 (patch)
tree230f3fe45389ad87a72c7c21d89bf96130b02b77 /include
parentb0c08dd5348dfd8098bdb815bb04e7c59dfaea79 (diff)
downloadlinux-24cbfe18d55a6866bc2e27fda74306f4a1b5cb01.tar.xz
rv: Merge struct rv_monitor_def into struct rv_monitor
Each struct rv_monitor has a unique struct rv_monitor_def associated with it. struct rv_monitor is statically allocated, while struct rv_monitor_def is dynamically allocated. This makes the code more complicated than it should be: - Lookup is required to get the associated rv_monitor_def from rv_monitor - Dynamic memory allocation is required for rv_monitor_def. This is harder to get right compared to static memory. For instance, there is an existing mistake: rv_unregister_monitor() does not free the memory allocated by rv_register_monitor(). This is fortunately not a real memory leak problem, as rv_unregister_monitor() is never called. Simplify and merge rv_monitor_def into rv_monitor. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/194449c00f87945c207aab4c96920c75796a4f53.1753378331.git.namcao@linutronix.de Reviewed-by: Gabriele Monaco <gmonaco@redhat.com> Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/rv.h b/include/linux/rv.h
index 97baf58d88b2..dba53aecdfab 100644
--- a/include/linux/rv.h
+++ b/include/linux/rv.h
@@ -7,6 +7,9 @@
#ifndef _LINUX_RV_H
#define _LINUX_RV_H
+#include <linux/types.h>
+#include <linux/list.h>
+
#define MAX_DA_NAME_LEN 32
#ifdef CONFIG_RV
@@ -98,8 +101,13 @@ struct rv_monitor {
void (*disable)(void);
void (*reset)(void);
#ifdef CONFIG_RV_REACTORS
+ struct rv_reactor_def *rdef;
__printf(1, 2) void (*react)(const char *msg, ...);
+ bool reacting;
#endif
+ struct list_head list;
+ struct rv_monitor *parent;
+ struct dentry *root_d;
};
bool rv_monitoring_on(void);