From: Alessandro Carminati <acarmina@redhat.com>
To: linux-trace-devel@vger.kernel.org
Cc: alessandro.carminati@gmail.com, acarmina@redhat.com,
bristot@kernel.org, rostedt@goodmis.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] rv/monitors: Move monitor structure in rodata
Date: Fri, 18 Nov 2022 17:20:33 +0100 [thread overview]
Message-ID: <20221118162033.66389-1-acarmina@redhat.com> (raw)
It makes sense to move the important monitor structure into rodata to
prevent accidental structure modification.
Signed-off-by: Alessandro Carminati <acarmina@redhat.com>
---
kernel/trace/rv/monitors/wip/wip.h | 2 +-
kernel/trace/rv/monitors/wwnr/wwnr.h | 2 +-
tools/verification/dot2/dot2c.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/trace/rv/monitors/wip/wip.h b/kernel/trace/rv/monitors/wip/wip.h
index dacc37b62a2c..9c0cd0ad5cd7 100644
--- a/kernel/trace/rv/monitors/wip/wip.h
+++ b/kernel/trace/rv/monitors/wip/wip.h
@@ -27,7 +27,7 @@ struct automaton_wip {
bool final_states[state_max_wip];
};
-static struct automaton_wip automaton_wip = {
+const static struct automaton_wip automaton_wip = {
.state_names = {
"preemptive",
"non_preemptive"
diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.h b/kernel/trace/rv/monitors/wwnr/wwnr.h
index 118e576b91b4..57dfb1c46cb8 100644
--- a/kernel/trace/rv/monitors/wwnr/wwnr.h
+++ b/kernel/trace/rv/monitors/wwnr/wwnr.h
@@ -27,7 +27,7 @@ struct automaton_wwnr {
bool final_states[state_max_wwnr];
};
-static struct automaton_wwnr automaton_wwnr = {
+const static struct automaton_wwnr automaton_wwnr = {
.state_names = {
"not_running",
"running"
diff --git a/tools/verification/dot2/dot2c.py b/tools/verification/dot2/dot2c.py
index be8a364a469b..512c7a11830f 100644
--- a/tools/verification/dot2/dot2c.py
+++ b/tools/verification/dot2/dot2c.py
@@ -111,7 +111,7 @@ class Dot2c(Automata):
def format_aut_init_header(self):
buff = []
- buff.append("static struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def))
+ buff.append("const static struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def))
return buff
def __get_string_vector_per_line_content(self, buff):
--
2.31.1
next reply other threads:[~2022-11-18 16:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 16:20 Alessandro Carminati [this message]
2022-11-22 14:13 ` [PATCH] rv/monitors: Move monitor structure in rodata Daniel Bristot de Oliveira
2022-11-22 17:36 ` [PATCH v2] " Alessandro Carminati
2022-11-23 7:55 ` Daniel Bristot de Oliveira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221118162033.66389-1-acarmina@redhat.com \
--to=acarmina@redhat.com \
--cc=alessandro.carminati@gmail.com \
--cc=bristot@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.