-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
verification/dot2k: Add support for nested monitors
RV now supports nested monitors, this functionality requires a container monitor, which has virtually no functionality besides holding other monitors, and nested monitors, that have a container as parent. Add the -p flag to pass a parent to a monitor, this sets it up while registering the monitor and adds necessary includes and configurations. Add the -c flag to create a container, since containers are empty, we don't allow supplying a dot model or a monitor type, the template is also different since functions to enable and disable the monitor are not defined, nor any tracepoint. The generated header file only allows to include the rv_monitor structure in children monitors. Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Juri Lelli <juri.lelli@redhat.com> Link: https://lore.kernel.org/20250305140406.350227-8-gmonaco@redhat.com Signed-off-by: Gabriele Monaco <gmonaco@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
- Loading branch information
Gabriele Monaco
authored and
Steven Rostedt (Google)
committed
Mar 24, 2025
1 parent
eba321a
commit 2334cf7
Showing
6 changed files
with
125 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
#include <linux/init.h> | ||
#include <linux/rv.h> | ||
|
||
#define MODULE_NAME "%%MODEL_NAME%%" | ||
|
||
#include "%%MODEL_NAME%%.h" | ||
|
||
struct rv_monitor rv_%%MODEL_NAME%%; | ||
|
||
struct rv_monitor rv_%%MODEL_NAME%% = { | ||
.name = "%%MODEL_NAME%%", | ||
.description = "%%DESCRIPTION%%", | ||
.enable = NULL, | ||
.disable = NULL, | ||
.reset = NULL, | ||
.enabled = 0, | ||
}; | ||
|
||
static int __init register_%%MODEL_NAME%%(void) | ||
{ | ||
rv_register_monitor(&rv_%%MODEL_NAME%%, NULL); | ||
return 0; | ||
} | ||
|
||
static void __exit unregister_%%MODEL_NAME%%(void) | ||
{ | ||
rv_unregister_monitor(&rv_%%MODEL_NAME%%); | ||
} | ||
|
||
module_init(register_%%MODEL_NAME%%); | ||
module_exit(unregister_%%MODEL_NAME%%); | ||
|
||
MODULE_LICENSE("GPL"); | ||
MODULE_AUTHOR("dot2k: auto-generated"); | ||
MODULE_DESCRIPTION("%%MODEL_NAME%%: %%DESCRIPTION%%"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
extern struct rv_monitor rv_%%MODEL_NAME%%; |